Skip to content

Commit 3571171

Browse files
committed
Publishing ESM version over commonjs, welcome to 2024
1 parent b658a20 commit 3571171

File tree

2 files changed

+19
-74
lines changed

2 files changed

+19
-74
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"engines": {
44
"node": ">=16"
55
},
6-
"version": "2.1.5",
6+
"version": "3.0.0",
7+
"type": "module",
78
"description": "A GLSL ES 1.0 and 3.0 parser and preprocessor that can preserve whitespace and comments",
89
"scripts": {
910
"prepare": "npm run build && ./prepublish.sh",

tsconfig.json

+17-73
Original file line numberDiff line numberDiff line change
@@ -8,82 +8,26 @@
88
// window.location, when in fact it's peggy's location() function.
99
"lib": ["ESNext"],
1010

11-
/* Modules */
12-
"module": "commonjs", /* Specify what module code is generated. */
13-
// "rootDir": "./", /* Specify the root folder within your source files. */
14-
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
15-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
16-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
17-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
11+
// Create ESM modules
12+
"module": "esnext",
13+
// Specify multiple folders that act like `./node_modules/@types`
1814
"typeRoots": [
1915
"node_modules/@types",
2016
"./preprocessor",
2117
"./parser"
22-
], /* Specify multiple folders that act like `./node_modules/@types`. */
23-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
24-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
25-
// "resolveJsonModule": true, /* Enable importing .json files */
26-
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
27-
28-
/* JavaScript Support */
29-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
30-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
31-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
32-
33-
/* Emit */
34-
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
35-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
36-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
37-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
38-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
39-
"outDir": "./dist", /* Specify an output folder for all emitted files. */
40-
// "removeComments": true, /* Disable emitting comments. */
41-
// "noEmit": true, /* Disable emitting files from a compilation. */
42-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
43-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
44-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
45-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
46-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
47-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
48-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
49-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
50-
// "newLine": "crlf", /* Set the newline character for emitting files. */
51-
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
52-
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
53-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
54-
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
55-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
56-
57-
/* Interop Constraints */
58-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
59-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
60-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
61-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
62-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
63-
64-
/* Type Checking */
65-
"strict": true, /* Enable all strict type-checking options. */
66-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
67-
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
68-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
69-
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
70-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
71-
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
72-
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
73-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
74-
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
75-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
76-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
77-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
78-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
79-
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
80-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
81-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
82-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
83-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
84-
85-
/* Completeness */
86-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
87-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
18+
],
19+
20+
// Generate .d.ts files from TypeScript and JavaScript files in your project
21+
"declaration": true,
22+
// Specify an output folder for all emitted files.
23+
"outDir": "./dist",
24+
// Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
25+
"esModuleInterop": true,
26+
// Ensure that casing is correct in imports
27+
"forceConsistentCasingInFileNames": true,
28+
// Enable all strict type-checking options.
29+
"strict": true,
30+
// Skip type checking all .d.ts files
31+
"skipLibCheck": true
8832
}
8933
}

0 commit comments

Comments
 (0)