@storm-software/cloudflare-tools 0.71.242 → 0.71.247
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 +60 -0
- package/README.md +1 -1
- package/dist/{chunk-GLKR5BOA.js → chunk-2SPQ64QX.js} +2 -2
- package/dist/{chunk-BGMLQBUW.mjs → chunk-BTKJRCZQ.mjs} +1 -1
- package/dist/{chunk-KNN4W7QC.mjs → chunk-GYIUU2G4.mjs} +184 -142
- package/dist/{chunk-3GUCTXXT.mjs → chunk-KZQP6DGG.mjs} +2 -2
- package/dist/{chunk-MVEHOKMY.mjs → chunk-MCCHKUCS.mjs} +2 -2
- package/dist/{chunk-YCOA7IKG.mjs → chunk-NG5JLH7K.mjs} +7 -7
- package/dist/{chunk-4HEOMMTX.mjs → chunk-NZ4SP2BO.mjs} +2 -2
- package/dist/{chunk-AF4CHUYX.js → chunk-O6QQDVZ5.js} +2 -2
- package/dist/{chunk-GRVOVEJP.js → chunk-OTUOQHGH.js} +6 -6
- package/dist/{chunk-TMHLSIZ5.js → chunk-UGIZ5QUS.js} +1 -1
- package/dist/{chunk-EI77CIK7.mjs → chunk-WPIQWFHD.mjs} +1 -1
- package/dist/{chunk-7NFFNXFN.js → chunk-XKZTXB5T.js} +163 -121
- package/dist/executors.js +1 -1
- package/dist/executors.mjs +3 -3
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +3 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +5 -5
- package/dist/src/executors/cloudflare-publish/executor.js +1 -1
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.mjs +1 -1
- package/dist/src/executors/r2-upload-publish/untyped.mjs +1 -1
- package/dist/src/executors/serve/executor.js +2 -2
- package/dist/src/executors/serve/executor.mjs +2 -2
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +2 -2
- package/dist/src/generators/worker/generator.js +3 -3
- package/dist/src/generators/worker/generator.mjs +3 -3
- package/dist/src/plugins/index.mjs +1 -1
- package/dist/src/utils/http-handler.mjs +1 -1
- package/dist/src/utils/index.mjs +1 -1
- package/dist/src/utils/r2-bucket-helpers.mjs +1 -1
- package/package.json +10 -10
- package/dist/chunk-BASIQFOW.js +0 -231
- package/dist/chunk-E2KDBKFZ.mjs +0 -231
package/dist/executors.js
CHANGED
|
@@ -3,7 +3,7 @@ require('./chunk-FLA2SYPV.js');
|
|
|
3
3
|
require('./chunk-KUGEZPUO.js');
|
|
4
4
|
require('./chunk-CLCKX6UN.js');
|
|
5
5
|
require('./chunk-HNDXHX7M.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-XKZTXB5T.js');
|
|
7
7
|
require('./chunk-NCVDTA5M.js');
|
|
8
8
|
require('./chunk-YRUROEEP.js');
|
|
9
9
|
require('./chunk-FBLD25X4.js');
|
package/dist/executors.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import "./chunk-YSCEY447.mjs";
|
|
|
2
2
|
import "./chunk-WTWLKDV7.mjs";
|
|
3
3
|
import "./chunk-SWYYMID7.mjs";
|
|
4
4
|
import "./chunk-BY7MA3SM.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-BTKJRCZQ.mjs";
|
|
6
|
+
import "./chunk-GYIUU2G4.mjs";
|
|
7
7
|
import "./chunk-ZXLMDNFQ.mjs";
|
|
8
8
|
import "./chunk-BJQFVPGK.mjs";
|
|
9
9
|
import "./chunk-CSTZEHUP.mjs";
|
|
10
10
|
import "./chunk-K4H5ZMYA.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-WPIQWFHD.mjs";
|
package/dist/generators.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkO6QQDVZ5js = require('./chunk-O6QQDVZ5.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkUGIZ5QUSjs = require('./chunk-UGIZ5QUS.js');
|
|
10
10
|
require('./chunk-YRUROEEP.js');
|
|
11
11
|
require('./chunk-AWKQRM2H.js');
|
|
12
12
|
require('./chunk-MCKGQKYU.js');
|
|
@@ -15,4 +15,4 @@ require('./chunk-MCKGQKYU.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.applicationGenerator =
|
|
18
|
+
exports.applicationGenerator = _chunkO6QQDVZ5js.applicationGenerator; exports.applicationSchematic = _chunkO6QQDVZ5js.applicationSchematic; exports.initGenerator = _chunkUGIZ5QUSjs.initGenerator; exports.initSchematic = _chunkUGIZ5QUSjs.initSchematic;
|
package/dist/generators.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
applicationGenerator,
|
|
4
4
|
applicationSchematic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KZQP6DGG.mjs";
|
|
6
6
|
import {
|
|
7
7
|
initGenerator,
|
|
8
8
|
initSchematic
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MCCHKUCS.mjs";
|
|
10
10
|
import "./chunk-BJQFVPGK.mjs";
|
|
11
11
|
import "./chunk-K4H5ZMYA.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-WPIQWFHD.mjs";
|
|
13
13
|
export {
|
|
14
14
|
applicationGenerator,
|
|
15
15
|
applicationSchematic,
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ require('./chunk-DHBG5ASJ.js');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkO6QQDVZ5js = require('./chunk-O6QQDVZ5.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkUGIZ5QUSjs = require('./chunk-UGIZ5QUS.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -22,7 +22,7 @@ require('./chunk-CVGPWUNP.js');
|
|
|
22
22
|
|
|
23
23
|
var _chunkCLCKX6UNjs = require('./chunk-CLCKX6UN.js');
|
|
24
24
|
require('./chunk-HNDXHX7M.js');
|
|
25
|
-
require('./chunk-
|
|
25
|
+
require('./chunk-XKZTXB5T.js');
|
|
26
26
|
require('./chunk-NCVDTA5M.js');
|
|
27
27
|
require('./chunk-YRUROEEP.js');
|
|
28
28
|
require('./chunk-FBLD25X4.js');
|
|
@@ -39,4 +39,4 @@ require('./chunk-MCKGQKYU.js');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.applicationGenerator =
|
|
42
|
+
exports.applicationGenerator = _chunkO6QQDVZ5js.applicationGenerator; exports.applicationSchematic = _chunkO6QQDVZ5js.applicationSchematic; exports.createNodesV2 = _chunkVJLWHQ5Bjs.createNodesV2; exports.getEncoding = _chunkCLCKX6UNjs.getEncoding; exports.getInternalDependencies = _chunkCLCKX6UNjs.getInternalDependencies; exports.initGenerator = _chunkUGIZ5QUSjs.initGenerator; exports.initSchematic = _chunkUGIZ5QUSjs.initSchematic; exports.isTextFile = _chunkCLCKX6UNjs.isTextFile; exports.name = _chunkVJLWHQ5Bjs.name; exports.uploadFile = _chunkCLCKX6UNjs.uploadFile;
|
package/dist/index.mjs
CHANGED
|
@@ -4,11 +4,11 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
4
4
|
import {
|
|
5
5
|
applicationGenerator,
|
|
6
6
|
applicationSchematic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KZQP6DGG.mjs";
|
|
8
8
|
import {
|
|
9
9
|
initGenerator,
|
|
10
10
|
initSchematic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MCCHKUCS.mjs";
|
|
12
12
|
import {
|
|
13
13
|
createNodesV2,
|
|
14
14
|
name
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
isTextFile,
|
|
22
22
|
uploadFile
|
|
23
23
|
} from "./chunk-BY7MA3SM.mjs";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-BTKJRCZQ.mjs";
|
|
25
|
+
import "./chunk-GYIUU2G4.mjs";
|
|
26
26
|
import "./chunk-ZXLMDNFQ.mjs";
|
|
27
27
|
import "./chunk-BJQFVPGK.mjs";
|
|
28
28
|
import "./chunk-CSTZEHUP.mjs";
|
|
29
29
|
import "./chunk-K4H5ZMYA.mjs";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-WPIQWFHD.mjs";
|
|
31
31
|
export {
|
|
32
32
|
applicationGenerator,
|
|
33
33
|
applicationSchematic,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
var _chunkHNDXHX7Mjs = require('../../../chunk-HNDXHX7M.js');
|
|
4
|
-
require('../../../chunk-
|
|
4
|
+
require('../../../chunk-XKZTXB5T.js');
|
|
5
5
|
require('../../../chunk-NCVDTA5M.js');
|
|
6
6
|
require('../../../chunk-YRUROEEP.js');
|
|
7
7
|
require('../../../chunk-FBLD25X4.js');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runExecutor
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-
|
|
3
|
+
} from "../../../chunk-BTKJRCZQ.mjs";
|
|
4
|
+
import "../../../chunk-GYIUU2G4.mjs";
|
|
5
5
|
import "../../../chunk-ZXLMDNFQ.mjs";
|
|
6
6
|
import "../../../chunk-BJQFVPGK.mjs";
|
|
7
7
|
import "../../../chunk-CSTZEHUP.mjs";
|
|
8
8
|
import "../../../chunk-K4H5ZMYA.mjs";
|
|
9
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-WPIQWFHD.mjs";
|
|
10
10
|
export {
|
|
11
11
|
runExecutor as default
|
|
12
12
|
};
|
|
@@ -7,7 +7,7 @@ import "../../../chunk-ZXLMDNFQ.mjs";
|
|
|
7
7
|
import "../../../chunk-BJQFVPGK.mjs";
|
|
8
8
|
import "../../../chunk-CSTZEHUP.mjs";
|
|
9
9
|
import "../../../chunk-K4H5ZMYA.mjs";
|
|
10
|
-
import "../../../chunk-
|
|
10
|
+
import "../../../chunk-WPIQWFHD.mjs";
|
|
11
11
|
export {
|
|
12
12
|
runExecutor as default
|
|
13
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _chunkXKZTXB5Tjs = require('../../../chunk-XKZTXB5T.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkNCVDTA5Mjs = require('../../../chunk-NCVDTA5M.js');
|
|
@@ -56,7 +56,7 @@ async function* serveExecutor(options, context) {
|
|
|
56
56
|
success: true
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
var executor_default =
|
|
59
|
+
var executor_default = _chunkXKZTXB5Tjs.withRunExecutor.call(void 0,
|
|
60
60
|
"Cloudflare Serve executor",
|
|
61
61
|
serveExecutor,
|
|
62
62
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withRunExecutor
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-GYIUU2G4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createCliOptions
|
|
6
6
|
} from "../../../chunk-ZXLMDNFQ.mjs";
|
|
@@ -9,7 +9,7 @@ import "../../../chunk-CSTZEHUP.mjs";
|
|
|
9
9
|
import "../../../chunk-K4H5ZMYA.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__require
|
|
12
|
-
} from "../../../chunk-
|
|
12
|
+
} from "../../../chunk-WPIQWFHD.mjs";
|
|
13
13
|
|
|
14
14
|
// src/executors/serve/executor.ts
|
|
15
15
|
import { createAsyncIterable } from "@nx/devkit/internal";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkUGIZ5QUSjs = require('../../../chunk-UGIZ5QUS.js');
|
|
6
6
|
require('../../../chunk-MCKGQKYU.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = _chunkUGIZ5QUSjs.generator_default; exports.initGenerator = _chunkUGIZ5QUSjs.initGenerator; exports.initSchematic = _chunkUGIZ5QUSjs.initSchematic;
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
generator_default,
|
|
3
3
|
initGenerator,
|
|
4
4
|
initSchematic
|
|
5
|
-
} from "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
5
|
+
} from "../../../chunk-MCCHKUCS.mjs";
|
|
6
|
+
import "../../../chunk-WPIQWFHD.mjs";
|
|
7
7
|
export {
|
|
8
8
|
generator_default as default,
|
|
9
9
|
initGenerator,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../../chunk-
|
|
5
|
+
var _chunkO6QQDVZ5js = require('../../../chunk-O6QQDVZ5.js');
|
|
6
|
+
require('../../../chunk-UGIZ5QUS.js');
|
|
7
7
|
require('../../../chunk-YRUROEEP.js');
|
|
8
8
|
require('../../../chunk-AWKQRM2H.js');
|
|
9
9
|
require('../../../chunk-MCKGQKYU.js');
|
|
@@ -11,4 +11,4 @@ require('../../../chunk-MCKGQKYU.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.applicationGenerator =
|
|
14
|
+
exports.applicationGenerator = _chunkO6QQDVZ5js.applicationGenerator; exports.applicationSchematic = _chunkO6QQDVZ5js.applicationSchematic; exports.default = _chunkO6QQDVZ5js.generator_default;
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
applicationGenerator,
|
|
3
3
|
applicationSchematic,
|
|
4
4
|
generator_default
|
|
5
|
-
} from "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
5
|
+
} from "../../../chunk-KZQP6DGG.mjs";
|
|
6
|
+
import "../../../chunk-MCCHKUCS.mjs";
|
|
7
7
|
import "../../../chunk-BJQFVPGK.mjs";
|
|
8
8
|
import "../../../chunk-K4H5ZMYA.mjs";
|
|
9
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-WPIQWFHD.mjs";
|
|
10
10
|
export {
|
|
11
11
|
applicationGenerator,
|
|
12
12
|
applicationSchematic,
|
package/dist/src/utils/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/cloudflare-tools",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.247",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
6
6
|
"keywords": [
|
|
@@ -141,12 +141,12 @@
|
|
|
141
141
|
"module": "dist/index.mjs",
|
|
142
142
|
"typings": "dist/index.d.ts",
|
|
143
143
|
"dependencies": {
|
|
144
|
-
"@aws-sdk/client-s3": "^3.
|
|
145
|
-
"@aws-sdk/lib-storage": "^3.
|
|
146
|
-
"@smithy/node-http-handler": "^4.9.
|
|
147
|
-
"@storm-software/config": "^1.138.
|
|
148
|
-
"@storm-software/config-tools": "^1.190.
|
|
149
|
-
"@storm-software/workspace-tools": "^1.296.
|
|
144
|
+
"@aws-sdk/client-s3": "^3.1087.0",
|
|
145
|
+
"@aws-sdk/lib-storage": "^3.1087.0",
|
|
146
|
+
"@smithy/node-http-handler": "^4.9.6",
|
|
147
|
+
"@storm-software/config": "^1.138.41",
|
|
148
|
+
"@storm-software/config-tools": "^1.190.104",
|
|
149
|
+
"@storm-software/workspace-tools": "^1.296.84",
|
|
150
150
|
"defu": "^6.1.7",
|
|
151
151
|
"glob": "^11.1.0",
|
|
152
152
|
"mime-types": "^3.0.2",
|
|
@@ -157,11 +157,11 @@
|
|
|
157
157
|
"@nx/node": "22.7.5",
|
|
158
158
|
"@nx/web": "22.7.5",
|
|
159
159
|
"@nx/webpack": "22.7.5",
|
|
160
|
-
"@smithy/protocol-http": "^5.5.
|
|
160
|
+
"@smithy/protocol-http": "^5.5.9",
|
|
161
161
|
"nx": "23.0.1",
|
|
162
162
|
"tsup": "8.4.0",
|
|
163
163
|
"untyped": "^2.0.0",
|
|
164
|
-
"wrangler": "^4.
|
|
164
|
+
"wrangler": "^4.111.0"
|
|
165
165
|
},
|
|
166
166
|
"peerDependencies": { "nx": ">=22.7.1", "wrangler": ">=3.58.0" },
|
|
167
167
|
"peerDependenciesMeta": {
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"publishConfig": { "access": "public" },
|
|
172
172
|
"executors": "./executors.json",
|
|
173
173
|
"generators": "./generators.json",
|
|
174
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "e9118ed4d0235c8643e71d0d8370987a2945f8d1"
|
|
175
175
|
}
|
package/dist/chunk-BASIQFOW.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
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; }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkNCVDTA5Mjs = require('./chunk-NCVDTA5M.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkYRUROEEPjs = require('./chunk-YRUROEEP.js');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _chunkKUGEZPUOjs = require('./chunk-KUGEZPUO.js');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _chunkCLCKX6UNjs = require('./chunk-CLCKX6UN.js');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _chunkAWKQRM2Hjs = require('./chunk-AWKQRM2H.js');
|
|
25
|
-
|
|
26
|
-
// src/executors/r2-upload-publish/executor.ts
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var _clients3 = require('@aws-sdk/client-s3');
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var _devkit = require('@nx/devkit');
|
|
36
|
-
var _glob = require('glob');
|
|
37
|
-
var _mimetypes = require('mime-types'); var _mimetypes2 = _interopRequireDefault(_mimetypes);
|
|
38
|
-
var _child_process = require('child_process');
|
|
39
|
-
var _fs = require('fs');
|
|
40
|
-
var _promises = require('fs/promises');
|
|
41
|
-
async function runExecutor(options, context) {
|
|
42
|
-
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
43
|
-
if (!context.projectName) {
|
|
44
|
-
throw new Error("The executor requires a projectName.");
|
|
45
|
-
}
|
|
46
|
-
if (!options.path) {
|
|
47
|
-
throw new Error("The executor requires the `path` option to upload.");
|
|
48
|
-
}
|
|
49
|
-
console.info(
|
|
50
|
-
`\u{1F680} Running Storm Cloudflare Publish executor on the ${context.projectName} worker`
|
|
51
|
-
);
|
|
52
|
-
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])) {
|
|
53
|
-
throw new Error("The executor requires projectsConfigurations.");
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
const workspaceRoot = _chunkYRUROEEPjs.findWorkspaceRoot.call(void 0, );
|
|
57
|
-
const config = await _chunkYRUROEEPjs.getConfig.call(void 0, workspaceRoot);
|
|
58
|
-
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.name]), () => ( context.projectName));
|
|
59
|
-
const projectDetails = _chunkNCVDTA5Mjs.getPackageInfo.call(void 0,
|
|
60
|
-
context.projectsConfigurations.projects[context.projectName]
|
|
61
|
-
);
|
|
62
|
-
const bucketId = options.bucketId;
|
|
63
|
-
const bucketPath = options.bucketPath || "/";
|
|
64
|
-
if (!bucketId) {
|
|
65
|
-
throw new Error("The executor requires a bucketId.");
|
|
66
|
-
}
|
|
67
|
-
const args = _chunkNCVDTA5Mjs.createCliOptions.call(void 0, { ...options });
|
|
68
|
-
if (isDryRun) {
|
|
69
|
-
args.push("--dry-run");
|
|
70
|
-
}
|
|
71
|
-
const cloudflareAccountId = process.env.CLOUDFLARE_ACCOUNT_ID || process.env.STORM_BOT_CLOUDFLARE_ACCOUNT;
|
|
72
|
-
if (!_optionalChain([options, 'optionalAccess', _11 => _11.registry]) && !cloudflareAccountId) {
|
|
73
|
-
throw new Error(
|
|
74
|
-
"The registry option and `CLOUDFLARE_ACCOUNT_ID` (or `STORM_BOT_CLOUDFLARE_ACCOUNT`) environment variable are not set. Please set one of these values to upload to the Cloudflare R2 bucket."
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
if (!process.env.STORM_BOT_ACCESS_KEY_ID && !process.env.ACCESS_KEY_ID && !process.env.CLOUDFLARE_ACCESS_KEY_ID && !process.env.AWS_ACCESS_KEY_ID || !process.env.STORM_BOT_SECRET_ACCESS_KEY && !process.env.CLOUDFLARE_SECRET_ACCESS_KEY && !process.env.SECRET_ACCESS_KEY && !process.env.AWS_SECRET_ACCESS_KEY) {
|
|
78
|
-
throw new Error(
|
|
79
|
-
"The `ACCESS_KEY_ID` (or `STORM_BOT_ACCESS_KEY_ID`) and `SECRET_ACCESS_KEY` (or `STORM_BOT_SECRET_ACCESS_KEY`) environment variables are not set. Please set these environment variables to upload to the Cloudflare R2 bucket."
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
const registry = _optionalChain([options, 'optionalAccess', _12 => _12.registry]) ? options.registry : `https://${cloudflareAccountId}.r2.cloudflarestorage.com`;
|
|
83
|
-
let projectGraph;
|
|
84
|
-
try {
|
|
85
|
-
projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
86
|
-
} catch (e) {
|
|
87
|
-
await _devkit.createProjectGraphAsync.call(void 0, );
|
|
88
|
-
projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
89
|
-
}
|
|
90
|
-
if (!projectGraph) {
|
|
91
|
-
throw new Error(
|
|
92
|
-
"The executor failed because the project graph is not available. Please run the build command again."
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
96
|
-
`Publishing ${context.projectName} to the ${bucketId} R2 Bucket (at ${registry})`
|
|
97
|
-
);
|
|
98
|
-
const client = new (0, _clients3.S3Client)({
|
|
99
|
-
region: "auto",
|
|
100
|
-
endpoint: registry,
|
|
101
|
-
credentials: {
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
103
|
-
accessKeyId: process.env.STORM_BOT_ACCESS_KEY_ID || process.env.CLOUDFLARE_ACCESS_KEY_ID || process.env.AWS_ACCESS_KEY_ID || process.env.ACCESS_KEY_ID,
|
|
104
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
105
|
-
secretAccessKey: process.env.STORM_BOT_SECRET_ACCESS_KEY || process.env.CLOUDFLARE_SECRET_ACCESS_KEY || process.env.AWS_SECRET_ACCESS_KEY || process.env.SECRET_ACCESS_KEY
|
|
106
|
-
},
|
|
107
|
-
requestHandler: _chunkKUGEZPUOjs.createHttpHandler.call(void 0, )
|
|
108
|
-
});
|
|
109
|
-
const version = _optionalChain([projectDetails, 'optionalAccess', _13 => _13.content, 'optionalAccess', _14 => _14.version]);
|
|
110
|
-
if (version) {
|
|
111
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0, `Starting upload version ${version}`);
|
|
112
|
-
}
|
|
113
|
-
const basePath = options.path;
|
|
114
|
-
const files = await _glob.glob.call(void 0, _chunkAWKQRM2Hjs.joinPaths.call(void 0, basePath, "**/*"), {
|
|
115
|
-
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
116
|
-
});
|
|
117
|
-
const internalDependencies = await _chunkCLCKX6UNjs.getInternalDependencies.call(void 0,
|
|
118
|
-
context.projectName,
|
|
119
|
-
projectGraph
|
|
120
|
-
);
|
|
121
|
-
const dependencies = internalDependencies.filter(
|
|
122
|
-
(projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")
|
|
123
|
-
).reduce((ret, dep) => {
|
|
124
|
-
if (!ret[dep.name]) {
|
|
125
|
-
ret[dep.name] = "latest";
|
|
126
|
-
}
|
|
127
|
-
return ret;
|
|
128
|
-
}, _nullishCoalesce(_optionalChain([projectDetails, 'optionalAccess', _15 => _15.content, 'access', _16 => _16.dependencies]), () => ( {})));
|
|
129
|
-
const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
|
|
130
|
-
if (options.clean === true) {
|
|
131
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0, `Clearing out existing items in ${bucketPath}`);
|
|
132
|
-
if (!isDryRun) {
|
|
133
|
-
const response = await client.send(
|
|
134
|
-
new (0, _clients3.ListObjectsCommand)({
|
|
135
|
-
Bucket: bucketId,
|
|
136
|
-
Prefix: !bucketPath || bucketPath === "/" ? void 0 : bucketPath
|
|
137
|
-
})
|
|
138
|
-
);
|
|
139
|
-
if (_optionalChain([response, 'optionalAccess', _17 => _17.Contents]) && response.Contents.length > 0) {
|
|
140
|
-
_chunkAWKQRM2Hjs.writeTrace.call(void 0,
|
|
141
|
-
`Deleting the following existing items from the R2 bucket path ${bucketPath}: ${response.Contents.map((item) => item.Key).join(", ")}`
|
|
142
|
-
);
|
|
143
|
-
await client.send(
|
|
144
|
-
new (0, _clients3.DeleteObjectsCommand)({
|
|
145
|
-
Bucket: bucketId,
|
|
146
|
-
Delete: {
|
|
147
|
-
Objects: response.Contents.map((item) => ({
|
|
148
|
-
Key: item.Key
|
|
149
|
-
})),
|
|
150
|
-
Quiet: false
|
|
151
|
-
}
|
|
152
|
-
})
|
|
153
|
-
);
|
|
154
|
-
} else {
|
|
155
|
-
_chunkAWKQRM2Hjs.writeDebug.call(void 0,
|
|
156
|
-
`No existing items to delete in the R2 bucket path ${bucketPath}`
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
_chunkAWKQRM2Hjs.writeWarning.call(void 0, "[Dry run]: Skipping R2 bucket clean.");
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (options.writeMetaJson === true) {
|
|
164
|
-
const meta = {
|
|
165
|
-
name: context.projectName,
|
|
166
|
-
version,
|
|
167
|
-
release,
|
|
168
|
-
description: _optionalChain([projectDetails, 'optionalAccess', _18 => _18.content, 'optionalAccess', _19 => _19.description]),
|
|
169
|
-
tags: _optionalChain([projectDetails, 'optionalAccess', _20 => _20.content, 'optionalAccess', _21 => _21.keywords]),
|
|
170
|
-
dependencies,
|
|
171
|
-
devDependencies: null,
|
|
172
|
-
internalDependencies: internalDependencies.filter(
|
|
173
|
-
(projectNode) => projectNode.data.tags && projectNode.data.tags.some(
|
|
174
|
-
(tag) => tag.toLowerCase() === "component"
|
|
175
|
-
)
|
|
176
|
-
).map((dep) => dep.name)
|
|
177
|
-
};
|
|
178
|
-
if (_optionalChain([projectDetails, 'optionalAccess', _22 => _22.type]) === "package.json") {
|
|
179
|
-
meta.devDependencies = _optionalChain([projectDetails, 'optionalAccess', _23 => _23.content, 'optionalAccess', _24 => _24.devDependencies]);
|
|
180
|
-
}
|
|
181
|
-
await _chunkCLCKX6UNjs.uploadFile.call(void 0,
|
|
182
|
-
client,
|
|
183
|
-
bucketId,
|
|
184
|
-
bucketPath,
|
|
185
|
-
"meta.json",
|
|
186
|
-
version,
|
|
187
|
-
JSON.stringify(meta),
|
|
188
|
-
"application/json",
|
|
189
|
-
isDryRun
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
await Promise.all(
|
|
193
|
-
files.map(async (file) => {
|
|
194
|
-
if (_optionalChain([_fs.statSync.call(void 0, file, {
|
|
195
|
-
throwIfNoEntry: false
|
|
196
|
-
}), 'optionalAccess', _25 => _25.isFile, 'call', _26 => _26()])) {
|
|
197
|
-
const name = _chunkAWKQRM2Hjs.correctPaths.call(void 0, file).replace(_chunkAWKQRM2Hjs.correctPaths.call(void 0, basePath), "");
|
|
198
|
-
const type = _mimetypes2.default.lookup(name) || "application/octet-stream";
|
|
199
|
-
await _chunkCLCKX6UNjs.uploadFile.call(void 0,
|
|
200
|
-
client,
|
|
201
|
-
bucketId,
|
|
202
|
-
bucketPath,
|
|
203
|
-
name,
|
|
204
|
-
version,
|
|
205
|
-
await _promises.readFile.call(void 0, file, _chunkCLCKX6UNjs.getEncoding.call(void 0, type)),
|
|
206
|
-
type,
|
|
207
|
-
isDryRun
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
);
|
|
212
|
-
_chunkAWKQRM2Hjs.writeSuccess.call(void 0,
|
|
213
|
-
`Successfully uploaded the ${projectName} project to the Cloudflare R2 bucket.`,
|
|
214
|
-
config
|
|
215
|
-
);
|
|
216
|
-
return {
|
|
217
|
-
success: true
|
|
218
|
-
};
|
|
219
|
-
} catch (error) {
|
|
220
|
-
console.error("Failed to publish to Cloudflare R2 bucket");
|
|
221
|
-
console.error(error);
|
|
222
|
-
console.log("");
|
|
223
|
-
return {
|
|
224
|
-
success: false
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
exports.runExecutor = runExecutor;
|