@jsenv/plugin-commonjs 2.7.20 → 2.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/cjs_to_esm.js +2 -2
- package/src/cjs_to_esm_raw.js +1 -1
- package/src/compile_cache/compiled_file_cache.js +3 -3
- package/src/compile_cache/update_compile_cache.js +2 -2
- package/src/compile_cache/validate_compile_cache.js +1 -1
- package/src/jsenv_plugin_commonjs.js +2 -2
- package/src/main.js +1 -1
- package/src/rollup_plugin_commonjs_named_exports.js +3 -3
- package/src/worker_runtime.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/plugin-commonjs",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"test": "node --conditions=development ./scripts/test.mjs"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@jsenv/filesystem": "4.8.
|
|
28
|
-
"@jsenv/humanize": "1.2.
|
|
27
|
+
"@jsenv/filesystem": "4.8.2",
|
|
28
|
+
"@jsenv/humanize": "1.2.5",
|
|
29
29
|
"@jsenv/url-meta": "8.4.2",
|
|
30
|
-
"@jsenv/urls": "2.
|
|
30
|
+
"@jsenv/urls": "2.3.1",
|
|
31
31
|
"@rollup/plugin-commonjs": "26.0.1",
|
|
32
32
|
"@rollup/plugin-json": "6.1.0",
|
|
33
33
|
"@rollup/plugin-node-resolve": "15.2.3",
|
package/src/cjs_to_esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
1
|
import { ensureWindowsDriveLetter } from "@jsenv/filesystem";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
setUrlExtension,
|
|
6
6
|
setUrlFilename,
|
|
7
|
-
urlToExtension,
|
|
8
7
|
urlToBasename,
|
|
8
|
+
urlToExtension,
|
|
9
9
|
} from "@jsenv/urls";
|
|
10
10
|
import { commonJsToJsModuleRaw } from "./cjs_to_esm_raw.js";
|
|
11
11
|
import { reuseOrCreateCompiledFile } from "./compile_cache/compiled_file_cache.js";
|
package/src/cjs_to_esm_raw.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { createLogger, UNICODE } from "@jsenv/humanize";
|
|
3
1
|
import {
|
|
4
2
|
assertAndNormalizeFileUrl,
|
|
5
3
|
ensureEmptyDirectory,
|
|
6
4
|
} from "@jsenv/filesystem";
|
|
5
|
+
import { createLogger, UNICODE } from "@jsenv/humanize";
|
|
6
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
7
7
|
|
|
8
|
-
import { validateCompileCache } from "./validate_compile_cache.js";
|
|
9
8
|
import { createLockRegistry } from "./file_lock_registry.js";
|
|
10
9
|
import { updateCompileCache } from "./update_compile_cache.js";
|
|
10
|
+
import { validateCompileCache } from "./validate_compile_cache.js";
|
|
11
11
|
|
|
12
12
|
const { lockForResource } = createLockRegistry();
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { bufferToEtag, writeFileSync } from "@jsenv/filesystem";
|
|
2
|
+
import { urlToRelativeUrl } from "@jsenv/urls";
|
|
1
3
|
import { existsSync, utimesSync } from "node:fs";
|
|
2
4
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { urlToRelativeUrl } from "@jsenv/urls";
|
|
4
|
-
import { writeFileSync, bufferToEtag } from "@jsenv/filesystem";
|
|
5
5
|
|
|
6
6
|
export const updateCompileCache = ({
|
|
7
7
|
logger,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { URL_META } from "@jsenv/url-meta";
|
|
2
|
-
import { injectQueryParams, urlToExtension, urlToBasename } from "@jsenv/urls";
|
|
3
1
|
import { defaultLookupPackageScope } from "@jsenv/node-esm-resolution";
|
|
2
|
+
import { URL_META } from "@jsenv/url-meta";
|
|
3
|
+
import { injectQueryParams, urlToBasename, urlToExtension } from "@jsenv/urls";
|
|
4
4
|
|
|
5
5
|
import { commonJsToJsModule } from "./cjs_to_esm.js";
|
|
6
6
|
|
package/src/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// https://github.com/snowpackjs/snowpack/blob/main/esinstall/src/rollup-plugins/rollup-plugin-wrap-install-targets.ts
|
|
2
2
|
|
|
3
|
+
import { init, parse } from "cjs-module-lexer";
|
|
4
|
+
import isValidIdentifier from "is-valid-identifier";
|
|
3
5
|
import { readFileSync } from "node:fs";
|
|
4
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
6
|
import path from "node:path";
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
8
|
import { Worker } from "node:worker_threads";
|
|
7
9
|
import resolve from "resolve";
|
|
8
|
-
import isValidIdentifier from "is-valid-identifier";
|
|
9
|
-
import { init, parse } from "cjs-module-lexer";
|
|
10
10
|
|
|
11
11
|
const importWrapper = {
|
|
12
12
|
wrap: (specifier) => {
|
package/src/worker_runtime.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { parentPort } from "node:worker_threads";
|
|
2
1
|
import { readFileSync } from "node:fs";
|
|
3
2
|
import vm from "node:vm";
|
|
3
|
+
import { parentPort } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
parentPort.once("message", ({ filePath }) => {
|
|
6
6
|
const fileContents = readFileSync(filePath, "utf8");
|