diff --git a/CHANGELOG.md b/CHANGELOG.md index b4ce1ab4..f5416fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.0-rc.12] - 2024-02-28 +### Removed +- `all` - Compling output into `.mjs` extension + ## [1.0.0-rc.11] - 2024-02-28 ### Changed - `all` @@ -362,7 +366,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [old repo]: https://github.com/distributed-lab/web-kit-old -[Unreleased]: https://github.com/distributed-lab/web-kit/compare/1.0.0-rc.11...HEAD +[Unreleased]: https://github.com/distributed-lab/web-kit/compare/1.0.0-rc.12...HEAD +[1.0.0-rc.12]: https://github.com/distributed-lab/web-kit/compare/1.0.0-rc.11...1.0.0-rc.12 [1.0.0-rc.11]: https://github.com/distributed-lab/web-kit/compare/1.0.0-rc.10...1.0.0-rc.11 [1.0.0-rc.10]: https://github.com/distributed-lab/web-kit/compare/1.0.0-rc.9...1.0.0-rc.10 [1.0.0-rc.9]: https://github.com/distributed-lab/web-kit/compare/1.0.0-rc.8...1.0.0-rc.9 diff --git a/packages/fetcher/.npmignore b/packages/fetcher/.npmignore index fcd829ee..d1d5c424 100644 --- a/packages/fetcher/.npmignore +++ b/packages/fetcher/.npmignore @@ -4,3 +4,4 @@ jest.config.js tsconfig.json tsconfig.build.json .swcrc +postbuild.js diff --git a/packages/fetcher/package.json b/packages/fetcher/package.json index cbc3c4b3..4bf2d73a 100644 --- a/packages/fetcher/package.json +++ b/packages/fetcher/package.json @@ -1,6 +1,6 @@ { "name": "@distributedlab/fetcher", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Fetch API wrapper with the extended functionality and simple interface", "repository": { "type": "git", @@ -18,8 +18,8 @@ } }, "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.mjs", - "browser": "./dist/esm/index.mjs", + "module": "./dist/esm/index.js", + "browser": "./dist/esm/index.js", "node": "./dist/cjs/index.js", "types": "index.d.ts", "exports": { @@ -27,16 +27,16 @@ "types": "./dist/types/index.d.ts", "require": "./dist/cjs/index.js", "node": "./dist/cjs/index.js", - "import": "./dist/esm/index.mjs", - "default": "./dist/esm/index.mjs" + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" } }, "scripts": { "build": "yarn clean && yarn build:types && yarn build:cjs && yarn build:esm && yarn build:tsc-alias", "build:types": "tsc -p tsconfig.build.json --outDir ./dist/types --declaration --emitDeclarationOnly", "build:cjs": "npx swc src -d ./dist/cjs --strip-leading-paths --config-file .swcrc -C module.type=commonjs", - "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --out-file-extension mjs --config-file .swcrc -C isModule=true", - "build:tsc-alias": "tsc-alias -p tsconfig.json --outDir ./dist/types", + "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --config-file .swcrc -C isModule=true -C module.type=es6", + "build:tsc-alias": "node ./postbuild.js", "clean": "rm -rf dist", "test": "yarn jest --verbose", "typecheck": "tsc --noEmit" diff --git a/packages/fetcher/postbuild.js b/packages/fetcher/postbuild.js new file mode 100644 index 00000000..71314763 --- /dev/null +++ b/packages/fetcher/postbuild.js @@ -0,0 +1,3 @@ +const postbuild = require('../../scripts/postbuild') + +postbuild(__dirname) diff --git a/packages/jac/.npmignore b/packages/jac/.npmignore index fcd829ee..d1d5c424 100644 --- a/packages/jac/.npmignore +++ b/packages/jac/.npmignore @@ -4,3 +4,4 @@ jest.config.js tsconfig.json tsconfig.build.json .swcrc +postbuild.js diff --git a/packages/jac/package.json b/packages/jac/package.json index 5e3636db..1d72426b 100644 --- a/packages/jac/package.json +++ b/packages/jac/package.json @@ -1,6 +1,6 @@ { "name": "@distributedlab/jac", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "A library for constructing JSON-API compliant requests and responses", "repository": { "type": "git", @@ -18,8 +18,8 @@ } }, "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.mjs", - "browser": "./dist/esm/index.mjs", + "module": "./dist/esm/index.js", + "browser": "./dist/esm/index.js", "node": "./dist/cjs/index.js", "types": "index.d.ts", "exports": { @@ -27,16 +27,16 @@ "types": "./dist/types/index.d.ts", "require": "./dist/cjs/index.js", "node": "./dist/cjs/index.js", - "import": "./dist/esm/index.mjs", - "default": "./dist/esm/index.mjs" + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" } }, "scripts": { "build": "yarn clean && yarn build:types && yarn build:cjs && yarn build:esm && yarn build:tsc-alias", "build:types": "tsc -p tsconfig.build.json --outDir ./dist/types --declaration --emitDeclarationOnly", "build:cjs": "npx swc src -d ./dist/cjs --strip-leading-paths --config-file .swcrc -C module.type=commonjs", - "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --out-file-extension mjs --config-file .swcrc -C isModule=true", - "build:tsc-alias": "tsc-alias -p tsconfig.json --outDir ./dist/types", + "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --config-file .swcrc -C isModule=true -C module.type=es6", + "build:tsc-alias": "node ./postbuild.js", "clean": "rm -rf dist", "test": "yarn jest --verbose", "typecheck": "tsc --noEmit" diff --git a/packages/jac/postbuild.js b/packages/jac/postbuild.js new file mode 100644 index 00000000..71314763 --- /dev/null +++ b/packages/jac/postbuild.js @@ -0,0 +1,3 @@ +const postbuild = require('../../scripts/postbuild') + +postbuild(__dirname) diff --git a/packages/reactivity/.npmignore b/packages/reactivity/.npmignore index fcd829ee..d1d5c424 100644 --- a/packages/reactivity/.npmignore +++ b/packages/reactivity/.npmignore @@ -4,3 +4,4 @@ jest.config.js tsconfig.json tsconfig.build.json .swcrc +postbuild.js diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index c4d80ae5..dbc501a2 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@distributedlab/reactivity", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Implementation of the reactivity connections to propagate changes between objects", "repository": { "type": "git", @@ -18,8 +18,8 @@ } }, "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.mjs", - "browser": "./dist/esm/index.mjs", + "module": "./dist/esm/index.js", + "browser": "./dist/esm/index.js", "node": "./dist/cjs/index.js", "types": "index.d.ts", "exports": { @@ -27,16 +27,16 @@ "types": "./dist/types/index.d.ts", "require": "./dist/cjs/index.js", "node": "./dist/cjs/index.js", - "import": "./dist/esm/index.mjs", - "default": "./dist/esm/index.mjs" + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" } }, "scripts": { "build": "yarn clean && yarn build:types && yarn build:cjs && yarn build:esm && yarn build:tsc-alias", "build:types": "tsc -p tsconfig.build.json --outDir ./dist/types --declaration --emitDeclarationOnly", "build:cjs": "npx swc src -d ./dist/cjs --strip-leading-paths --config-file .swcrc -C module.type=commonjs", - "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --out-file-extension mjs --config-file .swcrc -C isModule=true", - "build:tsc-alias": "tsc-alias -p tsconfig.json --outDir ./dist/types", + "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --config-file .swcrc -C isModule=true -C module.type=es6", + "build:tsc-alias": "node ./postbuild.js", "clean": "rm -rf dist", "test": "yarn jest --verbose", "typecheck": "tsc --noEmit" diff --git a/packages/reactivity/postbuild.js b/packages/reactivity/postbuild.js new file mode 100644 index 00000000..71314763 --- /dev/null +++ b/packages/reactivity/postbuild.js @@ -0,0 +1,3 @@ +const postbuild = require('../../scripts/postbuild') + +postbuild(__dirname) diff --git a/packages/tools/.npmignore b/packages/tools/.npmignore index b626fc94..959ea833 100644 --- a/packages/tools/.npmignore +++ b/packages/tools/.npmignore @@ -3,3 +3,4 @@ jest.config.js tsconfig.json tsconfig.build.json .swcrc +postbuild.js diff --git a/packages/tools/package.json b/packages/tools/package.json index 29a3f8ae..053216b7 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@distributedlab/tools", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Collection of common utility functions and classes", "repository": { "type": "git", @@ -18,8 +18,8 @@ } }, "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.mjs", - "browser": "./dist/esm/index.mjs", + "module": "./dist/esm/index.js", + "browser": "./dist/esm/index.js", "node": "./dist/cjs/index.js", "types": "index.d.ts", "exports": { @@ -27,16 +27,16 @@ "types": "./dist/types/index.d.ts", "require": "./dist/cjs/index.js", "node": "./dist/cjs/index.js", - "import": "./dist/esm/index.mjs", - "default": "./dist/esm/index.mjs" + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" } }, "scripts": { "build": "yarn clean && yarn build:types && yarn build:cjs && yarn build:esm && yarn build:tsc-alias", "build:types": "tsc -p tsconfig.build.json --outDir ./dist/types --declaration --emitDeclarationOnly", "build:cjs": "npx swc src -d ./dist/cjs --strip-leading-paths --config-file .swcrc -C module.type=commonjs", - "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --out-file-extension mjs --config-file .swcrc -C isModule=true", - "build:tsc-alias": "tsc-alias -p tsconfig.json --outDir ./dist/types", + "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --config-file .swcrc -C isModule=true -C module.type=es6", + "build:tsc-alias": "node ./postbuild.js", "clean": "rm -rf dist", "test": "yarn jest --verbose", "typecheck": "tsc --noEmit" diff --git a/packages/tools/postbuild.js b/packages/tools/postbuild.js new file mode 100644 index 00000000..71314763 --- /dev/null +++ b/packages/tools/postbuild.js @@ -0,0 +1,3 @@ +const postbuild = require('../../scripts/postbuild') + +postbuild(__dirname) diff --git a/packages/w3p/.npmignore b/packages/w3p/.npmignore index 1ab122df..fb4a8915 100644 --- a/packages/w3p/.npmignore +++ b/packages/w3p/.npmignore @@ -4,3 +4,4 @@ jest.config.js tsconfig.json tsconfig.build.json .swcrc +postbuild.js diff --git a/packages/w3p/.swcrc b/packages/w3p/.swcrc index 982a3303..f614f87a 100644 --- a/packages/w3p/.swcrc +++ b/packages/w3p/.swcrc @@ -22,10 +22,16 @@ "keepClassNames": true, "preserveAllComments": true, "paths": { - "@/*": ["src/*"] + "@/*": [ + "src/*" + ] } }, - "exclude": ["examples","src/tests", ".test.ts"], + "exclude": [ + "examples", + "src/tests", + ".test.ts" + ], "minify": false, "sourceMaps": "inline" } diff --git a/packages/w3p/package.json b/packages/w3p/package.json index 23be4419..95955713 100644 --- a/packages/w3p/package.json +++ b/packages/w3p/package.json @@ -1,6 +1,6 @@ { "name": "@distributedlab/w3p", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Wrapper for Web3 Providers", "repository": { "type": "git", @@ -18,8 +18,8 @@ } }, "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.mjs", - "browser": "./dist/esm/index.mjs", + "module": "./dist/esm/index.js", + "browser": "./dist/esm/index.js", "node": "./dist/cjs/index.js", "types": "index.d.ts", "exports": { @@ -27,16 +27,16 @@ "types": "./dist/types/index.d.ts", "require": "./dist/cjs/index.js", "node": "./dist/cjs/index.js", - "import": "./dist/esm/index.mjs", - "default": "./dist/esm/index.mjs" + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" } }, "scripts": { "build": "yarn clean && yarn build:types && yarn build:cjs && yarn build:esm && yarn build:tsc-alias", "build:types": "tsc -p tsconfig.build.json --outDir ./dist/types --declaration --emitDeclarationOnly", "build:cjs": "npx swc src -d ./dist/cjs --strip-leading-paths --config-file .swcrc -C module.type=commonjs", - "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --out-file-extension mjs --config-file .swcrc -C isModule=true", - "build:tsc-alias": "tsc-alias -p tsconfig.json --outDir ./dist/types", + "build:esm": "npx swc src -d ./dist/esm --strip-leading-paths --config-file .swcrc -C isModule=true -C module.type=es6", + "build:tsc-alias": "node ./postbuild.js", "clean": "rm -rf dist", "test": "yarn jest --verbose", "typecheck": "tsc --noEmit" diff --git a/packages/w3p/postbuild.js b/packages/w3p/postbuild.js new file mode 100644 index 00000000..71314763 --- /dev/null +++ b/packages/w3p/postbuild.js @@ -0,0 +1,3 @@ +const postbuild = require('../../scripts/postbuild') + +postbuild(__dirname) diff --git a/scripts/postbuild.js b/scripts/postbuild.js new file mode 100644 index 00000000..6f95f1e8 --- /dev/null +++ b/scripts/postbuild.js @@ -0,0 +1,22 @@ +const fs = require('fs'); +const { replaceTscAliasPaths } = require('tsc-alias') + +const writeFile = (path, data) => { + fs.writeFile(path, JSON.stringify(data), (err) => { + if (err) throw err + }) +} + +module.exports = function postBuild(dirpath) { + writeFile(`${dirpath}/dist/esm/package.json`, { + "type": "module", + }) + writeFile(`${dirpath}/dist/cjs/package.json`, { + "type": "commonjs", + }) + + replaceTscAliasPaths({ + tsconfigPath: `${dirpath}/tsconfig.json`, + outDir: `${dirpath}/dist/types`, + }) +}