@storm-software/cloudflare-tools 0.48.0 → 0.49.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/CHANGELOG.md +10 -0
- package/dist/chunk-3J7KBHMJ.mjs +0 -0
- package/dist/chunk-7Z5PILRU.mjs +0 -0
- package/dist/chunk-A4ZIZ2JU.mjs +228 -0
- package/dist/chunk-A7FFSBE6.mjs +26 -0
- package/dist/chunk-CVGPWUNP.js +1 -0
- package/dist/chunk-DHBG5ASJ.js +1 -0
- package/dist/chunk-I4XNMV5U.js +227 -0
- package/dist/chunk-J5SB6L2L.js +18 -0
- package/dist/chunk-JCB2DTP6.js +42 -0
- package/dist/chunk-KKOHB7JH.js +239 -0
- package/dist/chunk-MTM5OTKD.mjs +239 -0
- package/dist/chunk-NKCR3FSU.js +153 -0
- package/dist/chunk-NSLK6ZDO.mjs +603 -0
- package/dist/chunk-OARYMVO7.mjs +501 -0
- package/dist/chunk-OJNZ4PXQ.mjs +3466 -0
- package/dist/chunk-QEWY5YJA.mjs +89 -0
- package/dist/chunk-R7AIVBS7.js +89 -0
- package/dist/chunk-RCE3CC76.js +603 -0
- package/dist/chunk-VPT6GF3S.mjs +153 -0
- package/dist/chunk-VTHBMY4B.js +133 -0
- package/dist/chunk-VYOULWAK.mjs +42 -0
- package/dist/chunk-XO66D74Z.js +1 -0
- package/dist/chunk-XU6MTFCV.mjs +133 -0
- package/dist/chunk-YE4FHRXJ.js +501 -0
- package/dist/chunk-YSCEY447.mjs +0 -0
- package/dist/chunk-Z46UO4N7.js +3465 -0
- package/dist/executors.d.mts +2 -0
- package/dist/executors.d.ts +2 -0
- package/dist/executors.js +9 -0
- package/dist/executors.mjs +9 -0
- package/dist/generator-DJ1RuHyR.d.mts +14 -0
- package/dist/generator-DJ1RuHyR.d.ts +14 -0
- package/dist/generator-DW-9W9Fk.d.mts +22 -0
- package/dist/generator-DW-9W9Fk.d.ts +22 -0
- package/dist/generators.d.mts +4 -0
- package/dist/generators.d.ts +4 -0
- package/dist/generators.js +18 -0
- package/dist/generators.mjs +18 -0
- package/dist/index.d.mts +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +151 -0
- package/dist/index.mjs +151 -0
- package/dist/schema.d-DgA16PUG.d.mts +24 -0
- package/dist/schema.d-DgA16PUG.d.ts +24 -0
- package/dist/schema.d-oSirXiCO.d.mts +11 -0
- package/dist/schema.d-oSirXiCO.d.ts +11 -0
- package/dist/src/executors/cloudflare-publish/executor.d.mts +8 -0
- package/dist/src/executors/cloudflare-publish/executor.d.ts +8 -0
- package/dist/src/executors/cloudflare-publish/executor.js +11 -0
- package/dist/src/executors/cloudflare-publish/executor.mjs +11 -0
- package/dist/src/executors/r2-upload-publish/executor.d.mts +8 -0
- package/dist/src/executors/r2-upload-publish/executor.d.ts +8 -0
- package/dist/src/executors/r2-upload-publish/executor.js +11 -0
- package/dist/src/executors/r2-upload-publish/executor.mjs +11 -0
- package/dist/src/executors/serve/executor.d.mts +1240 -0
- package/dist/src/executors/serve/executor.d.ts +1240 -0
- package/dist/src/executors/serve/executor.js +75 -0
- package/dist/src/executors/serve/executor.mjs +75 -0
- package/dist/src/executors/serve/schema.d.ts +1 -1
- package/dist/src/generators/init/generator.d.mts +2 -0
- package/dist/src/generators/init/generator.d.ts +2 -0
- package/dist/src/generators/init/generator.js +11 -0
- package/dist/src/generators/init/generator.mjs +11 -0
- package/dist/src/generators/worker/generator.d.mts +3 -0
- package/dist/src/generators/worker/generator.d.ts +3 -0
- package/dist/src/generators/worker/generator.js +14 -0
- package/dist/src/generators/worker/generator.mjs +14 -0
- package/dist/src/utils/index.d.mts +3 -0
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/index.js +11 -0
- package/dist/src/utils/index.mjs +11 -0
- package/dist/src/utils/r2-bucket-helpers.d.mts +7 -0
- package/dist/src/utils/r2-bucket-helpers.d.ts +7 -0
- package/dist/src/utils/r2-bucket-helpers.js +10 -0
- package/dist/src/utils/r2-bucket-helpers.mjs +10 -0
- package/dist/tsup.config.d.mts +5 -0
- package/dist/tsup.config.d.ts +5 -0
- package/dist/tsup.config.js +35 -0
- package/dist/tsup.config.mjs +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
5
|
+
|
|
6
|
+
// package.json
|
|
7
|
+
var require_package = _chunkJ5SB6L2Ljs.__commonJS.call(void 0, {
|
|
8
|
+
"package.json"(exports, module) {
|
|
9
|
+
module.exports = {
|
|
10
|
+
name: "@storm-software/cloudflare-tools",
|
|
11
|
+
version: "0.49.0",
|
|
12
|
+
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
|
+
repository: {
|
|
14
|
+
type: "github",
|
|
15
|
+
url: "https://github.com/storm-software/storm-ops",
|
|
16
|
+
directory: "packages/cloudflare-tools"
|
|
17
|
+
},
|
|
18
|
+
homepage: "https://stormsoftware.com",
|
|
19
|
+
bugs: "https://github.com/storm-software/storm-ops/issues",
|
|
20
|
+
author: {
|
|
21
|
+
name: "Storm Software",
|
|
22
|
+
email: "contact@stormsoftware.com",
|
|
23
|
+
url: "https://stormsoftware.com"
|
|
24
|
+
},
|
|
25
|
+
license: "Apache-2.0",
|
|
26
|
+
private: false,
|
|
27
|
+
main: "dist/index.js",
|
|
28
|
+
module: "dist/index.mjs",
|
|
29
|
+
exports: {
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
"./docs/*": "./docs/*",
|
|
32
|
+
"./migrations.json": "./migrations.json",
|
|
33
|
+
"./executors.json": "./executors.json",
|
|
34
|
+
"./executors/*/schema.json": "./dist/src/executors/*/schema.json",
|
|
35
|
+
"./generators.json": "./generators.json",
|
|
36
|
+
"./generators/*/schema.json": "./dist/src/generators/*/schema.json",
|
|
37
|
+
".": {
|
|
38
|
+
import: {
|
|
39
|
+
types: "./dist/index.d.mts",
|
|
40
|
+
default: "./dist/index.mjs"
|
|
41
|
+
},
|
|
42
|
+
require: {
|
|
43
|
+
types: "./dist/index.d.ts",
|
|
44
|
+
default: "./dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
default: {
|
|
47
|
+
types: "./dist/index.d.ts",
|
|
48
|
+
default: "./dist/index.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"./index": {
|
|
52
|
+
import: {
|
|
53
|
+
types: "./dist/index.d.mts",
|
|
54
|
+
default: "./dist/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
require: {
|
|
57
|
+
types: "./dist/index.d.ts",
|
|
58
|
+
default: "./dist/index.js"
|
|
59
|
+
},
|
|
60
|
+
default: {
|
|
61
|
+
types: "./dist/index.d.ts",
|
|
62
|
+
default: "./dist/index.js"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"./executors": {
|
|
66
|
+
import: {
|
|
67
|
+
types: "./dist/executors.d.mts",
|
|
68
|
+
default: "./dist/executors.mjs"
|
|
69
|
+
},
|
|
70
|
+
require: {
|
|
71
|
+
types: "./dist/executors.d.ts",
|
|
72
|
+
default: "./dist/executors.js"
|
|
73
|
+
},
|
|
74
|
+
default: {
|
|
75
|
+
types: "./dist/executors.d.ts",
|
|
76
|
+
default: "./dist/executors.js"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"./generators": {
|
|
80
|
+
import: {
|
|
81
|
+
types: "./dist/generators.d.mts",
|
|
82
|
+
default: "./dist/generators.mjs"
|
|
83
|
+
},
|
|
84
|
+
require: {
|
|
85
|
+
types: "./dist/generators.d.ts",
|
|
86
|
+
default: "./dist/generators.js"
|
|
87
|
+
},
|
|
88
|
+
default: {
|
|
89
|
+
types: "./dist/generators.d.ts",
|
|
90
|
+
default: "./dist/generators.js"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"./utils": {
|
|
94
|
+
import: {
|
|
95
|
+
types: "./dist/src/utils/index.d.mts",
|
|
96
|
+
default: "./dist/src/utils/index.mjs"
|
|
97
|
+
},
|
|
98
|
+
require: {
|
|
99
|
+
types: "./dist/src/utils/index.d.ts",
|
|
100
|
+
default: "./dist/src/utils/index.js"
|
|
101
|
+
},
|
|
102
|
+
default: {
|
|
103
|
+
types: "./dist/src/utils/index.d.ts",
|
|
104
|
+
default: "./dist/src/utils/index.js"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"./utils/*": {
|
|
108
|
+
import: {
|
|
109
|
+
types: "./dist/src/utils/*.d.mts",
|
|
110
|
+
default: "./dist/src/utils/*.mjs"
|
|
111
|
+
},
|
|
112
|
+
require: {
|
|
113
|
+
types: "./dist/src/utils/*.d.ts",
|
|
114
|
+
default: "./dist/src/utils/*.js"
|
|
115
|
+
},
|
|
116
|
+
default: {
|
|
117
|
+
types: "./dist/src/utils/*.d.ts",
|
|
118
|
+
default: "./dist/src/utils/*.js"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"./executors/*/executor.js": "./dist/src/executors/*/executor.js",
|
|
122
|
+
"./generators/*/generator.js": "./dist/src/generators/*/generator.js",
|
|
123
|
+
"./plugin": "./dist/src/plugins/index.js"
|
|
124
|
+
},
|
|
125
|
+
typings: "dist/index.d.ts",
|
|
126
|
+
keywords: [
|
|
127
|
+
"monorepo",
|
|
128
|
+
"open-system",
|
|
129
|
+
"storm",
|
|
130
|
+
"storm-ops",
|
|
131
|
+
"storm-stack",
|
|
132
|
+
"stormstack",
|
|
133
|
+
"sullivanpj"
|
|
134
|
+
],
|
|
135
|
+
peerDependencies: {
|
|
136
|
+
"@nx/devkit": "catalog:",
|
|
137
|
+
"@nx/node": "catalog:",
|
|
138
|
+
"@nx/web": "catalog:",
|
|
139
|
+
"@nx/webpack": "catalog:",
|
|
140
|
+
nx: "catalog:",
|
|
141
|
+
wrangler: ">=3.58.0"
|
|
142
|
+
},
|
|
143
|
+
peerDependenciesMeta: {
|
|
144
|
+
"@nx/devkit": {
|
|
145
|
+
optional: false
|
|
146
|
+
},
|
|
147
|
+
"@nx/node": {
|
|
148
|
+
optional: false
|
|
149
|
+
},
|
|
150
|
+
"@nx/web": {
|
|
151
|
+
optional: false
|
|
152
|
+
},
|
|
153
|
+
"@nx/webpack": {
|
|
154
|
+
optional: false
|
|
155
|
+
},
|
|
156
|
+
nx: {
|
|
157
|
+
optional: false
|
|
158
|
+
},
|
|
159
|
+
wrangler: {
|
|
160
|
+
optional: false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
dependencies: {
|
|
164
|
+
"@aws-sdk/client-s3": "3.47.0",
|
|
165
|
+
c12: "catalog:",
|
|
166
|
+
glob: "catalog:",
|
|
167
|
+
"jest-resolve": "29.7.0"
|
|
168
|
+
},
|
|
169
|
+
devDependencies: {
|
|
170
|
+
"@nx/devkit": "catalog:",
|
|
171
|
+
"@nx/node": "catalog:",
|
|
172
|
+
"@nx/web": "catalog:",
|
|
173
|
+
"@nx/webpack": "catalog:",
|
|
174
|
+
nx: "catalog:",
|
|
175
|
+
tsup: "catalog:",
|
|
176
|
+
untyped: "catalog:",
|
|
177
|
+
wrangler: ">=3.58.0"
|
|
178
|
+
},
|
|
179
|
+
publishConfig: {
|
|
180
|
+
access: "public"
|
|
181
|
+
},
|
|
182
|
+
executors: "./executors.json",
|
|
183
|
+
generators: "./generators.json"
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// src/generators/init/generator.ts
|
|
189
|
+
var _devkit = require('@nx/devkit');
|
|
190
|
+
var _js = require('@nx/js');
|
|
191
|
+
var _versions = require('@nx/node/src/utils/versions');
|
|
192
|
+
|
|
193
|
+
// src/generators/init/libs/versions.ts
|
|
194
|
+
var cloudflareToolsVersion = require_package().version;
|
|
195
|
+
var wranglerVersion = "^3.51.2";
|
|
196
|
+
var cloudflareWorkersTypeVersions = "^4.20240419.0";
|
|
197
|
+
var honoVersion = "^4.2.6";
|
|
198
|
+
|
|
199
|
+
// src/generators/init/generator.ts
|
|
200
|
+
async function initGenerator(tree, schema) {
|
|
201
|
+
const initTask = await _js.initGenerator.call(void 0, tree, {
|
|
202
|
+
...schema,
|
|
203
|
+
skipFormat: true
|
|
204
|
+
});
|
|
205
|
+
const installTask = updateDependencies(tree, schema);
|
|
206
|
+
if (!schema.skipFormat) {
|
|
207
|
+
await _devkit.formatFiles.call(void 0, tree);
|
|
208
|
+
}
|
|
209
|
+
return async () => {
|
|
210
|
+
await initTask();
|
|
211
|
+
await installTask();
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, initGenerator, "initGenerator");
|
|
215
|
+
function updateDependencies(tree, schema) {
|
|
216
|
+
_devkit.removeDependenciesFromPackageJson.call(void 0, tree, [
|
|
217
|
+
"@storm-software/cloudflare-tools"
|
|
218
|
+
], []);
|
|
219
|
+
const honoPackage = schema.template === "hono" ? {
|
|
220
|
+
hono: honoVersion
|
|
221
|
+
} : {};
|
|
222
|
+
return _devkit.addDependenciesToPackageJson.call(void 0, tree, {
|
|
223
|
+
tslib: _versions.tslibVersion,
|
|
224
|
+
...honoPackage
|
|
225
|
+
}, {
|
|
226
|
+
wrangler: wranglerVersion,
|
|
227
|
+
"@cloudflare/workers-types": cloudflareWorkersTypeVersions,
|
|
228
|
+
"@storm-software/cloudflare-tools": cloudflareToolsVersion
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, updateDependencies, "updateDependencies");
|
|
232
|
+
var generator_default = initGenerator;
|
|
233
|
+
var initSchematic = _devkit.convertNxGenerator.call(void 0, initGenerator);
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
exports.initGenerator = initGenerator; exports.generator_default = generator_default; exports.initSchematic = initSchematic;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__name
|
|
4
|
+
} from "./chunk-A7FFSBE6.mjs";
|
|
5
|
+
|
|
6
|
+
// package.json
|
|
7
|
+
var require_package = __commonJS({
|
|
8
|
+
"package.json"(exports, module) {
|
|
9
|
+
module.exports = {
|
|
10
|
+
name: "@storm-software/cloudflare-tools",
|
|
11
|
+
version: "0.49.0",
|
|
12
|
+
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
|
+
repository: {
|
|
14
|
+
type: "github",
|
|
15
|
+
url: "https://github.com/storm-software/storm-ops",
|
|
16
|
+
directory: "packages/cloudflare-tools"
|
|
17
|
+
},
|
|
18
|
+
homepage: "https://stormsoftware.com",
|
|
19
|
+
bugs: "https://github.com/storm-software/storm-ops/issues",
|
|
20
|
+
author: {
|
|
21
|
+
name: "Storm Software",
|
|
22
|
+
email: "contact@stormsoftware.com",
|
|
23
|
+
url: "https://stormsoftware.com"
|
|
24
|
+
},
|
|
25
|
+
license: "Apache-2.0",
|
|
26
|
+
private: false,
|
|
27
|
+
main: "dist/index.js",
|
|
28
|
+
module: "dist/index.mjs",
|
|
29
|
+
exports: {
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
"./docs/*": "./docs/*",
|
|
32
|
+
"./migrations.json": "./migrations.json",
|
|
33
|
+
"./executors.json": "./executors.json",
|
|
34
|
+
"./executors/*/schema.json": "./dist/src/executors/*/schema.json",
|
|
35
|
+
"./generators.json": "./generators.json",
|
|
36
|
+
"./generators/*/schema.json": "./dist/src/generators/*/schema.json",
|
|
37
|
+
".": {
|
|
38
|
+
import: {
|
|
39
|
+
types: "./dist/index.d.mts",
|
|
40
|
+
default: "./dist/index.mjs"
|
|
41
|
+
},
|
|
42
|
+
require: {
|
|
43
|
+
types: "./dist/index.d.ts",
|
|
44
|
+
default: "./dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
default: {
|
|
47
|
+
types: "./dist/index.d.ts",
|
|
48
|
+
default: "./dist/index.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"./index": {
|
|
52
|
+
import: {
|
|
53
|
+
types: "./dist/index.d.mts",
|
|
54
|
+
default: "./dist/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
require: {
|
|
57
|
+
types: "./dist/index.d.ts",
|
|
58
|
+
default: "./dist/index.js"
|
|
59
|
+
},
|
|
60
|
+
default: {
|
|
61
|
+
types: "./dist/index.d.ts",
|
|
62
|
+
default: "./dist/index.js"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"./executors": {
|
|
66
|
+
import: {
|
|
67
|
+
types: "./dist/executors.d.mts",
|
|
68
|
+
default: "./dist/executors.mjs"
|
|
69
|
+
},
|
|
70
|
+
require: {
|
|
71
|
+
types: "./dist/executors.d.ts",
|
|
72
|
+
default: "./dist/executors.js"
|
|
73
|
+
},
|
|
74
|
+
default: {
|
|
75
|
+
types: "./dist/executors.d.ts",
|
|
76
|
+
default: "./dist/executors.js"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"./generators": {
|
|
80
|
+
import: {
|
|
81
|
+
types: "./dist/generators.d.mts",
|
|
82
|
+
default: "./dist/generators.mjs"
|
|
83
|
+
},
|
|
84
|
+
require: {
|
|
85
|
+
types: "./dist/generators.d.ts",
|
|
86
|
+
default: "./dist/generators.js"
|
|
87
|
+
},
|
|
88
|
+
default: {
|
|
89
|
+
types: "./dist/generators.d.ts",
|
|
90
|
+
default: "./dist/generators.js"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"./utils": {
|
|
94
|
+
import: {
|
|
95
|
+
types: "./dist/src/utils/index.d.mts",
|
|
96
|
+
default: "./dist/src/utils/index.mjs"
|
|
97
|
+
},
|
|
98
|
+
require: {
|
|
99
|
+
types: "./dist/src/utils/index.d.ts",
|
|
100
|
+
default: "./dist/src/utils/index.js"
|
|
101
|
+
},
|
|
102
|
+
default: {
|
|
103
|
+
types: "./dist/src/utils/index.d.ts",
|
|
104
|
+
default: "./dist/src/utils/index.js"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"./utils/*": {
|
|
108
|
+
import: {
|
|
109
|
+
types: "./dist/src/utils/*.d.mts",
|
|
110
|
+
default: "./dist/src/utils/*.mjs"
|
|
111
|
+
},
|
|
112
|
+
require: {
|
|
113
|
+
types: "./dist/src/utils/*.d.ts",
|
|
114
|
+
default: "./dist/src/utils/*.js"
|
|
115
|
+
},
|
|
116
|
+
default: {
|
|
117
|
+
types: "./dist/src/utils/*.d.ts",
|
|
118
|
+
default: "./dist/src/utils/*.js"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"./executors/*/executor.js": "./dist/src/executors/*/executor.js",
|
|
122
|
+
"./generators/*/generator.js": "./dist/src/generators/*/generator.js",
|
|
123
|
+
"./plugin": "./dist/src/plugins/index.js"
|
|
124
|
+
},
|
|
125
|
+
typings: "dist/index.d.ts",
|
|
126
|
+
keywords: [
|
|
127
|
+
"monorepo",
|
|
128
|
+
"open-system",
|
|
129
|
+
"storm",
|
|
130
|
+
"storm-ops",
|
|
131
|
+
"storm-stack",
|
|
132
|
+
"stormstack",
|
|
133
|
+
"sullivanpj"
|
|
134
|
+
],
|
|
135
|
+
peerDependencies: {
|
|
136
|
+
"@nx/devkit": "catalog:",
|
|
137
|
+
"@nx/node": "catalog:",
|
|
138
|
+
"@nx/web": "catalog:",
|
|
139
|
+
"@nx/webpack": "catalog:",
|
|
140
|
+
nx: "catalog:",
|
|
141
|
+
wrangler: ">=3.58.0"
|
|
142
|
+
},
|
|
143
|
+
peerDependenciesMeta: {
|
|
144
|
+
"@nx/devkit": {
|
|
145
|
+
optional: false
|
|
146
|
+
},
|
|
147
|
+
"@nx/node": {
|
|
148
|
+
optional: false
|
|
149
|
+
},
|
|
150
|
+
"@nx/web": {
|
|
151
|
+
optional: false
|
|
152
|
+
},
|
|
153
|
+
"@nx/webpack": {
|
|
154
|
+
optional: false
|
|
155
|
+
},
|
|
156
|
+
nx: {
|
|
157
|
+
optional: false
|
|
158
|
+
},
|
|
159
|
+
wrangler: {
|
|
160
|
+
optional: false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
dependencies: {
|
|
164
|
+
"@aws-sdk/client-s3": "3.47.0",
|
|
165
|
+
c12: "catalog:",
|
|
166
|
+
glob: "catalog:",
|
|
167
|
+
"jest-resolve": "29.7.0"
|
|
168
|
+
},
|
|
169
|
+
devDependencies: {
|
|
170
|
+
"@nx/devkit": "catalog:",
|
|
171
|
+
"@nx/node": "catalog:",
|
|
172
|
+
"@nx/web": "catalog:",
|
|
173
|
+
"@nx/webpack": "catalog:",
|
|
174
|
+
nx: "catalog:",
|
|
175
|
+
tsup: "catalog:",
|
|
176
|
+
untyped: "catalog:",
|
|
177
|
+
wrangler: ">=3.58.0"
|
|
178
|
+
},
|
|
179
|
+
publishConfig: {
|
|
180
|
+
access: "public"
|
|
181
|
+
},
|
|
182
|
+
executors: "./executors.json",
|
|
183
|
+
generators: "./generators.json"
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// src/generators/init/generator.ts
|
|
189
|
+
import { addDependenciesToPackageJson, convertNxGenerator, formatFiles, removeDependenciesFromPackageJson } from "@nx/devkit";
|
|
190
|
+
import { initGenerator as nodeInitGenerator } from "@nx/js";
|
|
191
|
+
import { tslibVersion } from "@nx/node/src/utils/versions";
|
|
192
|
+
|
|
193
|
+
// src/generators/init/libs/versions.ts
|
|
194
|
+
var cloudflareToolsVersion = require_package().version;
|
|
195
|
+
var wranglerVersion = "^3.51.2";
|
|
196
|
+
var cloudflareWorkersTypeVersions = "^4.20240419.0";
|
|
197
|
+
var honoVersion = "^4.2.6";
|
|
198
|
+
|
|
199
|
+
// src/generators/init/generator.ts
|
|
200
|
+
async function initGenerator(tree, schema) {
|
|
201
|
+
const initTask = await nodeInitGenerator(tree, {
|
|
202
|
+
...schema,
|
|
203
|
+
skipFormat: true
|
|
204
|
+
});
|
|
205
|
+
const installTask = updateDependencies(tree, schema);
|
|
206
|
+
if (!schema.skipFormat) {
|
|
207
|
+
await formatFiles(tree);
|
|
208
|
+
}
|
|
209
|
+
return async () => {
|
|
210
|
+
await initTask();
|
|
211
|
+
await installTask();
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
__name(initGenerator, "initGenerator");
|
|
215
|
+
function updateDependencies(tree, schema) {
|
|
216
|
+
removeDependenciesFromPackageJson(tree, [
|
|
217
|
+
"@storm-software/cloudflare-tools"
|
|
218
|
+
], []);
|
|
219
|
+
const honoPackage = schema.template === "hono" ? {
|
|
220
|
+
hono: honoVersion
|
|
221
|
+
} : {};
|
|
222
|
+
return addDependenciesToPackageJson(tree, {
|
|
223
|
+
tslib: tslibVersion,
|
|
224
|
+
...honoPackage
|
|
225
|
+
}, {
|
|
226
|
+
wrangler: wranglerVersion,
|
|
227
|
+
"@cloudflare/workers-types": cloudflareWorkersTypeVersions,
|
|
228
|
+
"@storm-software/cloudflare-tools": cloudflareToolsVersion
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
__name(updateDependencies, "updateDependencies");
|
|
232
|
+
var generator_default = initGenerator;
|
|
233
|
+
var initSchematic = convertNxGenerator(initGenerator);
|
|
234
|
+
|
|
235
|
+
export {
|
|
236
|
+
initGenerator,
|
|
237
|
+
generator_default,
|
|
238
|
+
initSchematic
|
|
239
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkJCB2DTP6js = require('./chunk-JCB2DTP6.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkYE4FHRXJjs = require('./chunk-YE4FHRXJ.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunkRCE3CC76js = require('./chunk-RCE3CC76.js');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
22
|
+
|
|
23
|
+
// src/executors/r2-upload-publish/executor.ts
|
|
24
|
+
var _clients3 = require('@aws-sdk/client-s3');
|
|
25
|
+
var _devkit = require('@nx/devkit');
|
|
26
|
+
var _glob = require('glob');
|
|
27
|
+
var _child_process = require('child_process');
|
|
28
|
+
var _promises = require('fs/promises');
|
|
29
|
+
async function runExecutor(options, context) {
|
|
30
|
+
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
31
|
+
if (!context.projectName) {
|
|
32
|
+
throw new Error("The executor requires a projectName.");
|
|
33
|
+
}
|
|
34
|
+
console.info(`\u{1F680} Running Storm Cloudflare Publish executor on the ${context.projectName} worker`);
|
|
35
|
+
if (!context.projectName || !_optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects]) || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _3 => _3.projectsConfigurations, 'access', _4 => _4.projects, 'access', _5 => _5[context.projectName], 'optionalAccess', _6 => _6.root])) {
|
|
36
|
+
throw new Error("The executor requires projectsConfigurations.");
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const workspaceRoot = _chunkRCE3CC76js.findWorkspaceRoot.call(void 0, );
|
|
40
|
+
const config = await _chunkYE4FHRXJjs.loadStormConfig.call(void 0, workspaceRoot);
|
|
41
|
+
const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
|
|
42
|
+
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
|
|
43
|
+
const projectDetails = _chunkVTHBMY4Bjs.getPackageInfo.call(void 0, context.projectsConfigurations.projects[context.projectName]);
|
|
44
|
+
if (!_optionalChain([projectDetails, 'optionalAccess', _15 => _15.content])) {
|
|
45
|
+
throw new Error(`Could not find the project details for ${context.projectName}`);
|
|
46
|
+
}
|
|
47
|
+
const args = _chunkVTHBMY4Bjs.createCliOptions.call(void 0, {
|
|
48
|
+
...options
|
|
49
|
+
});
|
|
50
|
+
if (isDryRun) {
|
|
51
|
+
args.push("--dry-run");
|
|
52
|
+
}
|
|
53
|
+
const cloudflareAccountId = process.env.STORM_BOT_CLOUDFLARE_ACCOUNT;
|
|
54
|
+
if (!_optionalChain([options, 'optionalAccess', _16 => _16.registry]) && !cloudflareAccountId) {
|
|
55
|
+
throw new Error("The Storm Registry URL is not set in the Storm config. Please set either the `extensions.cyclone.registry` or `config.extensions.cyclone.accountId` property in the Storm config.");
|
|
56
|
+
}
|
|
57
|
+
if (!process.env.AWS_ACCESS_KEY_ID || !process.env.AWS_SECRET_ACCESS_KEY) {
|
|
58
|
+
throw new Error("The AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables are not set. Please set these environment variables to upload to the Cyclone Registry.");
|
|
59
|
+
}
|
|
60
|
+
const endpoint = _optionalChain([options, 'optionalAccess', _17 => _17.registry]) ? options.registry : `https://${cloudflareAccountId}.r2.cloudflarestorage.com`;
|
|
61
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
62
|
+
if (!projectGraph) {
|
|
63
|
+
throw new Error("No project graph found in cache");
|
|
64
|
+
}
|
|
65
|
+
_chunkRCE3CC76js.writeInfo.call(void 0, `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`);
|
|
66
|
+
const s3Client = new (0, _clients3.S3)({
|
|
67
|
+
region: "auto",
|
|
68
|
+
endpoint,
|
|
69
|
+
credentials: {
|
|
70
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
71
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const version = _optionalChain([projectDetails, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.version]);
|
|
75
|
+
_chunkRCE3CC76js.writeInfo.call(void 0, `Generated component version: ${version}`);
|
|
76
|
+
const files = await _glob.glob.call(void 0, _devkit.joinPathFragments.call(void 0, sourceRoot, "**/*"), {
|
|
77
|
+
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
78
|
+
});
|
|
79
|
+
const projectPath = `registry/${context.projectName}`;
|
|
80
|
+
const internalDependencies = await _chunkJCB2DTP6js.getInternalDependencies.call(void 0, context.projectName, projectGraph);
|
|
81
|
+
const dependencies = internalDependencies.filter((projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")).reduce((ret, dep) => {
|
|
82
|
+
if (!ret[dep.name]) {
|
|
83
|
+
ret[dep.name] = "latest";
|
|
84
|
+
}
|
|
85
|
+
return ret;
|
|
86
|
+
}, _nullishCoalesce(projectDetails.content.dependencies, () => ( {})));
|
|
87
|
+
const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
|
|
88
|
+
_chunkRCE3CC76js.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
|
|
89
|
+
if (!isDryRun) {
|
|
90
|
+
const response = await s3Client.listObjects({
|
|
91
|
+
Bucket: options.bucketId,
|
|
92
|
+
Prefix: projectPath
|
|
93
|
+
});
|
|
94
|
+
if (_optionalChain([response, 'optionalAccess', _20 => _20.Contents]) && response.Contents.length > 0) {
|
|
95
|
+
_chunkRCE3CC76js.writeDebug.call(void 0, `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`);
|
|
96
|
+
await Promise.all(response.Contents.map((item) => s3Client.deleteObjects({
|
|
97
|
+
Bucket: options.bucketId,
|
|
98
|
+
Delete: {
|
|
99
|
+
Objects: [
|
|
100
|
+
{
|
|
101
|
+
Key: item.Key
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
Quiet: false
|
|
105
|
+
}
|
|
106
|
+
})));
|
|
107
|
+
} else {
|
|
108
|
+
_chunkRCE3CC76js.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
_chunkRCE3CC76js.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
|
|
112
|
+
}
|
|
113
|
+
const meta = {
|
|
114
|
+
name: context.projectName,
|
|
115
|
+
version,
|
|
116
|
+
release,
|
|
117
|
+
description: projectDetails.content.description,
|
|
118
|
+
tags: projectDetails.content.keywords,
|
|
119
|
+
dependencies,
|
|
120
|
+
devDependencies: null,
|
|
121
|
+
internalDependencies: internalDependencies.filter((projectNode) => projectNode.data.tags && projectNode.data.tags.some((tag) => tag.toLowerCase() === "component")).map((dep) => dep.name)
|
|
122
|
+
};
|
|
123
|
+
if (projectDetails.type === "package.json") {
|
|
124
|
+
meta.devDependencies = projectDetails.content.devDependencies;
|
|
125
|
+
}
|
|
126
|
+
const metaJson = JSON.stringify(meta);
|
|
127
|
+
_chunkRCE3CC76js.writeInfo.call(void 0, `Generating meta.json file:
|
|
128
|
+
${metaJson}`);
|
|
129
|
+
await _chunkJCB2DTP6js.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, "meta.json", version, metaJson, "application/json", isDryRun);
|
|
130
|
+
await Promise.all(files.map((file) => {
|
|
131
|
+
const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
|
|
132
|
+
return _promises.readFile.call(void 0, file, {
|
|
133
|
+
encoding: "utf8"
|
|
134
|
+
}).then((fileContent) => _chunkJCB2DTP6js.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
|
|
135
|
+
}));
|
|
136
|
+
_chunkRCE3CC76js.writeSuccess.call(void 0, `Successfully uploaded the ${projectName} component to the Cyclone Registry`, config);
|
|
137
|
+
return {
|
|
138
|
+
success: true
|
|
139
|
+
};
|
|
140
|
+
} catch (error) {
|
|
141
|
+
console.error("Failed to publish to Cloudflare Workers Registry");
|
|
142
|
+
console.error(error);
|
|
143
|
+
console.log("");
|
|
144
|
+
return {
|
|
145
|
+
success: false
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, runExecutor, "runExecutor");
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
exports.runExecutor = runExecutor;
|