@storm-software/cloudflare-tools 0.48.0 → 0.49.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/chunk-3J7KBHMJ.mjs +0 -0
  3. package/dist/chunk-7Z5PILRU.mjs +0 -0
  4. package/dist/chunk-A7FFSBE6.mjs +26 -0
  5. package/dist/chunk-CR22PACK.mjs +239 -0
  6. package/dist/chunk-CVGPWUNP.js +1 -0
  7. package/dist/chunk-DHBG5ASJ.js +1 -0
  8. package/dist/chunk-ITLKTOIK.mjs +4042 -0
  9. package/dist/chunk-J5SB6L2L.js +18 -0
  10. package/dist/chunk-JCB2DTP6.js +42 -0
  11. package/dist/chunk-NKCR3FSU.js +153 -0
  12. package/dist/chunk-NPJPHEFP.js +239 -0
  13. package/dist/chunk-NSLK6ZDO.mjs +603 -0
  14. package/dist/chunk-OARYMVO7.mjs +501 -0
  15. package/dist/chunk-QEWY5YJA.mjs +89 -0
  16. package/dist/chunk-R7AIVBS7.js +89 -0
  17. package/dist/chunk-RCE3CC76.js +603 -0
  18. package/dist/chunk-VPT6GF3S.mjs +153 -0
  19. package/dist/chunk-VTHBMY4B.js +133 -0
  20. package/dist/chunk-VYOULWAK.mjs +42 -0
  21. package/dist/chunk-W5J5EWQN.js +227 -0
  22. package/dist/chunk-WGOT27OY.js +4041 -0
  23. package/dist/chunk-XO66D74Z.js +1 -0
  24. package/dist/chunk-XU6MTFCV.mjs +133 -0
  25. package/dist/chunk-YE4FHRXJ.js +501 -0
  26. package/dist/chunk-YSCEY447.mjs +0 -0
  27. package/dist/chunk-ZY7TM2TA.mjs +228 -0
  28. package/dist/executors.d.mts +2 -0
  29. package/dist/executors.d.ts +2 -0
  30. package/dist/executors.js +9 -0
  31. package/dist/executors.mjs +9 -0
  32. package/dist/generator-DJ1RuHyR.d.mts +14 -0
  33. package/dist/generator-DJ1RuHyR.d.ts +14 -0
  34. package/dist/generator-DW-9W9Fk.d.mts +22 -0
  35. package/dist/generator-DW-9W9Fk.d.ts +22 -0
  36. package/dist/generators.d.mts +4 -0
  37. package/dist/generators.d.ts +4 -0
  38. package/dist/generators.js +18 -0
  39. package/dist/generators.mjs +18 -0
  40. package/dist/index.d.mts +45 -0
  41. package/dist/index.d.ts +45 -0
  42. package/dist/index.js +151 -0
  43. package/dist/index.mjs +151 -0
  44. package/dist/schema.d-DgA16PUG.d.mts +24 -0
  45. package/dist/schema.d-DgA16PUG.d.ts +24 -0
  46. package/dist/schema.d-oSirXiCO.d.mts +11 -0
  47. package/dist/schema.d-oSirXiCO.d.ts +11 -0
  48. package/dist/src/executors/cloudflare-publish/executor.d.mts +8 -0
  49. package/dist/src/executors/cloudflare-publish/executor.d.ts +8 -0
  50. package/dist/src/executors/cloudflare-publish/executor.js +11 -0
  51. package/dist/src/executors/cloudflare-publish/executor.mjs +11 -0
  52. package/dist/src/executors/r2-upload-publish/executor.d.mts +8 -0
  53. package/dist/src/executors/r2-upload-publish/executor.d.ts +8 -0
  54. package/dist/src/executors/r2-upload-publish/executor.js +11 -0
  55. package/dist/src/executors/r2-upload-publish/executor.mjs +11 -0
  56. package/dist/src/executors/serve/executor.d.mts +1240 -0
  57. package/dist/src/executors/serve/executor.d.ts +1240 -0
  58. package/dist/src/executors/serve/executor.js +75 -0
  59. package/dist/src/executors/serve/executor.mjs +75 -0
  60. package/dist/src/executors/serve/schema.d.ts +1 -1
  61. package/dist/src/generators/init/generator.d.mts +2 -0
  62. package/dist/src/generators/init/generator.d.ts +2 -0
  63. package/dist/src/generators/init/generator.js +11 -0
  64. package/dist/src/generators/init/generator.mjs +11 -0
  65. package/dist/src/generators/worker/generator.d.mts +3 -0
  66. package/dist/src/generators/worker/generator.d.ts +3 -0
  67. package/dist/src/generators/worker/generator.js +14 -0
  68. package/dist/src/generators/worker/generator.mjs +14 -0
  69. package/dist/src/utils/index.d.mts +3 -0
  70. package/dist/src/utils/index.d.ts +3 -0
  71. package/dist/src/utils/index.js +11 -0
  72. package/dist/src/utils/index.mjs +11 -0
  73. package/dist/src/utils/r2-bucket-helpers.d.mts +7 -0
  74. package/dist/src/utils/r2-bucket-helpers.d.ts +7 -0
  75. package/dist/src/utils/r2-bucket-helpers.js +10 -0
  76. package/dist/src/utils/r2-bucket-helpers.mjs +10 -0
  77. package/dist/tsup.config.d.mts +5 -0
  78. package/dist/tsup.config.d.ts +5 -0
  79. package/dist/tsup.config.js +35 -0
  80. package/dist/tsup.config.mjs +35 -0
  81. package/package.json +1 -1
package/dist/index.mjs ADDED
@@ -0,0 +1,151 @@
1
+ import "./chunk-YSCEY447.mjs";
2
+ import "./chunk-3J7KBHMJ.mjs";
3
+ import {
4
+ applicationGenerator,
5
+ applicationSchematic
6
+ } from "./chunk-ZY7TM2TA.mjs";
7
+ import {
8
+ initGenerator,
9
+ initSchematic
10
+ } from "./chunk-CR22PACK.mjs";
11
+ import "./chunk-7Z5PILRU.mjs";
12
+ import "./chunk-VPT6GF3S.mjs";
13
+ import {
14
+ getInternalDependencies,
15
+ r2UploadFile
16
+ } from "./chunk-VYOULWAK.mjs";
17
+ import "./chunk-QEWY5YJA.mjs";
18
+ import "./chunk-ITLKTOIK.mjs";
19
+ import {
20
+ ProjectTagConstants,
21
+ addProjectTag
22
+ } from "./chunk-XU6MTFCV.mjs";
23
+ import "./chunk-OARYMVO7.mjs";
24
+ import "./chunk-NSLK6ZDO.mjs";
25
+ import {
26
+ __name
27
+ } from "./chunk-A7FFSBE6.mjs";
28
+
29
+ // src/plugins/index.ts
30
+ import { existsSync } from "node:fs";
31
+ import { dirname, join } from "node:path";
32
+ import { readNxJson } from "nx/src/config/nx-json.js";
33
+ import { readJsonFile } from "nx/src/utils/fileutils";
34
+ import { readTargetsFromPackageJson } from "nx/src/utils/package-json";
35
+ var name = "storm-software/cloudflare";
36
+ var createNodes = [
37
+ "{**/wrangler.toml}",
38
+ (file, _, ctx) => {
39
+ const packageJson = createPackageJson(file, ctx.workspaceRoot);
40
+ if (!packageJson) {
41
+ return {};
42
+ }
43
+ const project = createProjectFromPackageJsonNextToProjectJson(file, packageJson);
44
+ const nxJson = readNxJson(ctx.workspaceRoot);
45
+ const targets = readTargetsFromPackageJson(packageJson, nxJson);
46
+ targets["serve"] = {
47
+ cache: false,
48
+ inputs: [
49
+ "typescript",
50
+ "^production"
51
+ ],
52
+ dependsOn: [
53
+ "build"
54
+ ],
55
+ executor: "@storm-software/cloudflare-tools:serve",
56
+ options: {
57
+ port: 4500
58
+ }
59
+ };
60
+ targets["clean-package"] = {
61
+ cache: true,
62
+ dependsOn: [
63
+ "build"
64
+ ],
65
+ inputs: [
66
+ "typescript",
67
+ "^production"
68
+ ],
69
+ outputs: [
70
+ "{workspaceRoot}/dist/{projectRoot}"
71
+ ],
72
+ executor: "@storm-software/workspace-tools:clean-package",
73
+ options: {
74
+ cleanReadMe: true,
75
+ cleanComments: true
76
+ }
77
+ };
78
+ targets["nx-release-publish"] = {
79
+ cache: false,
80
+ inputs: [
81
+ "typescript",
82
+ "^production"
83
+ ],
84
+ dependsOn: [
85
+ "clean-package",
86
+ "^nx-release-publish"
87
+ ],
88
+ executor: "@storm-software/cloudflare-tools:cloudflare-publish",
89
+ options: {}
90
+ };
91
+ addProjectTag(project, ProjectTagConstants.ProjectType.TAG_ID, project.projectType === "application" ? ProjectTagConstants.ProjectType.APPLICATION : ProjectTagConstants.ProjectType.LIBRARY, {
92
+ overwrite: true
93
+ });
94
+ addProjectTag(project, ProjectTagConstants.DistStyle.TAG_ID, ProjectTagConstants.DistStyle.CLEAN, {
95
+ overwrite: true
96
+ });
97
+ addProjectTag(project, ProjectTagConstants.Provider.TAG_ID, "cloudflare", {
98
+ overwrite: true
99
+ });
100
+ return project?.name ? {
101
+ projects: {
102
+ [project.name]: {
103
+ ...project,
104
+ targets,
105
+ release: {
106
+ ...project?.release,
107
+ version: {
108
+ ...project?.release?.version,
109
+ generator: "@storm-software/workspace-tools:release-version"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ } : {};
115
+ }
116
+ ];
117
+ function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, packageJson) {
118
+ const { nx, name: name2 } = packageJson;
119
+ const root = dirname(projectJsonPath);
120
+ return {
121
+ ...nx,
122
+ name: name2,
123
+ root,
124
+ targets: {}
125
+ };
126
+ }
127
+ __name(createProjectFromPackageJsonNextToProjectJson, "createProjectFromPackageJsonNextToProjectJson");
128
+ function createPackageJson(projectJsonPath, workspaceRoot) {
129
+ try {
130
+ const root = dirname(projectJsonPath);
131
+ const packageJsonPath = join(workspaceRoot, root, "package.json");
132
+ if (!existsSync(packageJsonPath)) {
133
+ return null;
134
+ }
135
+ return readJsonFile(packageJsonPath);
136
+ } catch (e) {
137
+ console.log(e);
138
+ return null;
139
+ }
140
+ }
141
+ __name(createPackageJson, "createPackageJson");
142
+ export {
143
+ applicationGenerator,
144
+ applicationSchematic,
145
+ createNodes,
146
+ getInternalDependencies,
147
+ initGenerator,
148
+ initSchematic,
149
+ name,
150
+ r2UploadFile
151
+ };
@@ -0,0 +1,24 @@
1
+ interface CloudflarePublishExecutorSchema {
2
+ name: string;
3
+ noBundle: boolean;
4
+ env: string;
5
+ outdir: string;
6
+ compatibilityDate: string;
7
+ compatibilityFlags: string[];
8
+ latest: boolean;
9
+ assets: string;
10
+ site: string;
11
+ siteInclude: string[];
12
+ siteExclude: string[];
13
+ var: string[];
14
+ define: string[];
15
+ triggers: string[];
16
+ routes: string[];
17
+ tsConfig: string;
18
+ minify: boolean;
19
+ nodeCompat: boolean;
20
+ dryRun: boolean;
21
+ keepVars: boolean;
22
+ }
23
+
24
+ export type { CloudflarePublishExecutorSchema as C };
@@ -0,0 +1,24 @@
1
+ interface CloudflarePublishExecutorSchema {
2
+ name: string;
3
+ noBundle: boolean;
4
+ env: string;
5
+ outdir: string;
6
+ compatibilityDate: string;
7
+ compatibilityFlags: string[];
8
+ latest: boolean;
9
+ assets: string;
10
+ site: string;
11
+ siteInclude: string[];
12
+ siteExclude: string[];
13
+ var: string[];
14
+ define: string[];
15
+ triggers: string[];
16
+ routes: string[];
17
+ tsConfig: string;
18
+ minify: boolean;
19
+ nodeCompat: boolean;
20
+ dryRun: boolean;
21
+ keepVars: boolean;
22
+ }
23
+
24
+ export type { CloudflarePublishExecutorSchema as C };
@@ -0,0 +1,11 @@
1
+ interface R2UploadPublishExecutorSchema {
2
+ packageRoot?: string;
3
+ registry: string;
4
+ bucketId: string;
5
+ tsConfig: string;
6
+ tag?: string;
7
+ dryRun: boolean;
8
+ verbose: boolean;
9
+ }
10
+
11
+ export type { R2UploadPublishExecutorSchema as R };
@@ -0,0 +1,11 @@
1
+ interface R2UploadPublishExecutorSchema {
2
+ packageRoot?: string;
3
+ registry: string;
4
+ bucketId: string;
5
+ tsConfig: string;
6
+ tag?: string;
7
+ dryRun: boolean;
8
+ verbose: boolean;
9
+ }
10
+
11
+ export type { R2UploadPublishExecutorSchema as R };
@@ -0,0 +1,8 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { C as CloudflarePublishExecutorSchema } from '../../../schema.d-DgA16PUG.mjs';
3
+
4
+ declare function runExecutor(options: CloudflarePublishExecutorSchema, context: ExecutorContext): Promise<{
5
+ success: boolean;
6
+ }>;
7
+
8
+ export { runExecutor as default };
@@ -0,0 +1,8 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { C as CloudflarePublishExecutorSchema } from '../../../schema.d-DgA16PUG.js';
3
+
4
+ declare function runExecutor(options: CloudflarePublishExecutorSchema, context: ExecutorContext): Promise<{
5
+ success: boolean;
6
+ }>;
7
+
8
+ export { runExecutor as default };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkR7AIVBS7js = require('../../../chunk-R7AIVBS7.js');
4
+ require('../../../chunk-WGOT27OY.js');
5
+ require('../../../chunk-VTHBMY4B.js');
6
+ require('../../../chunk-YE4FHRXJ.js');
7
+ require('../../../chunk-RCE3CC76.js');
8
+ require('../../../chunk-J5SB6L2L.js');
9
+
10
+
11
+ exports.default = _chunkR7AIVBS7js.runExecutor;
@@ -0,0 +1,11 @@
1
+ import {
2
+ runExecutor
3
+ } from "../../../chunk-QEWY5YJA.mjs";
4
+ import "../../../chunk-ITLKTOIK.mjs";
5
+ import "../../../chunk-XU6MTFCV.mjs";
6
+ import "../../../chunk-OARYMVO7.mjs";
7
+ import "../../../chunk-NSLK6ZDO.mjs";
8
+ import "../../../chunk-A7FFSBE6.mjs";
9
+ export {
10
+ runExecutor as default
11
+ };
@@ -0,0 +1,8 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { R as R2UploadPublishExecutorSchema } from '../../../schema.d-oSirXiCO.mjs';
3
+
4
+ declare function runExecutor(options: R2UploadPublishExecutorSchema, context: ExecutorContext): Promise<{
5
+ success: boolean;
6
+ }>;
7
+
8
+ export { runExecutor as default };
@@ -0,0 +1,8 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { R as R2UploadPublishExecutorSchema } from '../../../schema.d-oSirXiCO.js';
3
+
4
+ declare function runExecutor(options: R2UploadPublishExecutorSchema, context: ExecutorContext): Promise<{
5
+ success: boolean;
6
+ }>;
7
+
8
+ export { runExecutor as default };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkNKCR3FSUjs = require('../../../chunk-NKCR3FSU.js');
4
+ require('../../../chunk-JCB2DTP6.js');
5
+ require('../../../chunk-VTHBMY4B.js');
6
+ require('../../../chunk-YE4FHRXJ.js');
7
+ require('../../../chunk-RCE3CC76.js');
8
+ require('../../../chunk-J5SB6L2L.js');
9
+
10
+
11
+ exports.default = _chunkNKCR3FSUjs.runExecutor;
@@ -0,0 +1,11 @@
1
+ import {
2
+ runExecutor
3
+ } from "../../../chunk-VPT6GF3S.mjs";
4
+ import "../../../chunk-VYOULWAK.mjs";
5
+ import "../../../chunk-XU6MTFCV.mjs";
6
+ import "../../../chunk-OARYMVO7.mjs";
7
+ import "../../../chunk-NSLK6ZDO.mjs";
8
+ import "../../../chunk-A7FFSBE6.mjs";
9
+ export {
10
+ runExecutor as default
11
+ };