Skip to content

Commit

Permalink
update scripts to support esm syntax (#4)
Browse files Browse the repository at this point in the history
* update scripts to support esm syntax

* update package version
  • Loading branch information
chrisdholt authored Mar 31, 2022
1 parent d592f8c commit da2b4f7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
File renamed without changes.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
"author": {
"name": "Chris Holt"
},
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/chrisdholt/exenv-es6.git"
},
"type": "module",
"readme": "README.md",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"homepage": "https://github.com/chrisdholt/exenv-es6#readme",
"scripts": {
"clean:dist": "node ./build/clean.js dist",
"clean:dist": "node ./build/clean.cjs dist",
"prepare": "npm run clean:dist && tsc -p ./tsconfig.json",
"test": "npm run tslint && npm run unit-tests",
"tslint": "tslint -c ./tslint.json '**/*.ts'",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./can-use-dom";
export * from "./can-use-event-listeners";
export * from "./can-use-viewport";
export * from "./can-use-workers";
export * from "./can-use-dom.js";
export * from "./can-use-event-listeners.js";
export * from "./can-use-viewport.js";
export * from "./can-use-workers.js";
11 changes: 4 additions & 7 deletions src/jsdom-tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/**
* @jest-environment jsdom
*/

import {
canUseDOM,
canUseEventListeners,
canUseViewport,
canUseWorkers
} from "./index";
import { canUseDOM } from "./can-use-dom";
import { canUseEventListeners } from "./can-use-event-listeners";
import { canUseViewport } from "./can-use-viewport";
import { canUseWorkers } from "./can-use-workers";

describe("canUseDOM", (): void => {
test("should return true when jsdom is enabled and mocking the browser", (): void => {
Expand Down
11 changes: 4 additions & 7 deletions src/node-tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/**
* @jest-environment node
*/

import {
canUseDOM,
canUseEventListeners,
canUseViewport,
canUseWorkers
} from "./index";
import { canUseDOM } from "./can-use-dom";
import { canUseEventListeners } from "./can-use-event-listeners";
import { canUseViewport } from "./can-use-viewport";
import { canUseWorkers } from "./can-use-workers";

describe("canUseDOM", (): void => {
test("should return false in a node environment where the browser is not available", (): void => {
Expand Down

0 comments on commit da2b4f7

Please sign in to comment.