Skip to content

Commit cf3a025

Browse files
committed
Move standalone to type: module.
1 parent 54a2562 commit cf3a025

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
dist
2+
dist.*
23
./configs
34
node_modules
45
jest.config.js

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Build directory
22
dist
3-
standalone/dist.mjs
4-
standalone/dist.mjs.map
3+
dist.*
54

65
# Logs
76
logs

standalone/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"name": "eslint-solid-standalone",
33
"version": "0.13.2",
44
"description": "A bundle with eslint and eslint-plugin-solid that can be used in the browser.",
5+
"type": "module",
56
"files": [
6-
"dist.mjs",
7+
"dist.js",
78
"dist.d.ts",
8-
"dist.mjs.map",
9+
"dist.js.map",
910
"README.md"
1011
],
11-
"main": "dist.mjs",
12+
"main": "dist.js",
1213
"types": "dist.d.ts",
1314
"repository": "https://github.com/solidjs-community/eslint-plugin-solid",
1415
"author": "Josh Wilson <[email protected]>",

standalone/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212
interop: "auto",
1313
freeze: false,
1414
sourcemap: true,
15-
file: "dist.mjs",
15+
file: "dist.js",
1616
},
1717
external: ["vs/language/typescript/tsWorker", "typescript"],
1818
plugins: [

standalone/test.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import vm from "node:vm";
66
import typescript from "typescript";
77

88
/**
9-
* Test that dist.mjs can be run in a clean environment without Node or browser APIs, that it won't
9+
* Test that dist.js can be run in a clean environment without Node or browser APIs, that it won't
1010
* crash, and that it will produce expected results. Code in, lints/fixes out is all it needs to do.
1111
*/
1212

@@ -17,8 +17,8 @@ const context = vm.createContext({
1717
});
1818

1919
// create a module with the standalone build
20-
const code = fs.readFileSync(path.resolve("dist.mjs"), "utf-8");
21-
const dist = new vm.SourceTextModule(code, { identifier: "dist.mjs", context });
20+
const code = fs.readFileSync(path.resolve("dist.js"), "utf-8");
21+
const dist = new vm.SourceTextModule(code, { identifier: "dist.js", context });
2222

2323
// create a module reexporting typescript, a peer dependency of the standalone build
2424
const ts = new vm.SourceTextModule("export default _TYPESCRIPT_GLOBAL", {
@@ -29,7 +29,7 @@ const ts = new vm.SourceTextModule("export default _TYPESCRIPT_GLOBAL", {
2929
// create a module that tests the build with `assert`
3030
const test = new vm.SourceTextModule(
3131
`
32-
import { plugin, pluginVersion, eslintVersion, verify, verifyAndFix } from "dist.mjs";
32+
import { plugin, pluginVersion, eslintVersion, verify, verifyAndFix } from "dist.js";
3333
3434
// check no Node APIs are present, except injected 'assert' and '_TYPESCRIPT_GLOBAL'
3535
assert.equal(Object.keys(globalThis).length, 2);
@@ -72,7 +72,7 @@ assert.deepStrictEqual(verifyAndFix('let el = <div className="red" />'), {
7272
const linker = (specifier) => {
7373
const mod = {
7474
typescript: ts,
75-
"dist.mjs": dist,
75+
"dist.js": dist,
7676
}[specifier];
7777
if (!mod) {
7878
throw new Error("can't import other modules");

0 commit comments

Comments
 (0)