@storm-software/cloudflare-tools 0.57.1 → 0.58.1
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/.eslintrc.json +35 -0
- package/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/dist/{chunk-SF4QSCPW.js → chunk-3ICRM6QP.js} +1 -1
- package/dist/{chunk-5ESGZJB7.js → chunk-3S5XEPQW.js} +2 -2
- package/dist/{chunk-6BIJTX5I.mjs → chunk-7LADVNHW.mjs} +1 -1
- package/dist/{chunk-4WULYLQ3.js → chunk-N7K3NX22.js} +7 -0
- package/dist/{chunk-ZR5R4YIG.mjs → chunk-XP72FC65.mjs} +1 -1
- package/dist/{chunk-ABAI6EPS.mjs → chunk-XZQQVZ2X.mjs} +15 -8
- package/dist/executors.js +1 -1
- package/dist/executors.mjs +1 -1
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/dist/src/executors/cloudflare-publish/executor.js +1 -1
- package/dist/src/executors/cloudflare-publish/executor.mjs +1 -1
- package/dist/src/executors/serve/executor.js +2 -2
- package/dist/src/executors/serve/executor.mjs +1 -1
- 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 +3 -3
- package/dist/src/generators/worker/generator.mjs +2 -2
- package/executors.ts +4 -0
- package/generators.ts +4 -0
- package/index.ts +4 -0
- package/package.json +1 -1
- package/project.json +56 -0
- package/src/executors/cloudflare-publish/executor.ts +100 -0
- package/src/executors/r2-upload-publish/executor.ts +264 -0
- package/src/executors/serve/executor.ts +84 -0
- package/src/generators/init/generator.spec.ts +20 -0
- package/src/generators/init/generator.ts +60 -0
- package/src/generators/init/libs/versions.ts +7 -0
- package/src/generators/worker/generator.spec.ts +20 -0
- package/src/generators/worker/generator.ts +289 -0
- package/src/generators/worker/libs/get-account-id.ts +3 -0
- package/src/generators/worker/libs/vitest-imports.ts +1 -0
- package/src/generators/worker/libs/vitest-script.ts +1 -0
- package/src/plugins/index.ts +137 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/r2-bucket-helpers.ts +56 -0
- package/tsconfig.json +31 -0
- package/tsup.config.ts +27 -0
- /package/{dist/src → src}/executors/cloudflare-publish/schema.d.ts +0 -0
- /package/{dist/src → src}/executors/cloudflare-publish/schema.json +0 -0
- /package/{dist/src → src}/executors/r2-upload-publish/schema.d.ts +0 -0
- /package/{dist/src → src}/executors/r2-upload-publish/schema.json +0 -0
- /package/{dist/src → src}/executors/serve/schema.d.ts +0 -0
- /package/{dist/src → src}/executors/serve/schema.json +0 -0
- /package/{dist/src → src}/generators/init/schema.d.ts +0 -0
- /package/{dist/src → src}/generators/init/schema.json +0 -0
- /package/{dist/src → src}/generators/worker/files/common/package.json__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/files/common/wrangler.toml__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/files/fetch-handler/index.test.ts__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/files/fetch-handler/index.ts__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/files/hono/index.test.ts__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/files/hono/index.ts__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/files/scheduled-handler/index.test.ts__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/files/scheduled-handler/index.ts__tmpl__ +0 -0
- /package/{dist/src → src}/generators/worker/schema.d.ts +0 -0
- /package/{dist/src → src}/generators/worker/schema.json +0 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../../.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*"],
|
|
4
|
+
"overrides": [
|
|
5
|
+
{
|
|
6
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
+
"parserOptions": {
|
|
8
|
+
"project": ["packages/cloudflare-tools/tsconfig.*?.json"]
|
|
9
|
+
},
|
|
10
|
+
"rules": {}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"files": ["*.ts", "*.tsx"],
|
|
14
|
+
"rules": {}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"files": ["*.js", "*.jsx"],
|
|
18
|
+
"rules": {}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"files": ["*.json"],
|
|
22
|
+
"parser": "jsonc-eslint-parser",
|
|
23
|
+
"rules": {
|
|
24
|
+
"@nx/dependency-checks": "error"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"files": ["./package.json", "./executors.json", "./generators.json"],
|
|
29
|
+
"parser": "jsonc-eslint-parser",
|
|
30
|
+
"rules": {
|
|
31
|
+
"@nx/nx-plugin-checks": "error"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Cloudflare Tools
|
|
4
4
|
|
|
5
|
+
## [0.58.1](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.58.1) (2025-05-06)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **workspace-tools:** Resolve issue with missing dependencies
|
|
10
|
+
([e4fcafde0](https://github.com/storm-software/storm-ops/commit/e4fcafde0))
|
|
11
|
+
|
|
12
|
+
### Miscellaneous
|
|
13
|
+
|
|
14
|
+
- **monorepo:** Regenerate README markdown files
|
|
15
|
+
([6eabb3ff1](https://github.com/storm-software/storm-ops/commit/6eabb3ff1))
|
|
16
|
+
|
|
17
|
+
## [0.58.0](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.58.0) (2025-05-06)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- **workspace-tools:** Update the publish executor source code
|
|
22
|
+
([527dcfe84](https://github.com/storm-software/storm-ops/commit/527dcfe84))
|
|
23
|
+
|
|
24
|
+
### Miscellaneous
|
|
25
|
+
|
|
26
|
+
- **monorepo:** Regenerate README markdown files
|
|
27
|
+
([d58a4014e](https://github.com/storm-software/storm-ops/commit/d58a4014e))
|
|
28
|
+
|
|
29
|
+
## [0.57.2](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.57.2) (2025-05-05)
|
|
30
|
+
|
|
31
|
+
### Miscellaneous
|
|
32
|
+
|
|
33
|
+
- **workspace-tools:** Skip git checks during publish
|
|
34
|
+
([7fdcbfc9a](https://github.com/storm-software/storm-ops/commit/7fdcbfc9a))
|
|
35
|
+
- **monorepo:** Regenerate README markdown files
|
|
36
|
+
([fb8ab0609](https://github.com/storm-software/storm-ops/commit/fb8ab0609))
|
|
37
|
+
|
|
5
38
|
## [0.57.1](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.57.1) (2025-05-05)
|
|
6
39
|
|
|
7
40
|
### Miscellaneous
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -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.
|
|
10
|
+
version: "0.58.0",
|
|
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",
|
|
@@ -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 _chunk3ICRM6QPjs = require('./chunk-3ICRM6QP.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkHBASMEU5js = require('./chunk-HBASMEU5.js');
|
|
@@ -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 _chunk3ICRM6QPjs.generator_default.call(void 0, tree, {
|
|
70
70
|
...options,
|
|
71
71
|
skipFormat: true
|
|
72
72
|
})
|
|
@@ -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.
|
|
10
|
+
version: "0.58.0",
|
|
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",
|
|
@@ -1250,6 +1250,13 @@ var executor_default6 = withRunExecutor(
|
|
|
1250
1250
|
|
|
1251
1251
|
|
|
1252
1252
|
|
|
1253
|
+
|
|
1254
|
+
var _columnify = require('columnify'); var columnify = _interopRequireWildcard(_columnify);
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
var _npmrunpath = require('npm-run-path');
|
|
1259
|
+
|
|
1253
1260
|
// ../workspace-tools/src/utils/pnpm-deps-update.ts
|
|
1254
1261
|
|
|
1255
1262
|
|
|
@@ -1248,8 +1248,15 @@ var executor_default6 = withRunExecutor(
|
|
|
1248
1248
|
);
|
|
1249
1249
|
|
|
1250
1250
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
1251
|
-
import {
|
|
1252
|
-
|
|
1251
|
+
import {
|
|
1252
|
+
detectPackageManager,
|
|
1253
|
+
readJsonFile
|
|
1254
|
+
} from "@nx/devkit";
|
|
1255
|
+
import * as columnify from "columnify";
|
|
1256
|
+
import { exec, execSync as execSync3 } from "node:child_process";
|
|
1257
|
+
import { existsSync as existsSync6 } from "node:fs";
|
|
1258
|
+
import { relative as relative3 } from "node:path";
|
|
1259
|
+
import { env as appendLocalEnv } from "npm-run-path";
|
|
1253
1260
|
|
|
1254
1261
|
// ../workspace-tools/src/utils/pnpm-deps-update.ts
|
|
1255
1262
|
import { existsSync as existsSync5 } from "node:fs";
|
|
@@ -2536,8 +2543,8 @@ var DEFAULT_COMMIT_QUESTIONS = {
|
|
|
2536
2543
|
};
|
|
2537
2544
|
|
|
2538
2545
|
// ../workspace-tools/src/generators/release-version/generator.ts
|
|
2539
|
-
import { exec, execSync as execSync4 } from "node:child_process";
|
|
2540
|
-
import { relative as
|
|
2546
|
+
import { exec as exec2, execSync as execSync4 } from "node:child_process";
|
|
2547
|
+
import { relative as relative4 } from "node:path";
|
|
2541
2548
|
import { IMPLICIT_DEFAULT_RELEASE_GROUP } from "nx/src/command-line/release/config/config";
|
|
2542
2549
|
import {
|
|
2543
2550
|
getFirstGitCommit,
|
|
@@ -2925,10 +2932,10 @@ import { retrieveProjectConfigurationsWithoutPluginInference } from "nx/src/proj
|
|
|
2925
2932
|
// ../workspace-tools/src/utils/lock-file.ts
|
|
2926
2933
|
import {
|
|
2927
2934
|
output as output2,
|
|
2928
|
-
readJsonFile,
|
|
2935
|
+
readJsonFile as readJsonFile2,
|
|
2929
2936
|
workspaceRoot as workspaceRoot2
|
|
2930
2937
|
} from "@nx/devkit";
|
|
2931
|
-
import { existsSync as
|
|
2938
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
2932
2939
|
import { join as join2 } from "node:path";
|
|
2933
2940
|
import {
|
|
2934
2941
|
getNpmLockfileDependencies,
|
|
@@ -2950,9 +2957,9 @@ var NPM_LOCK_PATH = join2(workspaceRoot2, NPM_LOCK_FILE);
|
|
|
2950
2957
|
var PNPM_LOCK_PATH = join2(workspaceRoot2, PNPM_LOCK_FILE);
|
|
2951
2958
|
|
|
2952
2959
|
// ../workspace-tools/src/utils/plugin-helpers.ts
|
|
2953
|
-
import { readJsonFile as
|
|
2960
|
+
import { readJsonFile as readJsonFile3 } from "@nx/devkit";
|
|
2954
2961
|
import defu4 from "defu";
|
|
2955
|
-
import { existsSync as
|
|
2962
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
2956
2963
|
import { dirname, join as join3 } from "node:path";
|
|
2957
2964
|
|
|
2958
2965
|
// ../workspace-tools/src/utils/typia-transform.ts
|
package/dist/executors.js
CHANGED
package/dist/executors.mjs
CHANGED
package/dist/generators.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk3S5XEPQWjs = require('./chunk-3S5XEPQW.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk3ICRM6QPjs = require('./chunk-3ICRM6QP.js');
|
|
10
10
|
require('./chunk-HBASMEU5.js');
|
|
11
11
|
require('./chunk-PZ5CI56F.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 = _chunk3S5XEPQWjs.applicationGenerator; exports.applicationSchematic = _chunk3S5XEPQWjs.applicationSchematic; exports.initGenerator = _chunk3ICRM6QPjs.initGenerator; exports.initSchematic = _chunk3ICRM6QPjs.initSchematic;
|
package/dist/generators.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
applicationGenerator,
|
|
4
4
|
applicationSchematic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XP72FC65.mjs";
|
|
6
6
|
import {
|
|
7
7
|
initGenerator,
|
|
8
8
|
initSchematic
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7LADVNHW.mjs";
|
|
10
10
|
import "./chunk-GPAI4NHQ.mjs";
|
|
11
11
|
import "./chunk-MV24QW26.mjs";
|
|
12
12
|
import "./chunk-QQ22YQSB.mjs";
|
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ require('./chunk-DHBG5ASJ.js');
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk3S5XEPQWjs = require('./chunk-3S5XEPQW.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk3ICRM6QPjs = require('./chunk-3ICRM6QP.js');
|
|
11
11
|
require('./chunk-CVGPWUNP.js');
|
|
12
12
|
require('./chunk-I4P7DVDN.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-N7K3NX22.js');
|
|
14
14
|
require('./chunk-HIUZ6UL7.js');
|
|
15
15
|
|
|
16
16
|
|
|
@@ -140,4 +140,4 @@ function createPackageJson(projectJsonPath, workspaceRoot) {
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
|
|
143
|
-
exports.applicationGenerator =
|
|
143
|
+
exports.applicationGenerator = _chunk3S5XEPQWjs.applicationGenerator; exports.applicationSchematic = _chunk3S5XEPQWjs.applicationSchematic; exports.createNodes = createNodes; exports.getInternalDependencies = _chunkRIUVF72Kjs.getInternalDependencies; exports.initGenerator = _chunk3ICRM6QPjs.initGenerator; exports.initSchematic = _chunk3ICRM6QPjs.initSchematic; exports.name = name; exports.r2UploadFile = _chunkRIUVF72Kjs.r2UploadFile;
|
package/dist/index.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
3
3
|
import {
|
|
4
4
|
applicationGenerator,
|
|
5
5
|
applicationSchematic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XP72FC65.mjs";
|
|
7
7
|
import {
|
|
8
8
|
initGenerator,
|
|
9
9
|
initSchematic
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7LADVNHW.mjs";
|
|
11
11
|
import "./chunk-7Z5PILRU.mjs";
|
|
12
12
|
import "./chunk-QPABB45G.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-XZQQVZ2X.mjs";
|
|
14
14
|
import "./chunk-ISGKIYF5.mjs";
|
|
15
15
|
import {
|
|
16
16
|
getInternalDependencies,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
var _chunkI4P7DVDNjs = require('../../../chunk-I4P7DVDN.js');
|
|
4
|
-
require('../../../chunk-
|
|
4
|
+
require('../../../chunk-N7K3NX22.js');
|
|
5
5
|
require('../../../chunk-6XDOBG77.js');
|
|
6
6
|
require('../../../chunk-HBASMEU5.js');
|
|
7
7
|
require('../../../chunk-PZ5CI56F.js');
|
|
@@ -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 _chunkN7K3NX22js = require('../../../chunk-N7K3NX22.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk6XDOBG77js = require('../../../chunk-6XDOBG77.js');
|
|
@@ -55,7 +55,7 @@ async function* serveExecutor(options, context, config) {
|
|
|
55
55
|
success: true
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
var executor_default =
|
|
58
|
+
var executor_default = _chunkN7K3NX22js.withRunExecutor.call(void 0,
|
|
59
59
|
"Cloudflare Serve executor",
|
|
60
60
|
serveExecutor,
|
|
61
61
|
{
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk3ICRM6QPjs = require('../../../chunk-3ICRM6QP.js');
|
|
6
6
|
require('../../../chunk-MCKGQKYU.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = _chunk3ICRM6QPjs.generator_default; exports.initGenerator = _chunk3ICRM6QPjs.initGenerator; exports.initSchematic = _chunk3ICRM6QPjs.initSchematic;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../../chunk-
|
|
5
|
+
var _chunk3S5XEPQWjs = require('../../../chunk-3S5XEPQW.js');
|
|
6
|
+
require('../../../chunk-3ICRM6QP.js');
|
|
7
7
|
require('../../../chunk-HBASMEU5.js');
|
|
8
8
|
require('../../../chunk-PZ5CI56F.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 = _chunk3S5XEPQWjs.applicationGenerator; exports.applicationSchematic = _chunk3S5XEPQWjs.applicationSchematic; exports.default = _chunk3S5XEPQWjs.generator_default;
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
applicationGenerator,
|
|
3
3
|
applicationSchematic,
|
|
4
4
|
generator_default
|
|
5
|
-
} from "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
5
|
+
} from "../../../chunk-XP72FC65.mjs";
|
|
6
|
+
import "../../../chunk-7LADVNHW.mjs";
|
|
7
7
|
import "../../../chunk-GPAI4NHQ.mjs";
|
|
8
8
|
import "../../../chunk-MV24QW26.mjs";
|
|
9
9
|
import "../../../chunk-QQ22YQSB.mjs";
|
package/executors.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from "./src/executors/cloudflare-publish/executor";
|
|
2
|
+
export { type CloudflarePublishExecutorSchema } from "./src/executors/cloudflare-publish/schema.d";
|
|
3
|
+
export * from "./src/executors/r2-upload-publish/executor";
|
|
4
|
+
export { type R2UploadPublishExecutorSchema } from "./src/executors/r2-upload-publish/schema.d";
|
package/generators.ts
ADDED
package/index.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/cloudflare-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.1",
|
|
4
4
|
"description": "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "github",
|
package/project.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cloudflare-tools",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/cloudflare-tools/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"targets": {
|
|
7
|
+
"build-untyped": {
|
|
8
|
+
"executor": "nx:run-commands",
|
|
9
|
+
"dependsOn": ["clean", "^build"],
|
|
10
|
+
"inputs": [
|
|
11
|
+
"{projectRoot}/src/**/untyped.ts",
|
|
12
|
+
"{projectRoot}/src/**/*.untyped.ts"
|
|
13
|
+
],
|
|
14
|
+
"outputs": [
|
|
15
|
+
"{projectRoot}/src/**/schema.d.ts",
|
|
16
|
+
"{projectRoot}/src/**/*.schema.d.ts",
|
|
17
|
+
"{projectRoot}/src/**/schema.md",
|
|
18
|
+
"{projectRoot}/src/**/*.schema.md",
|
|
19
|
+
"{projectRoot}/src/**/schema.json",
|
|
20
|
+
"{projectRoot}/src/**/*.schema.json"
|
|
21
|
+
],
|
|
22
|
+
"options": {
|
|
23
|
+
"commands": [
|
|
24
|
+
"node dist/packages/untyped/bin/untyped.cjs generate --entry=\"packages/cloudflare-tools/**/{untyped.ts,*.untyped.ts}\" "
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"build-base": {
|
|
29
|
+
"executor": "nx:run-commands",
|
|
30
|
+
"dependsOn": ["build-untyped", "clean", "^build"],
|
|
31
|
+
"options": {
|
|
32
|
+
"command": "tsup-node --config=tsup.config.ts",
|
|
33
|
+
"cwd": "{projectRoot}"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"build": {
|
|
37
|
+
"executor": "nx:run-commands",
|
|
38
|
+
"dependsOn": ["build-base", "build-untyped"],
|
|
39
|
+
"options": {
|
|
40
|
+
"commands": [
|
|
41
|
+
"pnpm copyfiles LICENSE dist/packages/cloudflare-tools",
|
|
42
|
+
"pnpm copyfiles --up=2 ./packages/cloudflare-tools/*.md ./packages/cloudflare-tools/executors.json ./packages/cloudflare-tools/generators.json ./packages/cloudflare-tools/package.json dist/packages/cloudflare-tools",
|
|
43
|
+
"pnpm copyfiles --up=3 \"./packages/cloudflare-tools/dist/**/*\" dist/packages/cloudflare-tools/dist",
|
|
44
|
+
"pnpm copyfiles --up=3 \"./packages/cloudflare-tools/src/**/*schema.d.ts\" dist/packages/cloudflare-tools/dist/src",
|
|
45
|
+
"pnpm copyfiles --up=3 \"./packages/cloudflare-tools/src/**/*schema.json\" dist/packages/cloudflare-tools/dist/src",
|
|
46
|
+
"pnpm copyfiles --up=3 \"./packages/cloudflare-tools/src/**/*.md\" dist/packages/cloudflare-tools/docs/api",
|
|
47
|
+
"pnpm copyfiles --up=4 \"./packages/cloudflare-tools/src/generators/*/files/**/*\" dist/packages/cloudflare-tools/dist/src/generators"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"nx-release-publish": {
|
|
52
|
+
"executor": "@storm-software/workspace-tools:npm-publish"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"implicitDependencies": ["workspace-tools", "config-tools", "config"]
|
|
56
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { joinPathFragments, type ExecutorContext } from "@nx/devkit";
|
|
2
|
+
import { createCliOptions } from "@storm-software/workspace-tools";
|
|
3
|
+
import { fork } from "node:child_process";
|
|
4
|
+
import type { CloudflarePublishExecutorSchema } from "./schema";
|
|
5
|
+
|
|
6
|
+
export default async function runExecutor(
|
|
7
|
+
options: CloudflarePublishExecutorSchema,
|
|
8
|
+
context: ExecutorContext,
|
|
9
|
+
) {
|
|
10
|
+
/**
|
|
11
|
+
* We need to check both the env var and the option because the executor may have been triggered
|
|
12
|
+
* indirectly via dependsOn, in which case the env var will be set, but the option will not.
|
|
13
|
+
*/
|
|
14
|
+
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
15
|
+
|
|
16
|
+
if (!context.projectName) {
|
|
17
|
+
throw new Error("The executor requires a projectName.");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
console.info(
|
|
21
|
+
`🚀 Running Storm Cloudflare Publish executor on the ${context.projectName} worker`,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (
|
|
25
|
+
!context.projectName ||
|
|
26
|
+
!context.projectsConfigurations?.projects ||
|
|
27
|
+
!context.projectsConfigurations.projects[context.projectName] ||
|
|
28
|
+
!context.projectsConfigurations.projects[context.projectName]?.root
|
|
29
|
+
) {
|
|
30
|
+
throw new Error("The executor requires projectsConfigurations.");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const packageRoot = joinPathFragments(
|
|
34
|
+
context.root,
|
|
35
|
+
context.projectsConfigurations.projects[context.projectName]
|
|
36
|
+
?.root as string,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
const args = createCliOptions({ ...options });
|
|
41
|
+
if (isDryRun) {
|
|
42
|
+
args.push("--dry-run");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.log("");
|
|
46
|
+
console.log(`Running "wrangler deploy ${args.join(" ")}"...`);
|
|
47
|
+
console.log("");
|
|
48
|
+
|
|
49
|
+
let proc;
|
|
50
|
+
try {
|
|
51
|
+
fork(require.resolve("wrangler/bin/wrangler"), ["deploy", ...args], {
|
|
52
|
+
env: {
|
|
53
|
+
CLOUDFLARE_ACCOUNT_ID: process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
|
|
54
|
+
CLOUDFLARE_API_TOKEN: process.env.STORM_BOT_CLOUDFLARE_TOKEN,
|
|
55
|
+
WRANGLER_LOG: "debug",
|
|
56
|
+
...process.env,
|
|
57
|
+
FORCE_COLOR: "true",
|
|
58
|
+
},
|
|
59
|
+
cwd: packageRoot,
|
|
60
|
+
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
61
|
+
});
|
|
62
|
+
} catch (e) {
|
|
63
|
+
console.error(e);
|
|
64
|
+
throw new Error(
|
|
65
|
+
"Unable to run Wrangler. Please ensure Wrangler is installed.",
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
proc?.stdout?.on("data", (message) => {
|
|
70
|
+
process.stdout.write(message);
|
|
71
|
+
});
|
|
72
|
+
proc?.stderr?.on("data", (message) => {
|
|
73
|
+
process.stderr.write(message);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return new Promise<{ success: boolean }>((resolve) => {
|
|
77
|
+
proc?.on("close", (code) => {
|
|
78
|
+
console.log("");
|
|
79
|
+
|
|
80
|
+
if (isDryRun) {
|
|
81
|
+
console.log(
|
|
82
|
+
"Would publish to Cloudflare Workers Registry, but [dry-run] was set",
|
|
83
|
+
);
|
|
84
|
+
} else {
|
|
85
|
+
console.log("Published to Cloudflare Workers Registry");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return resolve({ success: code === 0 });
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
} catch (error: any) {
|
|
92
|
+
console.error("Failed to publish to Cloudflare Workers Registry");
|
|
93
|
+
console.error(error);
|
|
94
|
+
console.log("");
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
success: false,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|