@storm-software/cloudflare-tools 0.70.49 → 0.71.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 +21 -0
- package/README.md +9 -2
- package/dist/chunk-7ESZB4KW.mjs +220 -0
- package/dist/{chunk-6KHWP2MO.js → chunk-BPUFICBM.js} +2 -2
- package/dist/{chunk-3JEOBMM5.mjs → chunk-C6B32MBV.mjs} +12 -8
- package/dist/{chunk-D4JUMEIC.js → chunk-DRYNN63F.js} +7 -6
- package/dist/{chunk-2B7ISOXH.mjs → chunk-J2DOKDIF.mjs} +8 -7
- package/dist/{chunk-UEJFDB6Y.mjs → chunk-QN6OKPMU.mjs} +1 -1
- package/dist/chunk-VHMJXOF4.js +220 -0
- package/dist/{chunk-YAUK66IM.js → chunk-W5IPHIXB.js} +11 -7
- package/dist/{chunk-BIFOD6C3.mjs → chunk-XDQBFBX4.mjs} +1 -1
- package/dist/{chunk-Y5VPR2KX.mjs → chunk-ZFJIFXOW.mjs} +4 -4
- package/dist/executors.d.mts +1 -1
- package/dist/executors.d.ts +1 -1
- package/dist/executors.js +2 -2
- package/dist/executors.mjs +4 -4
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.mjs +6 -6
- package/dist/schema.d-elsO8UQp.d.mts +88 -0
- package/dist/schema.d-elsO8UQp.d.ts +88 -0
- 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.d.mts +1 -1
- package/dist/src/executors/r2-upload-publish/executor.d.ts +1 -1
- package/dist/src/executors/r2-upload-publish/executor.js +2 -2
- package/dist/src/executors/r2-upload-publish/executor.mjs +2 -2
- package/dist/src/executors/r2-upload-publish/schema.d.ts +86 -7
- package/dist/src/executors/r2-upload-publish/schema.json +63 -22
- 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/utils/index.mjs +1 -1
- package/dist/src/utils/r2-bucket-helpers.mjs +1 -1
- package/dist/tsup.config.mjs +1 -1
- package/docs/api/executors/r2-upload-publish/schema.md +93 -0
- package/package.json +13 -12
- package/dist/chunk-IH7ZJRS7.js +0 -262
- package/dist/chunk-JEMQ2Y24.mjs +0 -265
- package/dist/chunk-KSZZYFCQ.js +0 -209
- package/dist/chunk-OTDPGPH4.js +0 -209
- package/dist/chunk-S3HIZ32I.mjs +0 -209
- package/dist/chunk-WBUCIAVK.mjs +0 -209
- package/dist/schema.d-oSirXiCO.d.mts +0 -11
- package/dist/schema.d-oSirXiCO.d.ts +0 -11
|
@@ -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 _chunkW5IPHIXBjs = require('../../../chunk-W5IPHIXB.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkNU34IEWNjs = require('../../../chunk-NU34IEWN.js');
|
|
@@ -55,7 +55,7 @@ async function* serveExecutor(options, context) {
|
|
|
55
55
|
success: true
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
var executor_default =
|
|
58
|
+
var executor_default = _chunkW5IPHIXBjs.withRunExecutor.call(void 0,
|
|
59
59
|
"Cloudflare Serve executor",
|
|
60
60
|
serveExecutor,
|
|
61
61
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withRunExecutor
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-C6B32MBV.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createCliOptions
|
|
6
6
|
} from "../../../chunk-PH3DHY4Q.mjs";
|
|
@@ -8,7 +8,7 @@ import "../../../chunk-PTTJW7MW.mjs";
|
|
|
8
8
|
import "../../../chunk-6MATO2MJ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
__require
|
|
11
|
-
} from "../../../chunk-
|
|
11
|
+
} from "../../../chunk-QN6OKPMU.mjs";
|
|
12
12
|
|
|
13
13
|
// src/executors/serve/executor.ts
|
|
14
14
|
import { createAsyncIterable } from "@nx/devkit/src/utils/async-iterable";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkDRYNN63Fjs = require('../../../chunk-DRYNN63F.js');
|
|
6
6
|
require('../../../chunk-MCKGQKYU.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = _chunkDRYNN63Fjs.generator_default; exports.initGenerator = _chunkDRYNN63Fjs.initGenerator; exports.initSchematic = _chunkDRYNN63Fjs.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-J2DOKDIF.mjs";
|
|
6
|
+
import "../../../chunk-QN6OKPMU.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 _chunkBPUFICBMjs = require('../../../chunk-BPUFICBM.js');
|
|
6
|
+
require('../../../chunk-DRYNN63F.js');
|
|
7
7
|
require('../../../chunk-EQXEFXCV.js');
|
|
8
8
|
require('../../../chunk-4BWM53AA.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 = _chunkBPUFICBMjs.applicationGenerator; exports.applicationSchematic = _chunkBPUFICBMjs.applicationSchematic; exports.default = _chunkBPUFICBMjs.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-ZFJIFXOW.mjs";
|
|
6
|
+
import "../../../chunk-J2DOKDIF.mjs";
|
|
7
7
|
import "../../../chunk-PTTJW7MW.mjs";
|
|
8
8
|
import "../../../chunk-6MATO2MJ.mjs";
|
|
9
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-QN6OKPMU.mjs";
|
|
10
10
|
export {
|
|
11
11
|
applicationGenerator,
|
|
12
12
|
applicationSchematic,
|
package/dist/src/utils/index.mjs
CHANGED
package/dist/tsup.config.mjs
CHANGED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
|
|
2
|
+
<!-- Generated by @storm-software/untyped -->
|
|
3
|
+
<!-- Do not edit this file directly -->
|
|
4
|
+
|
|
5
|
+
# R2 Upload Publish Executor
|
|
6
|
+
|
|
7
|
+
## `path`
|
|
8
|
+
- **Type**: `string`
|
|
9
|
+
|
|
10
|
+
> Upload Files path
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
The path to the files to upload
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## `registry`
|
|
17
|
+
- **Type**: `string`
|
|
18
|
+
|
|
19
|
+
> Registry
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
The registry URL to publish to
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## `bucketId`
|
|
26
|
+
- **Type**: `string`
|
|
27
|
+
|
|
28
|
+
> Bucket ID
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
The ID of the R2 bucket
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## `bucketPath`
|
|
35
|
+
- **Type**: `string`
|
|
36
|
+
- **Default**: `"/"`
|
|
37
|
+
|
|
38
|
+
> Bucket Path
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
The path in the R2 bucket to upload files to
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## `tag`
|
|
45
|
+
- **Type**: `string`
|
|
46
|
+
- **Default**: `"latest"`
|
|
47
|
+
|
|
48
|
+
> Tag
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
The tag to publish with
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## `writeMetaJson`
|
|
55
|
+
- **Type**: `boolean`
|
|
56
|
+
- **Default**: `false`
|
|
57
|
+
|
|
58
|
+
> Write Meta JSON
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
Write a `meta.json` file to the upload bucket
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## `clean`
|
|
65
|
+
- **Type**: `boolean`
|
|
66
|
+
- **Default**: `false`
|
|
67
|
+
|
|
68
|
+
> Clean
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Clean the bucket before uploading files
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## `verbose`
|
|
75
|
+
- **Type**: `boolean`
|
|
76
|
+
- **Default**: `false`
|
|
77
|
+
|
|
78
|
+
> Verbose
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
Enable verbose logging
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## `dryRun`
|
|
85
|
+
- **Type**: `boolean`
|
|
86
|
+
- **Default**: `false`
|
|
87
|
+
|
|
88
|
+
> Dry Run
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
Perform a dry run
|
|
92
|
+
|
|
93
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/cloudflare-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0",
|
|
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",
|
|
@@ -115,11 +115,11 @@
|
|
|
115
115
|
"peerDependencies": {
|
|
116
116
|
"@nx/devkit": "22.0.4",
|
|
117
117
|
"@nx/js": "22.0.4",
|
|
118
|
-
"@nx/node": "^22.1.
|
|
119
|
-
"@nx/web": "^22.1.
|
|
120
|
-
"@storm-software/config": "1.134.
|
|
121
|
-
"@storm-software/config-tools": "1.188.
|
|
122
|
-
"@storm-software/workspace-tools": "1.293.
|
|
118
|
+
"@nx/node": "^22.1.3",
|
|
119
|
+
"@nx/web": "^22.1.3",
|
|
120
|
+
"@storm-software/config": "1.134.50",
|
|
121
|
+
"@storm-software/config-tools": "1.188.50",
|
|
122
|
+
"@storm-software/workspace-tools": "1.293.20",
|
|
123
123
|
"nx": "22.0.4",
|
|
124
124
|
"tsup": "8.4.0",
|
|
125
125
|
"wrangler": ">=3.58.0"
|
|
@@ -135,20 +135,21 @@
|
|
|
135
135
|
"dependencies": {
|
|
136
136
|
"@aws-sdk/client-s3": "3.47.0",
|
|
137
137
|
"defu": "6.1.4",
|
|
138
|
-
"glob": "^11.1.0"
|
|
138
|
+
"glob": "^11.1.0",
|
|
139
|
+
"mime-types": "^3.0.2"
|
|
139
140
|
},
|
|
140
141
|
"devDependencies": {
|
|
141
142
|
"@nx/devkit": "22.0.4",
|
|
142
|
-
"@nx/node": "^22.1.
|
|
143
|
-
"@nx/web": "^22.1.
|
|
144
|
-
"@nx/webpack": "^22.1.
|
|
143
|
+
"@nx/node": "^22.1.3",
|
|
144
|
+
"@nx/web": "^22.1.3",
|
|
145
|
+
"@nx/webpack": "^22.1.3",
|
|
145
146
|
"nx": "22.0.4",
|
|
146
147
|
"tsup": "8.4.0",
|
|
147
148
|
"untyped": "^2.0.0",
|
|
148
|
-
"wrangler": "^4.
|
|
149
|
+
"wrangler": "^4.53.0"
|
|
149
150
|
},
|
|
150
151
|
"publishConfig": { "access": "public" },
|
|
151
152
|
"executors": "./executors.json",
|
|
152
153
|
"generators": "./generators.json",
|
|
153
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "d41f1248a2121aefd52ac185981cddc2d3d3bfbd"
|
|
154
155
|
}
|
package/dist/chunk-IH7ZJRS7.js
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
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 _chunkEQXEFXCVjs = require('./chunk-EQXEFXCV.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunk4BWM53AAjs = require('./chunk-4BWM53AA.js');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _chunkD4JUMEICjs = require('./chunk-D4JUMEIC.js');
|
|
16
|
-
|
|
17
|
-
// src/generators/worker/generator.ts
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _devkit = require('@nx/devkit');
|
|
30
|
-
var _projectnameandrootutils = require('@nx/devkit/src/generators/project-name-and-root-utils');
|
|
31
|
-
var _node = require('@nx/node');
|
|
32
|
-
var _versions = require('@nx/node/src/utils/versions');
|
|
33
|
-
var _path = require('path');
|
|
34
|
-
|
|
35
|
-
// src/generators/worker/libs/get-account-id.ts
|
|
36
|
-
function getAccountId(accountId) {
|
|
37
|
-
return `account_id = "${accountId}"`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/generators/worker/libs/vitest-imports.ts
|
|
41
|
-
var vitestImports = `import { describe, expect, it, beforeAll, afterAll } from 'vitest';`;
|
|
42
|
-
|
|
43
|
-
// src/generators/worker/libs/vitest-script.ts
|
|
44
|
-
var vitestScript = `"test": "vitest run"`;
|
|
45
|
-
|
|
46
|
-
// src/generators/worker/generator.ts
|
|
47
|
-
async function applicationGenerator(tree, schema) {
|
|
48
|
-
const stopwatch = _chunk4BWM53AAjs.getStopwatch.call(void 0, "Storm Worker generator");
|
|
49
|
-
let config;
|
|
50
|
-
try {
|
|
51
|
-
_chunk4BWM53AAjs.writeInfo.call(void 0, `\u26A1 Running the Storm Worker generator...
|
|
52
|
-
|
|
53
|
-
`, config);
|
|
54
|
-
const workspaceRoot = _chunkEQXEFXCVjs.findWorkspaceRoot.call(void 0, );
|
|
55
|
-
_chunk4BWM53AAjs.writeDebug.call(void 0,
|
|
56
|
-
`Loading the Storm Config from environment variables and storm.json file...
|
|
57
|
-
- workspaceRoot: ${workspaceRoot}`,
|
|
58
|
-
config
|
|
59
|
-
);
|
|
60
|
-
config = await _chunkEQXEFXCVjs.getConfig.call(void 0, workspaceRoot);
|
|
61
|
-
_chunk4BWM53AAjs.writeTrace.call(void 0,
|
|
62
|
-
`Loaded Storm config into env:
|
|
63
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`,
|
|
64
|
-
config
|
|
65
|
-
);
|
|
66
|
-
const options = await normalizeOptions(tree, schema, config);
|
|
67
|
-
const tasks = [];
|
|
68
|
-
tasks.push(
|
|
69
|
-
await _chunkD4JUMEICjs.generator_default.call(void 0, tree, {
|
|
70
|
-
...options,
|
|
71
|
-
skipFormat: true
|
|
72
|
-
})
|
|
73
|
-
);
|
|
74
|
-
tasks.push(
|
|
75
|
-
await _node.applicationGenerator.call(void 0, tree, {
|
|
76
|
-
...options,
|
|
77
|
-
framework: "none",
|
|
78
|
-
skipFormat: true,
|
|
79
|
-
unitTestRunner: options.unitTestRunner == "vitest" ? "none" : options.unitTestRunner,
|
|
80
|
-
e2eTestRunner: "none",
|
|
81
|
-
name: schema.name
|
|
82
|
-
})
|
|
83
|
-
);
|
|
84
|
-
if (options.unitTestRunner === "vitest") {
|
|
85
|
-
const { vitestGenerator, createOrEditViteConfig } = _devkit.ensurePackage.call(void 0,
|
|
86
|
-
"@nx/vite",
|
|
87
|
-
_versions.nxVersion
|
|
88
|
-
);
|
|
89
|
-
const vitestTask = await vitestGenerator(tree, {
|
|
90
|
-
project: options.name,
|
|
91
|
-
uiFramework: "none",
|
|
92
|
-
coverageProvider: "v8",
|
|
93
|
-
skipFormat: true,
|
|
94
|
-
testEnvironment: "node"
|
|
95
|
-
});
|
|
96
|
-
tasks.push(vitestTask);
|
|
97
|
-
createOrEditViteConfig(
|
|
98
|
-
tree,
|
|
99
|
-
{
|
|
100
|
-
project: options.name,
|
|
101
|
-
includeLib: false,
|
|
102
|
-
includeVitest: true,
|
|
103
|
-
testEnvironment: "node"
|
|
104
|
-
},
|
|
105
|
-
true
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
addCloudflareFiles(tree, options);
|
|
109
|
-
updateTsAppConfig(tree, options);
|
|
110
|
-
addTargets(tree, options);
|
|
111
|
-
if (options.unitTestRunner === "none") {
|
|
112
|
-
removeTestFiles(tree, options);
|
|
113
|
-
}
|
|
114
|
-
if (!options.skipFormat) {
|
|
115
|
-
await _devkit.formatFiles.call(void 0, tree);
|
|
116
|
-
}
|
|
117
|
-
if (options.template === "hono") {
|
|
118
|
-
tasks.push(() => {
|
|
119
|
-
const packageJsonPath = _devkit.joinPathFragments.call(void 0,
|
|
120
|
-
_nullishCoalesce(options.directory, () => ( "")),
|
|
121
|
-
"package.json"
|
|
122
|
-
);
|
|
123
|
-
if (tree.exists(packageJsonPath)) {
|
|
124
|
-
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => ({
|
|
125
|
-
...json,
|
|
126
|
-
dependencies: {
|
|
127
|
-
hono: "4.4.0",
|
|
128
|
-
..._optionalChain([json, 'optionalAccess', _ => _.dependencies])
|
|
129
|
-
}
|
|
130
|
-
}));
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
return _devkit.runTasksInSerial.call(void 0, ...tasks);
|
|
135
|
-
} catch (error) {
|
|
136
|
-
return () => {
|
|
137
|
-
_chunk4BWM53AAjs.writeFatal.call(void 0,
|
|
138
|
-
"A fatal error occurred while running the generator - the process was forced to terminate",
|
|
139
|
-
config
|
|
140
|
-
);
|
|
141
|
-
_chunk4BWM53AAjs.writeError.call(void 0,
|
|
142
|
-
`An exception was thrown in the generator's process
|
|
143
|
-
- Details: ${error.message}
|
|
144
|
-
- Stacktrace: ${error.stack}`,
|
|
145
|
-
config
|
|
146
|
-
);
|
|
147
|
-
};
|
|
148
|
-
} finally {
|
|
149
|
-
stopwatch();
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function updateTsAppConfig(tree, options) {
|
|
153
|
-
_devkit.updateJson.call(void 0, tree, _path.join.call(void 0, options.appProjectRoot, "tsconfig.app.json"), (json) => {
|
|
154
|
-
json.compilerOptions = {
|
|
155
|
-
...json.compilerOptions,
|
|
156
|
-
esModuleInterop: true,
|
|
157
|
-
target: "es2021",
|
|
158
|
-
lib: ["es2021"],
|
|
159
|
-
module: "es2022",
|
|
160
|
-
moduleResolution: "node",
|
|
161
|
-
resolveJsonModule: true,
|
|
162
|
-
allowJs: true,
|
|
163
|
-
checkJs: false,
|
|
164
|
-
noEmit: true,
|
|
165
|
-
isolatedModules: true,
|
|
166
|
-
allowSyntheticDefaultImports: true,
|
|
167
|
-
forceConsistentCasingInFileNames: true,
|
|
168
|
-
strict: true,
|
|
169
|
-
skipLibCheck: true
|
|
170
|
-
};
|
|
171
|
-
json.compilerOptions.types = [
|
|
172
|
-
...json.compilerOptions.types,
|
|
173
|
-
"@cloudflare/workers-types"
|
|
174
|
-
];
|
|
175
|
-
return json;
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
function addCloudflareFiles(tree, options) {
|
|
179
|
-
tree.delete(_path.join.call(void 0, options.appProjectRoot, "src/main.ts"));
|
|
180
|
-
_devkit.generateFiles.call(void 0,
|
|
181
|
-
tree,
|
|
182
|
-
_path.join.call(void 0, __dirname, "./files/common"),
|
|
183
|
-
options.appProjectRoot,
|
|
184
|
-
{
|
|
185
|
-
...options,
|
|
186
|
-
tmpl: "",
|
|
187
|
-
name: options.name,
|
|
188
|
-
accountId: options.accountId ? getAccountId(options.accountId) : "",
|
|
189
|
-
vitestScript: options.unitTestRunner === "vitest" ? vitestScript : ""
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
if (options.template && options.template !== "none") {
|
|
193
|
-
_devkit.generateFiles.call(void 0,
|
|
194
|
-
tree,
|
|
195
|
-
_path.join.call(void 0, __dirname, `./files/${options.template}`),
|
|
196
|
-
_path.join.call(void 0, options.appProjectRoot, "src"),
|
|
197
|
-
{
|
|
198
|
-
...options,
|
|
199
|
-
tmpl: "",
|
|
200
|
-
name: options.name,
|
|
201
|
-
accountId: options.accountId ? getAccountId(options.accountId) : "",
|
|
202
|
-
vitestScript: options.unitTestRunner === "vitest" ? vitestScript : "",
|
|
203
|
-
vitestImports: options.unitTestRunner === "vitest" ? vitestImports : ""
|
|
204
|
-
}
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function addTargets(tree, options) {
|
|
209
|
-
try {
|
|
210
|
-
const projectConfiguration = _devkit.readProjectConfiguration.call(void 0, tree, options.name);
|
|
211
|
-
projectConfiguration.targets = {
|
|
212
|
-
..._nullishCoalesce(projectConfiguration.targets, () => ( {})),
|
|
213
|
-
serve: {
|
|
214
|
-
executor: "@storm-software/cloudflare-tools:serve",
|
|
215
|
-
options: {
|
|
216
|
-
port: options.port
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
"nx-release-publish": {
|
|
220
|
-
executor: "@storm-software/cloudflare-tools:cloudflare-publish"
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
if (projectConfiguration.targets.build) {
|
|
224
|
-
delete projectConfiguration.targets.build;
|
|
225
|
-
}
|
|
226
|
-
_devkit.updateProjectConfiguration.call(void 0, tree, options.name, projectConfiguration);
|
|
227
|
-
} catch (e) {
|
|
228
|
-
console.error(e);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
function removeTestFiles(tree, options) {
|
|
232
|
-
tree.delete(_path.join.call(void 0, options.appProjectRoot, "src", "index.test.ts"));
|
|
233
|
-
}
|
|
234
|
-
async function normalizeOptions(host, options, config) {
|
|
235
|
-
const { projectName: appProjectName, projectRoot: appProjectRoot } = await _projectnameandrootutils.determineProjectNameAndRootOptions.call(void 0, host, {
|
|
236
|
-
name: options.name,
|
|
237
|
-
projectType: "application",
|
|
238
|
-
directory: options.directory,
|
|
239
|
-
rootProject: options.rootProject
|
|
240
|
-
});
|
|
241
|
-
options.rootProject = appProjectRoot === ".";
|
|
242
|
-
return {
|
|
243
|
-
addPlugin: process.env.NX_ADD_PLUGINS !== "false",
|
|
244
|
-
accountId: process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
|
|
245
|
-
...options,
|
|
246
|
-
name: _devkit.names.call(void 0, appProjectName).fileName,
|
|
247
|
-
frontendProject: options.frontendProject ? _devkit.names.call(void 0, options.frontendProject).fileName : void 0,
|
|
248
|
-
appProjectRoot,
|
|
249
|
-
unitTestRunner: _nullishCoalesce(options.unitTestRunner, () => ( "vitest")),
|
|
250
|
-
rootProject: _nullishCoalesce(options.rootProject, () => ( false)),
|
|
251
|
-
template: _nullishCoalesce(options.template, () => ( "fetch-handler")),
|
|
252
|
-
port: _nullishCoalesce(options.port, () => ( 3e3))
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
var generator_default2 = applicationGenerator;
|
|
256
|
-
var applicationSchematic = _devkit.convertNxGenerator.call(void 0, applicationGenerator);
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
exports.applicationGenerator = applicationGenerator; exports.generator_default = generator_default2; exports.applicationSchematic = applicationSchematic;
|