Skip to content

Commit

Permalink
fix!: remove commonjs support from cspell-grammar (#4588)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Jun 27, 2023
1 parent 1d31c73 commit 67821c3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 36 deletions.
2 changes: 1 addition & 1 deletion packages/cspell-grammar/bin.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node

import * as app from './dist/esm/app.mjs';
import * as app from './dist/app.js';

app.run(process.argv);
37 changes: 17 additions & 20 deletions packages/cspell-grammar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,46 @@
"bin": {
"cspell-grammar": "bin.mjs"
},
"type": "commonjs",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"module": "dist/esm/index.mjs",
"type": "module",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"exports": {
".": {
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js"
"import": "./dist/index.js"
},
"./parsers/typescript": {
"import": "./dist/esm/parsers/typescript/index.mjs",
"require": "./dist/cjs/parsers/typescript/index.js"
"import": "./dist/parsers/typescript/index.js"
}
},
"typesVersions": {
"*": {
"index.js": [
"dist/cjs/index.d.ts"
"dist/index.d.ts"
],
"index.d.ts": [
"dist/cjs/index.d.ts"
"dist/index.d.ts"
],
"dist/cjs/*.d.ts": [
"dist/cjs/*.d.ts"
"dist/*.d.ts": [
"dist/*.d.ts"
],
"parsers": [
"dist/parsers/index.d.ts"
],
"parsers/typescript": [
"dist/cjs/parsers/typescript/index.d.ts"
"dist/parsers/typescript/index.d.ts"
],
"parsers/typescript/*.d.ts": [
"dist/cjs/parsers/typescript/*.d.ts"
"dist/parsers/typescript/*.d.ts"
],
"*": [
"dist/cjs/*.d.ts",
"dist/cjs/*/index.d.ts"
"dist/*.d.ts",
"dist/*/index.d.ts"
]
}
},
"files": [
"bin.mjs",
"dist",
"!dist/esm/**/*.js",
"!dist/esm/**/*.ts",
"!**/*.tsbuildInfo",
"!**/__mocks__",
"!**/test/**",
Expand All @@ -63,8 +61,7 @@
],
"scripts": {
"clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
"build": "tsc -b . && ts2mjs dist/esm",
"build:esm": "tsc -p tsconfig.esm.json",
"build": "tsc -b .",
"clean-build": "pnpm run clean && pnpm run build",
"coverage": "pnpm coverage:vitest && pnpm coverage:fix",
"coverage:vitest": "vitest run --coverage",
Expand Down
13 changes: 0 additions & 13 deletions packages/cspell-grammar/tsconfig.cjs.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/cspell-grammar/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"module": "ES2020",
"moduleResolution": "node16",
"rootDir": "src",
"outDir": "dist/esm",
"outDir": "dist",
"sourceMap": false,
"types": ["node"]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cspell-grammar/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"files": [],
"references": [{ "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.esm.json" }]
"references": [{ "path": "./tsconfig.esm.json" }]
}

0 comments on commit 67821c3

Please sign in to comment.