@distilled.cloud/cloudflare-rolldown-plugin 0.1.1 → 0.2.0
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/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Plugin } from "rolldown";
|
|
2
2
|
import type { CloudflarePluginOptions } from "../plugin.js";
|
|
3
|
-
export declare function makeNodejsCompatPlugin(options: CloudflarePluginOptions):
|
|
3
|
+
export declare function makeNodejsCompatPlugin(options: CloudflarePluginOptions): Plugin | Array<Plugin>;
|
|
4
4
|
//# sourceMappingURL=nodejs-compat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodejs-compat.d.ts","sourceRoot":"","sources":["../../src/plugins/nodejs-compat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodejs-compat.d.ts","sourceRoot":"","sources":["../../src/plugins/nodejs-compat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAM5D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAK/F"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getCloudflarePreset, nonPrefixedNodeModules } from "@cloudflare/unenv-preset";
|
|
2
2
|
import assert from "node:assert";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import path from "node:path";
|
|
3
5
|
import { esmExternalRequirePlugin } from "rolldown/plugins";
|
|
4
6
|
import { defineEnv } from "unenv";
|
|
5
7
|
import { hasNodejsCompat } from "../utils.js";
|
|
@@ -21,6 +23,7 @@ function makeUnenvPlugin(options) {
|
|
|
21
23
|
],
|
|
22
24
|
}).env;
|
|
23
25
|
const injectVirtualModules = makeInjectVirtualModules(inject);
|
|
26
|
+
const require = createRequire(import.meta.url);
|
|
24
27
|
return [
|
|
25
28
|
esmExternalRequirePlugin({
|
|
26
29
|
external: [...external],
|
|
@@ -43,6 +46,18 @@ function makeUnenvPlugin(options) {
|
|
|
43
46
|
},
|
|
44
47
|
},
|
|
45
48
|
},
|
|
49
|
+
{
|
|
50
|
+
name: "rolldown-plugin-cloudflare:nodejs-compat:unenv-preset-imports",
|
|
51
|
+
resolveId: {
|
|
52
|
+
filter: { id: /^@cloudflare\/unenv-preset\// },
|
|
53
|
+
async handler(id, importer, options) {
|
|
54
|
+
const resolved = await this.resolve(id, importer, options);
|
|
55
|
+
if (resolved)
|
|
56
|
+
return resolved;
|
|
57
|
+
return { id: require.resolve(id) };
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
46
61
|
{
|
|
47
62
|
name: "rolldown-plugin-cloudflare:nodejs-compat",
|
|
48
63
|
resolveId: {
|
|
@@ -77,21 +92,24 @@ function makeUnenvPlugin(options) {
|
|
|
77
92
|
}
|
|
78
93
|
function makeNodeJsImportWarningPlugin() {
|
|
79
94
|
const imports = new Map();
|
|
95
|
+
let root = process.cwd();
|
|
80
96
|
return {
|
|
81
|
-
name: "rolldown-plugin-cloudflare:nodejs-
|
|
97
|
+
name: "rolldown-plugin-cloudflare:nodejs-import-warnings",
|
|
98
|
+
options(options) {
|
|
99
|
+
if (options.cwd) {
|
|
100
|
+
root = options.cwd;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
82
103
|
resolveId: {
|
|
83
104
|
filter: { id: NODE_BUILTIN_MODULES_REGEXP },
|
|
84
|
-
async handler(id, importer
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (!imports.has(id)) {
|
|
89
|
-
imports.set(id, new Set());
|
|
90
|
-
}
|
|
91
|
-
imports.get(id)?.add(importer);
|
|
105
|
+
async handler(id, importer) {
|
|
106
|
+
if (importer) {
|
|
107
|
+
if (!imports.has(id)) {
|
|
108
|
+
imports.set(id, new Set());
|
|
92
109
|
}
|
|
93
|
-
|
|
110
|
+
imports.get(id)?.add(importer);
|
|
94
111
|
}
|
|
112
|
+
return { id, external: true };
|
|
95
113
|
},
|
|
96
114
|
},
|
|
97
115
|
buildStart() {
|
|
@@ -99,12 +117,15 @@ function makeNodeJsImportWarningPlugin() {
|
|
|
99
117
|
},
|
|
100
118
|
buildEnd() {
|
|
101
119
|
if (imports.size > 0) {
|
|
120
|
+
let message = `Unexpected Node.js imports. ` +
|
|
121
|
+
`Do you need to enable the "nodejs_compat" compatibility flag? ` +
|
|
122
|
+
"Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.\n";
|
|
102
123
|
for (const [id, importers] of imports.entries()) {
|
|
103
|
-
|
|
104
|
-
`
|
|
105
|
-
|
|
106
|
-
].join("\n"));
|
|
124
|
+
for (const importer of importers) {
|
|
125
|
+
message += ` - "${id}" imported from "${path.relative(root, importer)}"\n`;
|
|
126
|
+
}
|
|
107
127
|
}
|
|
128
|
+
this.warn(message);
|
|
108
129
|
}
|
|
109
130
|
},
|
|
110
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodejs-compat.js","sourceRoot":"","sources":["../../src/plugins/nodejs-compat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,MAAM,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"nodejs-compat.js","sourceRoot":"","sources":["../../src/plugins/nodejs-compat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CA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,QAAQ;YACN,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBACrB,IAAI,OAAO,GACT,8BAA8B;oBAC9B,gEAAgE;oBAChE,6FAA6F,CAAC;gBAChG,KAAK,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;oBAChD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;wBACjC,OAAO,IAAI,OAAO,EAAE,oBAAoB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC;oBAC7E,CAAC;gBACH,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAC/B,MAAgE;IAEhE,MAAM,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;IACjD,KAAK,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACrE,wFAAwF;QACxF,6DAA6D;QAC7D,MAAM,CAAC,OAAO,eAAe,KAAK,QAAQ,EAAE,yCAAyC,CAAC,CAAC;QACvF,cAAc,CAAC,GAAG,CAChB,qBAAqB,CAAC,YAAY,CAAC,EACnC,8BAA8B,eAAe,iBAAiB,YAAY,mBAAmB,CAC9F,CAAC;IACJ,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAc;IAC3C,OAAO,gCAAgC,MAAM,EAAW,CAAC;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/cloudflare-rolldown-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Rolldown plugin for Cloudflare Workers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
7
7
|
"rolldown",
|
|
8
8
|
"workers"
|
|
9
9
|
],
|
|
10
|
-
"homepage": "https://github.com/alchemy-run/cloudflare-tools/tree/main/packages/rolldown-plugin
|
|
10
|
+
"homepage": "https://github.com/alchemy-run/cloudflare-tools/tree/main/packages/cloudflare-rolldown-plugin#readme",
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/alchemy-run/cloudflare-tools/issues"
|
|
13
13
|
},
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc",
|
|
45
45
|
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
46
|
+
"dev": "tsc --watch",
|
|
46
47
|
"test": "vitest run",
|
|
47
48
|
"test:watch": "vitest",
|
|
48
49
|
"typecheck": "tsc --noEmit",
|
|
@@ -53,9 +54,9 @@
|
|
|
53
54
|
"unenv": "^2.0.0-rc.24"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
|
-
"@cloudflare/workers-types": "
|
|
57
|
+
"@cloudflare/workers-types": "^4.20260310.1",
|
|
57
58
|
"miniflare": "^4.20260329.0",
|
|
58
|
-
"vitest": "
|
|
59
|
+
"vitest": "^4.1.1"
|
|
59
60
|
},
|
|
60
61
|
"peerDependencies": {
|
|
61
62
|
"rolldown": "^1.0.0-rc.9"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { getCloudflarePreset, nonPrefixedNodeModules } from "@cloudflare/unenv-preset";
|
|
2
2
|
import assert from "node:assert";
|
|
3
|
-
import
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import type { Plugin } from "rolldown";
|
|
4
6
|
import { esmExternalRequirePlugin } from "rolldown/plugins";
|
|
5
7
|
import { defineEnv } from "unenv";
|
|
6
8
|
import type { CloudflarePluginOptions } from "../plugin.js";
|
|
@@ -9,14 +11,14 @@ import { hasNodejsCompat } from "../utils.js";
|
|
|
9
11
|
const NODE_BUILTIN_MODULES_REGEXP = new RegExp(`^(${nonPrefixedNodeModules.join("|")}|node:.+)$`);
|
|
10
12
|
const VIRTUAL_MODULE_ID_REGEXP = /^virtual:nodejs-global-inject\/.+$/;
|
|
11
13
|
|
|
12
|
-
export function makeNodejsCompatPlugin(options: CloudflarePluginOptions):
|
|
14
|
+
export function makeNodejsCompatPlugin(options: CloudflarePluginOptions): Plugin | Array<Plugin> {
|
|
13
15
|
if (hasNodejsCompat(options.compatibilityFlags)) {
|
|
14
16
|
return makeUnenvPlugin(options);
|
|
15
17
|
}
|
|
16
18
|
return makeNodeJsImportWarningPlugin();
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
function makeUnenvPlugin(options: CloudflarePluginOptions):
|
|
21
|
+
function makeUnenvPlugin(options: CloudflarePluginOptions): Array<Plugin> {
|
|
20
22
|
const { alias, inject, external, polyfill } = defineEnv({
|
|
21
23
|
presets: [
|
|
22
24
|
getCloudflarePreset({
|
|
@@ -27,6 +29,7 @@ function makeUnenvPlugin(options: CloudflarePluginOptions): RolldownPluginOption
|
|
|
27
29
|
}).env;
|
|
28
30
|
|
|
29
31
|
const injectVirtualModules = makeInjectVirtualModules(inject);
|
|
32
|
+
const require = createRequire(import.meta.url);
|
|
30
33
|
|
|
31
34
|
return [
|
|
32
35
|
esmExternalRequirePlugin({
|
|
@@ -50,6 +53,17 @@ function makeUnenvPlugin(options: CloudflarePluginOptions): RolldownPluginOption
|
|
|
50
53
|
},
|
|
51
54
|
},
|
|
52
55
|
},
|
|
56
|
+
{
|
|
57
|
+
name: "rolldown-plugin-cloudflare:nodejs-compat:unenv-preset-imports",
|
|
58
|
+
resolveId: {
|
|
59
|
+
filter: { id: /^@cloudflare\/unenv-preset\// },
|
|
60
|
+
async handler(id, importer, options) {
|
|
61
|
+
const resolved = await this.resolve(id, importer, options);
|
|
62
|
+
if (resolved) return resolved;
|
|
63
|
+
return { id: require.resolve(id) };
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
53
67
|
{
|
|
54
68
|
name: "rolldown-plugin-cloudflare:nodejs-compat",
|
|
55
69
|
resolveId: {
|
|
@@ -83,23 +97,26 @@ function makeUnenvPlugin(options: CloudflarePluginOptions): RolldownPluginOption
|
|
|
83
97
|
];
|
|
84
98
|
}
|
|
85
99
|
|
|
86
|
-
function makeNodeJsImportWarningPlugin():
|
|
100
|
+
function makeNodeJsImportWarningPlugin(): Plugin {
|
|
87
101
|
const imports = new Map<string, Set<string>>();
|
|
102
|
+
let root = process.cwd();
|
|
88
103
|
return {
|
|
89
|
-
name: "rolldown-plugin-cloudflare:nodejs-
|
|
104
|
+
name: "rolldown-plugin-cloudflare:nodejs-import-warnings",
|
|
105
|
+
options(options) {
|
|
106
|
+
if (options.cwd) {
|
|
107
|
+
root = options.cwd;
|
|
108
|
+
}
|
|
109
|
+
},
|
|
90
110
|
resolveId: {
|
|
91
111
|
filter: { id: NODE_BUILTIN_MODULES_REGEXP },
|
|
92
|
-
async handler(id, importer
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (!imports.has(id)) {
|
|
97
|
-
imports.set(id, new Set());
|
|
98
|
-
}
|
|
99
|
-
imports.get(id)?.add(importer);
|
|
112
|
+
async handler(id, importer) {
|
|
113
|
+
if (importer) {
|
|
114
|
+
if (!imports.has(id)) {
|
|
115
|
+
imports.set(id, new Set());
|
|
100
116
|
}
|
|
101
|
-
|
|
117
|
+
imports.get(id)?.add(importer);
|
|
102
118
|
}
|
|
119
|
+
return { id, external: true };
|
|
103
120
|
},
|
|
104
121
|
},
|
|
105
122
|
buildStart() {
|
|
@@ -107,14 +124,16 @@ function makeNodeJsImportWarningPlugin(): RolldownPluginOption {
|
|
|
107
124
|
},
|
|
108
125
|
buildEnd() {
|
|
109
126
|
if (imports.size > 0) {
|
|
127
|
+
let message =
|
|
128
|
+
`Unexpected Node.js imports. ` +
|
|
129
|
+
`Do you need to enable the "nodejs_compat" compatibility flag? ` +
|
|
130
|
+
"Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.\n";
|
|
110
131
|
for (const [id, importers] of imports.entries()) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
...Array.from(importers).map((importer) => `- ${importer}`),
|
|
115
|
-
].join("\n"),
|
|
116
|
-
);
|
|
132
|
+
for (const importer of importers) {
|
|
133
|
+
message += ` - "${id}" imported from "${path.relative(root, importer)}"\n`;
|
|
134
|
+
}
|
|
117
135
|
}
|
|
136
|
+
this.warn(message);
|
|
118
137
|
}
|
|
119
138
|
},
|
|
120
139
|
};
|