@storm-software/cloudflare-tools 0.63.27 → 0.63.29
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 +14 -0
- package/README.md +1 -1
- package/dist/{chunk-3M2F4JUW.mjs → chunk-24VUYU3L.mjs} +3 -3
- package/dist/{chunk-YKB65IP2.mjs → chunk-4FG7GV4R.mjs} +1 -1
- package/dist/{chunk-6SVJXZBV.js → chunk-CJLUHYEV.js} +126 -121
- package/dist/{chunk-MB2PUV2U.mjs → chunk-DW5K6TQT.mjs} +1 -1
- package/dist/{chunk-NTPBAB34.js → chunk-EFRVMCDQ.js} +2 -2
- package/dist/{chunk-4FMFQGIC.mjs → chunk-HZHOSXS6.mjs} +2 -2
- package/dist/{chunk-6AC4HGUU.mjs → chunk-I5P7M77J.mjs} +1 -1
- package/dist/{chunk-N5LTPQ53.js → chunk-IATTWS2I.js} +3 -3
- package/dist/{chunk-T2OGA6MB.js → chunk-IRORGRVZ.js} +2 -2
- package/dist/{chunk-G2NJAIMM.js → chunk-J6WBZNBT.js} +3 -3
- package/dist/{chunk-NK6XHZKN.js → chunk-KSYCHFSA.js} +12 -12
- package/dist/{chunk-ZNYU5YAQ.mjs → chunk-LVQQJNPK.mjs} +3 -3
- package/dist/{chunk-KTFMIXUN.js → chunk-NU34IEWN.js} +27 -23
- package/dist/{chunk-RH2IXKSC.mjs → chunk-PH3DHY4Q.mjs} +26 -22
- package/dist/{chunk-446Z4I2E.mjs → chunk-SK3KX3JA.mjs} +9 -4
- package/dist/{chunk-OKD45PFS.mjs → chunk-TL2ZBMKH.mjs} +4 -4
- package/dist/{chunk-CCIXQ6JW.js → chunk-UUDRLXNN.js} +19 -19
- package/dist/{chunk-AVDLSZLA.js → chunk-YMATJZEA.js} +43 -43
- package/dist/executors.js +7 -7
- package/dist/executors.mjs +7 -7
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +18 -18
- package/dist/index.mjs +9 -9
- package/dist/src/executors/cloudflare-publish/executor.js +6 -6
- package/dist/src/executors/cloudflare-publish/executor.mjs +5 -5
- package/dist/src/executors/r2-upload-publish/executor.js +6 -6
- package/dist/src/executors/r2-upload-publish/executor.mjs +5 -5
- package/dist/src/executors/serve/executor.js +6 -6
- package/dist/src/executors/serve/executor.mjs +4 -4
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +4 -4
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +2 -2
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
- package/package.json +4 -3
|
@@ -7,7 +7,7 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
|
7
7
|
"package.json"(exports, module) {
|
|
8
8
|
module.exports = {
|
|
9
9
|
name: "@storm-software/cloudflare-tools",
|
|
10
|
-
version: "0.63.
|
|
10
|
+
version: "0.63.28",
|
|
11
11
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
12
12
|
repository: {
|
|
13
13
|
type: "github",
|
|
@@ -175,7 +175,7 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
|
175
175
|
nx: "catalog:",
|
|
176
176
|
tsup: "catalog:",
|
|
177
177
|
untyped: "catalog:",
|
|
178
|
-
wrangler: "^4.20.
|
|
178
|
+
wrangler: "^4.20.5"
|
|
179
179
|
},
|
|
180
180
|
publishConfig: {
|
|
181
181
|
access: "public"
|
|
@@ -7,7 +7,7 @@ var require_package = __commonJS({
|
|
|
7
7
|
"package.json"(exports, module) {
|
|
8
8
|
module.exports = {
|
|
9
9
|
name: "@storm-software/cloudflare-tools",
|
|
10
|
-
version: "0.63.
|
|
10
|
+
version: "0.63.28",
|
|
11
11
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
12
12
|
repository: {
|
|
13
13
|
type: "github",
|
|
@@ -175,7 +175,7 @@ var require_package = __commonJS({
|
|
|
175
175
|
nx: "catalog:",
|
|
176
176
|
tsup: "catalog:",
|
|
177
177
|
untyped: "catalog:",
|
|
178
|
-
wrangler: "^4.20.
|
|
178
|
+
wrangler: "^4.20.5"
|
|
179
179
|
},
|
|
180
180
|
publishConfig: {
|
|
181
181
|
access: "public"
|
|
@@ -417,9 +417,9 @@ var organizationConfigSchema = z.object({
|
|
|
417
417
|
}).describe("The workspace's organization details");
|
|
418
418
|
var stormWorkspaceConfigSchema = z.object({
|
|
419
419
|
$schema: z.string().trim().default(
|
|
420
|
-
"https://
|
|
421
|
-
).
|
|
422
|
-
"The URL to the JSON schema file that describes the Storm configuration file"
|
|
420
|
+
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
421
|
+
).describe(
|
|
422
|
+
"The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
423
423
|
),
|
|
424
424
|
extends: ExtendsSchema.optional(),
|
|
425
425
|
name: z.string().trim().toLowerCase().optional().describe(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNU34IEWNjs = require('./chunk-NU34IEWN.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkMCKGQKYUjs = require('./chunk-MCKGQKYU.js');
|
|
@@ -24,7 +24,7 @@ async function runExecutor(options, context) {
|
|
|
24
24
|
_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.root])
|
|
25
25
|
);
|
|
26
26
|
try {
|
|
27
|
-
const args =
|
|
27
|
+
const args = _chunkNU34IEWNjs.createCliOptions.call(void 0, { ...options });
|
|
28
28
|
if (isDryRun) {
|
|
29
29
|
args.push("--dry-run");
|
|
30
30
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIATTWS2Ijs = require('./chunk-IATTWS2I.js');
|
|
5
5
|
|
|
6
6
|
// src/utils/r2-bucket-helpers.ts
|
|
7
7
|
var _crypto = require('crypto');
|
|
8
8
|
var r2UploadFile = async (client, bucketName, projectPath, fileName, version, fileContent, contentType = "text/plain", isDryRun = false) => {
|
|
9
9
|
const checksum = _crypto.createHash.call(void 0, "sha256").update(fileContent).digest("base64");
|
|
10
10
|
const fileKey = `${projectPath}/${fileName.startsWith("/") ? fileName.substring(1) : fileName}`;
|
|
11
|
-
|
|
11
|
+
_chunkIATTWS2Ijs.writeDebug.call(void 0, `Uploading file: ${fileKey}`);
|
|
12
12
|
if (!isDryRun) {
|
|
13
13
|
await client.putObject({
|
|
14
14
|
Bucket: bucketName,
|
|
@@ -21,7 +21,7 @@ var r2UploadFile = async (client, bucketName, projectPath, fileName, version, fi
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
} else {
|
|
24
|
-
|
|
24
|
+
_chunkIATTWS2Ijs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
var getInternalDependencies = (projectName, graph) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkEFRVMCDQjs = require('./chunk-EFRVMCDQ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkYMATJZEAjs = require('./chunk-YMATJZEA.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ var _chunkAVDLSZLAjs = require('./chunk-AVDLSZLA.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkIATTWS2Ijs = require('./chunk-IATTWS2I.js');
|
|
16
16
|
|
|
17
17
|
// src/generators/worker/generator.ts
|
|
18
18
|
|
|
@@ -45,20 +45,20 @@ var vitestScript = `"test": "vitest run"`;
|
|
|
45
45
|
|
|
46
46
|
// src/generators/worker/generator.ts
|
|
47
47
|
async function applicationGenerator(tree, schema) {
|
|
48
|
-
const stopwatch =
|
|
48
|
+
const stopwatch = _chunkIATTWS2Ijs.getStopwatch.call(void 0, "Storm Worker generator");
|
|
49
49
|
let config;
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
_chunkIATTWS2Ijs.writeInfo.call(void 0, `\u26A1 Running the Storm Worker generator...
|
|
52
52
|
|
|
53
53
|
`, config);
|
|
54
|
-
const workspaceRoot =
|
|
55
|
-
|
|
54
|
+
const workspaceRoot = _chunkIATTWS2Ijs.findWorkspaceRoot.call(void 0, );
|
|
55
|
+
_chunkIATTWS2Ijs.writeDebug.call(void 0,
|
|
56
56
|
`Loading the Storm Config from environment variables and storm.json file...
|
|
57
57
|
- workspaceRoot: ${workspaceRoot}`,
|
|
58
58
|
config
|
|
59
59
|
);
|
|
60
|
-
config = await
|
|
61
|
-
|
|
60
|
+
config = await _chunkYMATJZEAjs.getConfig.call(void 0, workspaceRoot);
|
|
61
|
+
_chunkIATTWS2Ijs.writeTrace.call(void 0,
|
|
62
62
|
`Loaded Storm config into env:
|
|
63
63
|
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`,
|
|
64
64
|
config
|
|
@@ -66,7 +66,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
66
66
|
const options = await normalizeOptions(tree, schema, config);
|
|
67
67
|
const tasks = [];
|
|
68
68
|
tasks.push(
|
|
69
|
-
await
|
|
69
|
+
await _chunkEFRVMCDQjs.generator_default.call(void 0, tree, {
|
|
70
70
|
...options,
|
|
71
71
|
skipFormat: true
|
|
72
72
|
})
|
|
@@ -134,11 +134,11 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
134
134
|
return _devkit.runTasksInSerial.call(void 0, ...tasks);
|
|
135
135
|
} catch (error) {
|
|
136
136
|
return () => {
|
|
137
|
-
|
|
137
|
+
_chunkIATTWS2Ijs.writeFatal.call(void 0,
|
|
138
138
|
"A fatal error occurred while running the generator - the process was forced to terminate",
|
|
139
139
|
config
|
|
140
140
|
);
|
|
141
|
-
|
|
141
|
+
_chunkIATTWS2Ijs.writeError.call(void 0,
|
|
142
142
|
`An exception was thrown in the generator's process
|
|
143
143
|
- Details: ${error.message}
|
|
144
144
|
- Stacktrace: ${error.stack}`,
|
|
@@ -417,9 +417,9 @@ var organizationConfigSchema = z.object({
|
|
|
417
417
|
}).describe("The workspace's organization details");
|
|
418
418
|
var stormWorkspaceConfigSchema = z.object({
|
|
419
419
|
$schema: z.string().trim().default(
|
|
420
|
-
"https://
|
|
421
|
-
).
|
|
422
|
-
"The URL to the JSON schema file that describes the Storm configuration file"
|
|
420
|
+
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
421
|
+
).describe(
|
|
422
|
+
"The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
423
423
|
),
|
|
424
424
|
extends: ExtendsSchema.optional(),
|
|
425
425
|
name: z.string().trim().toLowerCase().optional().describe(
|
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; }// ../workspace-tools/src/utils/
|
|
2
|
-
var _devkit = require('@nx/devkit');
|
|
3
|
-
function createCliOptions(obj) {
|
|
4
|
-
const args = [];
|
|
5
|
-
for (const key in obj) {
|
|
6
|
-
const value = obj[key];
|
|
7
|
-
if (value) {
|
|
8
|
-
const arg = _devkit.names.call(void 0, key).fileName;
|
|
9
|
-
if (Array.isArray(value)) {
|
|
10
|
-
args.push(
|
|
11
|
-
`--${arg.toLowerCase()}=${value.map((v) => v.trim()).join(",")}`
|
|
12
|
-
);
|
|
13
|
-
} else {
|
|
14
|
-
args.push(`--${arg.toLowerCase()}=${value}`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return args;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// ../workspace-tools/src/utils/package-helpers.ts
|
|
22
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; }// ../workspace-tools/src/utils/package-helpers.ts
|
|
23
2
|
|
|
24
3
|
|
|
25
4
|
|
|
5
|
+
var _devkit = require('@nx/devkit');
|
|
26
6
|
|
|
27
7
|
// ../config-tools/src/utilities/toml.ts
|
|
28
8
|
var _jtoml = require('@ltd/j-toml'); var _jtoml2 = _interopRequireDefault(_jtoml);
|
|
@@ -36,7 +16,11 @@ function parseCargoToml(cargoString) {
|
|
|
36
16
|
}
|
|
37
17
|
|
|
38
18
|
// ../workspace-tools/src/utils/package-helpers.ts
|
|
19
|
+
var _child_process = require('child_process');
|
|
39
20
|
var _fs = require('fs');
|
|
21
|
+
var _promises = require('fs/promises');
|
|
22
|
+
var _path = require('path');
|
|
23
|
+
var _prettier = require('prettier');
|
|
40
24
|
|
|
41
25
|
// ../workspace-tools/src/utils/project-tags.ts
|
|
42
26
|
var ProjectTagConstants = {
|
|
@@ -137,9 +121,29 @@ var getPackageInfo = (project) => {
|
|
|
137
121
|
return null;
|
|
138
122
|
};
|
|
139
123
|
|
|
124
|
+
// ../workspace-tools/src/utils/create-cli-options.ts
|
|
125
|
+
|
|
126
|
+
function createCliOptions(obj) {
|
|
127
|
+
const args = [];
|
|
128
|
+
for (const key in obj) {
|
|
129
|
+
const value = obj[key];
|
|
130
|
+
if (value) {
|
|
131
|
+
const arg = _devkit.names.call(void 0, key).fileName;
|
|
132
|
+
if (Array.isArray(value)) {
|
|
133
|
+
args.push(
|
|
134
|
+
`--${arg.toLowerCase()}=${value.map((v) => v.trim()).join(",")}`
|
|
135
|
+
);
|
|
136
|
+
} else {
|
|
137
|
+
args.push(`--${arg.toLowerCase()}=${value}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return args;
|
|
142
|
+
}
|
|
143
|
+
|
|
140
144
|
|
|
141
145
|
|
|
142
146
|
|
|
143
147
|
|
|
144
148
|
|
|
145
|
-
exports.ProjectTagConstants = ProjectTagConstants; exports.addProjectTag = addProjectTag; exports.
|
|
149
|
+
exports.ProjectTagConstants = ProjectTagConstants; exports.addProjectTag = addProjectTag; exports.getPackageInfo = getPackageInfo; exports.createCliOptions = createCliOptions;
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
// ../workspace-tools/src/utils/create-cli-options.ts
|
|
2
|
-
import { names } from "@nx/devkit";
|
|
3
|
-
function createCliOptions(obj) {
|
|
4
|
-
const args = [];
|
|
5
|
-
for (const key in obj) {
|
|
6
|
-
const value = obj[key];
|
|
7
|
-
if (value) {
|
|
8
|
-
const arg = names(key).fileName;
|
|
9
|
-
if (Array.isArray(value)) {
|
|
10
|
-
args.push(
|
|
11
|
-
`--${arg.toLowerCase()}=${value.map((v) => v.trim()).join(",")}`
|
|
12
|
-
);
|
|
13
|
-
} else {
|
|
14
|
-
args.push(`--${arg.toLowerCase()}=${value}`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return args;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
1
|
// ../workspace-tools/src/utils/package-helpers.ts
|
|
22
2
|
import {
|
|
23
3
|
joinPathFragments,
|
|
@@ -36,7 +16,11 @@ function parseCargoToml(cargoString) {
|
|
|
36
16
|
}
|
|
37
17
|
|
|
38
18
|
// ../workspace-tools/src/utils/package-helpers.ts
|
|
19
|
+
import { execFileSync } from "child_process";
|
|
39
20
|
import { existsSync } from "node:fs";
|
|
21
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
22
|
+
import { dirname, resolve } from "path";
|
|
23
|
+
import { format } from "prettier";
|
|
40
24
|
|
|
41
25
|
// ../workspace-tools/src/utils/project-tags.ts
|
|
42
26
|
var ProjectTagConstants = {
|
|
@@ -137,9 +121,29 @@ var getPackageInfo = (project) => {
|
|
|
137
121
|
return null;
|
|
138
122
|
};
|
|
139
123
|
|
|
124
|
+
// ../workspace-tools/src/utils/create-cli-options.ts
|
|
125
|
+
import { names } from "@nx/devkit";
|
|
126
|
+
function createCliOptions(obj) {
|
|
127
|
+
const args = [];
|
|
128
|
+
for (const key in obj) {
|
|
129
|
+
const value = obj[key];
|
|
130
|
+
if (value) {
|
|
131
|
+
const arg = names(key).fileName;
|
|
132
|
+
if (Array.isArray(value)) {
|
|
133
|
+
args.push(
|
|
134
|
+
`--${arg.toLowerCase()}=${value.map((v) => v.trim()).join(",")}`
|
|
135
|
+
);
|
|
136
|
+
} else {
|
|
137
|
+
args.push(`--${arg.toLowerCase()}=${value}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return args;
|
|
142
|
+
}
|
|
143
|
+
|
|
140
144
|
export {
|
|
141
145
|
ProjectTagConstants,
|
|
142
146
|
addProjectTag,
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
getPackageInfo,
|
|
148
|
+
createCliOptions
|
|
145
149
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProjectTagConstants,
|
|
3
3
|
addProjectTag
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PH3DHY4Q.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getConfig,
|
|
7
7
|
getWorkspaceConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-I5P7M77J.mjs";
|
|
9
9
|
import {
|
|
10
10
|
findWorkspaceRoot,
|
|
11
11
|
formatLogMessage,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
writeSuccess,
|
|
20
20
|
writeTrace,
|
|
21
21
|
writeWarning
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LVQQJNPK.mjs";
|
|
23
23
|
import {
|
|
24
24
|
__dirname,
|
|
25
25
|
__require
|
|
@@ -1938,7 +1938,12 @@ async function configSchemaGeneratorFn(tree, options, config) {
|
|
|
1938
1938
|
`Determining the Storm Workspace Configuration JSON Schema...`,
|
|
1939
1939
|
config
|
|
1940
1940
|
);
|
|
1941
|
-
const jsonSchema = z.toJSONSchema(stormWorkspaceConfigSchema
|
|
1941
|
+
const jsonSchema = z.toJSONSchema(stormWorkspaceConfigSchema, {
|
|
1942
|
+
target: "draft-7"
|
|
1943
|
+
});
|
|
1944
|
+
jsonSchema.$id ??= "https://public.storm-cdn.com/schemas/storm-workspace.schema.json";
|
|
1945
|
+
jsonSchema.title ??= "Storm Workspace Configuration JSON Schema";
|
|
1946
|
+
jsonSchema.description ??= "This JSON Schema defines the structure of the Storm Workspace configuration file (`storm-workspace.json`). It is used to validate the configuration file and ensure that it adheres to the expected format.";
|
|
1942
1947
|
writeTrace(jsonSchema, config);
|
|
1943
1948
|
if (!options.outputFile) {
|
|
1944
1949
|
throw new Error(
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getInternalDependencies,
|
|
3
3
|
r2UploadFile
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DW5K6TQT.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createCliOptions,
|
|
7
7
|
getPackageInfo
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PH3DHY4Q.mjs";
|
|
9
9
|
import {
|
|
10
10
|
getConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-I5P7M77J.mjs";
|
|
12
12
|
import {
|
|
13
13
|
findWorkspaceRoot,
|
|
14
14
|
writeDebug,
|
|
15
15
|
writeInfo,
|
|
16
16
|
writeSuccess,
|
|
17
17
|
writeWarning
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LVQQJNPK.mjs";
|
|
19
19
|
|
|
20
20
|
// src/executors/r2-upload-publish/executor.ts
|
|
21
21
|
import { S3 } from "@aws-sdk/client-s3";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
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
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkJ6WBZNBTjs = require('./chunk-J6WBZNBT.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkNU34IEWNjs = require('./chunk-NU34IEWN.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkYMATJZEAjs = require('./chunk-YMATJZEA.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkIATTWS2Ijs = require('./chunk-IATTWS2I.js');
|
|
19
19
|
|
|
20
20
|
// src/executors/r2-upload-publish/executor.ts
|
|
21
21
|
var _clients3 = require('@aws-sdk/client-s3');
|
|
@@ -39,11 +39,11 @@ async function runExecutor(options, context) {
|
|
|
39
39
|
throw new Error("The executor requires projectsConfigurations.");
|
|
40
40
|
}
|
|
41
41
|
try {
|
|
42
|
-
const workspaceRoot =
|
|
43
|
-
const config = await
|
|
42
|
+
const workspaceRoot = _chunkIATTWS2Ijs.findWorkspaceRoot.call(void 0, );
|
|
43
|
+
const config = await _chunkYMATJZEAjs.getConfig.call(void 0, workspaceRoot);
|
|
44
44
|
const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
|
|
45
45
|
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
|
|
46
|
-
const projectDetails =
|
|
46
|
+
const projectDetails = _chunkNU34IEWNjs.getPackageInfo.call(void 0,
|
|
47
47
|
context.projectsConfigurations.projects[context.projectName]
|
|
48
48
|
);
|
|
49
49
|
if (!_optionalChain([projectDetails, 'optionalAccess', _15 => _15.content])) {
|
|
@@ -51,7 +51,7 @@ async function runExecutor(options, context) {
|
|
|
51
51
|
`Could not find the project details for ${context.projectName}`
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
const args =
|
|
54
|
+
const args = _chunkNU34IEWNjs.createCliOptions.call(void 0, { ...options });
|
|
55
55
|
if (isDryRun) {
|
|
56
56
|
args.push("--dry-run");
|
|
57
57
|
}
|
|
@@ -79,7 +79,7 @@ async function runExecutor(options, context) {
|
|
|
79
79
|
"The executor failed because the project graph is not available. Please run the build command again."
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
_chunkIATTWS2Ijs.writeInfo.call(void 0,
|
|
83
83
|
`Publishing ${context.projectName} to the Storm Registry at ${endpoint}`
|
|
84
84
|
);
|
|
85
85
|
const s3Client = new (0, _clients3.S3)({
|
|
@@ -91,12 +91,12 @@ async function runExecutor(options, context) {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
const version = _optionalChain([projectDetails, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.version]);
|
|
94
|
-
|
|
94
|
+
_chunkIATTWS2Ijs.writeInfo.call(void 0, `Generated component version: ${version}`);
|
|
95
95
|
const files = await _glob.glob.call(void 0, _devkit.joinPathFragments.call(void 0, sourceRoot, "**/*"), {
|
|
96
96
|
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
97
97
|
});
|
|
98
98
|
const projectPath = `registry/${context.projectName}`;
|
|
99
|
-
const internalDependencies = await
|
|
99
|
+
const internalDependencies = await _chunkJ6WBZNBTjs.getInternalDependencies.call(void 0,
|
|
100
100
|
context.projectName,
|
|
101
101
|
projectGraph
|
|
102
102
|
);
|
|
@@ -109,14 +109,14 @@ async function runExecutor(options, context) {
|
|
|
109
109
|
return ret;
|
|
110
110
|
}, _nullishCoalesce(projectDetails.content.dependencies, () => ( {})));
|
|
111
111
|
const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
|
|
112
|
-
|
|
112
|
+
_chunkIATTWS2Ijs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
|
|
113
113
|
if (!isDryRun) {
|
|
114
114
|
const response = await s3Client.listObjects({
|
|
115
115
|
Bucket: options.bucketId,
|
|
116
116
|
Prefix: projectPath
|
|
117
117
|
});
|
|
118
118
|
if (_optionalChain([response, 'optionalAccess', _20 => _20.Contents]) && response.Contents.length > 0) {
|
|
119
|
-
|
|
119
|
+
_chunkIATTWS2Ijs.writeDebug.call(void 0,
|
|
120
120
|
`Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`
|
|
121
121
|
);
|
|
122
122
|
await Promise.all(
|
|
@@ -135,12 +135,12 @@ async function runExecutor(options, context) {
|
|
|
135
135
|
)
|
|
136
136
|
);
|
|
137
137
|
} else {
|
|
138
|
-
|
|
138
|
+
_chunkIATTWS2Ijs.writeDebug.call(void 0,
|
|
139
139
|
`No existing items to delete in the component registry path ${projectPath}`
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
142
|
} else {
|
|
143
|
-
|
|
143
|
+
_chunkIATTWS2Ijs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
|
|
144
144
|
}
|
|
145
145
|
const meta = {
|
|
146
146
|
name: context.projectName,
|
|
@@ -158,9 +158,9 @@ async function runExecutor(options, context) {
|
|
|
158
158
|
meta.devDependencies = projectDetails.content.devDependencies;
|
|
159
159
|
}
|
|
160
160
|
const metaJson = JSON.stringify(meta);
|
|
161
|
-
|
|
161
|
+
_chunkIATTWS2Ijs.writeInfo.call(void 0, `Generating meta.json file:
|
|
162
162
|
${metaJson}`);
|
|
163
|
-
await
|
|
163
|
+
await _chunkJ6WBZNBTjs.r2UploadFile.call(void 0,
|
|
164
164
|
s3Client,
|
|
165
165
|
options.bucketId,
|
|
166
166
|
projectPath,
|
|
@@ -174,7 +174,7 @@ ${metaJson}`);
|
|
|
174
174
|
files.map((file) => {
|
|
175
175
|
const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
|
|
176
176
|
return _promises.readFile.call(void 0, file, { encoding: "utf8" }).then(
|
|
177
|
-
(fileContent) =>
|
|
177
|
+
(fileContent) => _chunkJ6WBZNBTjs.r2UploadFile.call(void 0,
|
|
178
178
|
s3Client,
|
|
179
179
|
options.bucketId,
|
|
180
180
|
projectPath,
|
|
@@ -187,7 +187,7 @@ ${metaJson}`);
|
|
|
187
187
|
);
|
|
188
188
|
})
|
|
189
189
|
);
|
|
190
|
-
|
|
190
|
+
_chunkIATTWS2Ijs.writeSuccess.call(void 0,
|
|
191
191
|
`Successfully uploaded the ${projectName} component to the Cyclone Registry`,
|
|
192
192
|
config
|
|
193
193
|
);
|