Skip to content

Commit

Permalink
Merge pull request #47 from distributed-lab/fix/mjs
Browse files Browse the repository at this point in the history
remove mjs compiling
  • Loading branch information
napalmpapalam authored Feb 28, 2024
2 parents 857108a + 68d6893 commit 78e5fc4
Show file tree
Hide file tree
Showing 18 changed files with 91 additions and 38 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/fetcher/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ jest.config.js
tsconfig.json
tsconfig.build.json
.swcrc
postbuild.js
14 changes: 7 additions & 7 deletions packages/fetcher/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -18,25 +18,25 @@
}
},
"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": {
".": {
"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"
Expand Down
3 changes: 3 additions & 0 deletions packages/fetcher/postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const postbuild = require('../../scripts/postbuild')

postbuild(__dirname)
1 change: 1 addition & 0 deletions packages/jac/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ jest.config.js
tsconfig.json
tsconfig.build.json
.swcrc
postbuild.js
14 changes: 7 additions & 7 deletions packages/jac/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -18,25 +18,25 @@
}
},
"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": {
".": {
"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"
Expand Down
3 changes: 3 additions & 0 deletions packages/jac/postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const postbuild = require('../../scripts/postbuild')

postbuild(__dirname)
1 change: 1 addition & 0 deletions packages/reactivity/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ jest.config.js
tsconfig.json
tsconfig.build.json
.swcrc
postbuild.js
14 changes: 7 additions & 7 deletions packages/reactivity/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -18,25 +18,25 @@
}
},
"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": {
".": {
"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"
Expand Down
3 changes: 3 additions & 0 deletions packages/reactivity/postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const postbuild = require('../../scripts/postbuild')

postbuild(__dirname)
1 change: 1 addition & 0 deletions packages/tools/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ jest.config.js
tsconfig.json
tsconfig.build.json
.swcrc
postbuild.js
14 changes: 7 additions & 7 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -18,25 +18,25 @@
}
},
"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": {
".": {
"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"
Expand Down
3 changes: 3 additions & 0 deletions packages/tools/postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const postbuild = require('../../scripts/postbuild')

postbuild(__dirname)
1 change: 1 addition & 0 deletions packages/w3p/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ jest.config.js
tsconfig.json
tsconfig.build.json
.swcrc
postbuild.js
10 changes: 8 additions & 2 deletions packages/w3p/.swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
14 changes: 7 additions & 7 deletions packages/w3p/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -18,25 +18,25 @@
}
},
"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": {
".": {
"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"
Expand Down
3 changes: 3 additions & 0 deletions packages/w3p/postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const postbuild = require('../../scripts/postbuild')

postbuild(__dirname)
22 changes: 22 additions & 0 deletions scripts/postbuild.js
Original file line number Diff line number Diff line change
@@ -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`,
})
}

0 comments on commit 78e5fc4

Please sign in to comment.