-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: add reproduction repo for module export Repo is copied from #816 inside to test in future * fix(all-settled): bundler esm import fix(async): bundler esm import fix(core-v1): bundler esm import fix(core): bundler esm import fix(effects): bundler esm import fix(eslint-plugin): bundler esm import fix(form-web): bundler esm import fix(form): bundler esm import fix(framework): bundler esm import fix(hooks): bundler esm import fix(jsx): bundler esm import fix(lens): bundler esm import fix(logger): bundler esm import fix(npm-cookie-baker): bundler esm import fix(npm-history): bundler esm import fix(npm-lit): bundler esm import fix(npm-react): bundler esm import fix(npm-solid-js): bundler esm import fix(npm-svelte): bundler esm import fix(npm-vue): bundler esm import fix(persist-web-storage): bundler esm import fix(persist): bundler esm import fix(primitives): bundler esm import fix(react-v1): bundler esm import fix(testing): bundler esm import fix(timer): bundler esm import fix(undo): bundler esm import fix(url): bundler esm import fix(utils): bundler esm import fix(web-fetch): bundler esm import fix(web): bundler esm import Reatom used to use package.json#module field to declare esm modules. Turns out it was only in draft spec and never was standardized. So instead of relying on non-standard behaviour we use .mjs which is standard nodejs mechanizm. Should fix #816 #806 #573 * fix(new-package-template): use mjs in module export * test: implement cjs and esm check test * chore: install test files
- Loading branch information
Showing
41 changed files
with
205 additions
and
69 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#reatom CJS issue | ||
Reproduce for CJS-related reatom issue | ||
|
||
This repo is used to reproduce problems with import of "module" exported files. | ||
|
||
``` | ||
yarn | ||
yarn build | ||
yarn start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@reatom-private/cjs-import-check", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"type": "commonjs", | ||
"private": true, | ||
"license": "MIT", | ||
"dependencies": { | ||
"@reatom/framework": "^3.4.37" | ||
}, | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"start": "node ./dist/hello.js", | ||
"pretest": "npm run build", | ||
"test": "node ./dist/hello.js" | ||
}, | ||
"devDependencies": { | ||
"typescript": "5.4.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const {atom, createCtx} = require('@reatom/framework') | ||
const me = atom('check ✅', 'me') | ||
const ctx = createCtx() | ||
console.log('CommonJS import:', ctx.get(me)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"target": "ES2022", | ||
"module": "ES2022", | ||
"moduleResolution": "Node10", | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"outDir": "./dist", | ||
}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#reatom esm issue | ||
Reproduce for ESM-related reatom issue | ||
|
||
This repo is used to reproduce problems with import of "module" exported files. | ||
|
||
``` | ||
yarn | ||
yarn build | ||
yarn start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@reatom-private/esm-import-check", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"type": "module", | ||
"license": "MIT", | ||
"private": true, | ||
"dependencies": { | ||
"@reatom/framework": "^3.4.37" | ||
}, | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"start": "node ./dist/hello.js", | ||
"pretest": "npm run build", | ||
"test": "node ./dist/hello.js" | ||
}, | ||
"devDependencies": { | ||
"typescript": "5.4.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import {atom, createCtx} from '@reatom/framework' | ||
const me = atom('check ✅', 'me') | ||
const ctx = createCtx() | ||
console.log('ESM import:', ctx.get(me)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"target": "ES2022", | ||
"module": "ES2022", | ||
"moduleResolution": "Bundler", | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"outDir": "./dist", | ||
}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.