Skip to content

Commit

Permalink
BREAKING CHANGE: drop CommonJS support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nipheris committed Jun 13, 2024
1 parent 7ece760 commit 18bd57c
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 478 deletions.
381 changes: 0 additions & 381 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
"editorconfig-checker": "^4.0.2",
"eslint": "^8.26.0",
"globals": "^13.17.0",
"replace-ext": "^2.0.0",
"rollup": "^3.2.3",
"ts-transform-import-path-rewrite": "^0.3.0",
"ttypescript": "^1.5.13",
"typescript": "4.8.4"
},
"private": true,
Expand Down
11 changes: 4 additions & 7 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"version": "0.0.0",
"description": "Functionality on top of HTML canvas element, including support for HiDPI and pixel-perfect rendering",
"scripts": {
"build": "npm run build:esmodule && npm run build:commonjs && node ../tools/build-package-json package.json ../dist/fancy-canvas/package.json",
"build:commonjs": "tsc --project tsconfig.cjs.json",
"build:esmodule": "ttsc --project tsconfig.esm.json && node ../tools/replace-extension ../dist/fancy-canvas .js .mjs && node ../tools/replace-extension ../dist/fancy-canvas .ts .mts"
"build": "tsc --project tsconfig.json && node ../tools/build-package-json package.json ../dist/fancy-canvas/package.json"
},
"keywords": [
"html",
Expand All @@ -17,10 +15,9 @@
"author": "[email protected]",
"license": "MIT",
"private": true,
"type": "commonjs",
"module": "./index.mjs",
"type": "module",
"module": "./index.js",
"exports": {
"import": "./index.mjs",
"require": "./index.js"
"import": "./index.js"
}
}
7 changes: 0 additions & 7 deletions src/tsconfig.cjs.json

This file was deleted.

27 changes: 0 additions & 27 deletions src/tsconfig.esm.json

This file was deleted.

2 changes: 2 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"declaration": true,
"outDir": "../dist/fancy-canvas",
"module": "node16",
"moduleResolution": "node16"
}
}
File renamed without changes.
8 changes: 0 additions & 8 deletions tests/node-commonjs/index.cts

This file was deleted.

6 changes: 0 additions & 6 deletions tests/node-commonjs/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions tests/node-commonjs/tsconfig.json

This file was deleted.

6 changes: 0 additions & 6 deletions tests/node-esmodules/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions tests/node-esmodules/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"start": "npm start --prefix node-commonjs && npm start --prefix node-esmodules"
"start": "ts-node-esm index.mts"
},
"dependencies": {
"fancy-canvas": "file:../dist/fancy-canvas",
Expand Down
4 changes: 3 additions & 1 deletion tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"lib": ["dom", "es2015"]
"lib": ["dom", "es2015"],
"module": "node16",
"moduleResolution": "node16"
}
}
2 changes: 1 addition & 1 deletion tools/build-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ const output = {
type: input.type,

// contents
files: ['**/*.mjs', '**/*.d.mts', '**/*.js', '**/*.d.ts'],
files: ['**/*.js', '**/*.d.ts'],
};
fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
16 changes: 0 additions & 16 deletions tools/replace-extension.js

This file was deleted.

0 comments on commit 18bd57c

Please sign in to comment.