@storm-software/cloudflare-tools 0.63.55 → 0.63.62
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 +56 -0
- package/README.md +1 -2
- package/dist/chunk-2CDSXWFA.js +311 -0
- package/dist/{chunk-Q5XL7K7Z.mjs → chunk-47LTDAIV.mjs} +4 -4
- package/dist/{chunk-MB54NXKO.mjs → chunk-7ZAYEHFL.mjs} +11 -9
- package/dist/{chunk-AOAXSMD4.js → chunk-FULKT5FT.js} +121 -119
- package/dist/{chunk-TOB7OQN4.js → chunk-FVFZRRXE.js} +1 -1
- package/dist/{chunk-BRPTGDS4.mjs → chunk-IANDAPQS.mjs} +1 -1
- package/dist/{chunk-ADVG6LVE.mjs → chunk-LJBM3BJ3.mjs} +650 -14
- package/dist/chunk-MHMPOWJN.js +1370 -0
- package/dist/{chunk-57WTY3UY.js → chunk-NCQM44P3.js} +3 -3
- package/dist/{chunk-HSHWXMVT.mjs → chunk-OULGED23.mjs} +4 -4
- package/dist/{chunk-P45GT4VW.js → chunk-Q5A6EYKA.js} +12 -12
- package/dist/{chunk-X2ML265T.js → chunk-R6LCC4LT.js} +16 -16
- package/dist/{chunk-5GUQUTLT.mjs → chunk-TGT6YRXK.mjs} +1 -1
- package/dist/chunk-V44DYGWX.mjs +311 -0
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +3 -3
- 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 +2 -2
- package/dist/chunk-AZSS2TUS.mjs +0 -879
- package/dist/chunk-KDRIR55G.js +0 -879
- package/dist/chunk-UOEUE2GI.js +0 -734
|
@@ -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 _chunk2CDSXWFAjs = require('./chunk-2CDSXWFA.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
|
+
_chunk2CDSXWFAjs.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
|
+
_chunk2CDSXWFAjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
var getInternalDependencies = (projectName, graph) => {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generator_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TGT6YRXK.mjs";
|
|
4
4
|
import {
|
|
5
|
+
findWorkspaceRoot,
|
|
5
6
|
getConfig
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LJBM3BJ3.mjs";
|
|
7
8
|
import {
|
|
8
|
-
findWorkspaceRoot,
|
|
9
9
|
getStopwatch,
|
|
10
10
|
writeDebug,
|
|
11
11
|
writeError,
|
|
12
12
|
writeFatal,
|
|
13
13
|
writeInfo,
|
|
14
14
|
writeTrace
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-V44DYGWX.mjs";
|
|
16
16
|
import {
|
|
17
17
|
__dirname
|
|
18
18
|
} from "./chunk-ZJLCWNVH.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
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 _chunkFVFZRRXEjs = require('./chunk-FVFZRRXE.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkUOEUE2GIjs = require('./chunk-UOEUE2GI.js');
|
|
7
6
|
|
|
7
|
+
var _chunkMHMPOWJNjs = require('./chunk-MHMPOWJN.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ var _chunkUOEUE2GIjs = require('./chunk-UOEUE2GI.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk2CDSXWFAjs = require('./chunk-2CDSXWFA.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 = _chunk2CDSXWFAjs.getStopwatch.call(void 0, "Storm Worker generator");
|
|
49
49
|
let config;
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
_chunk2CDSXWFAjs.writeInfo.call(void 0, `\u26A1 Running the Storm Worker generator...
|
|
52
52
|
|
|
53
53
|
`, config);
|
|
54
|
-
const workspaceRoot =
|
|
55
|
-
|
|
54
|
+
const workspaceRoot = _chunkMHMPOWJNjs.findWorkspaceRoot.call(void 0, );
|
|
55
|
+
_chunk2CDSXWFAjs.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 _chunkMHMPOWJNjs.getConfig.call(void 0, workspaceRoot);
|
|
61
|
+
_chunk2CDSXWFAjs.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 _chunkFVFZRRXEjs.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
|
+
_chunk2CDSXWFAjs.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
|
+
_chunk2CDSXWFAjs.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}`,
|
|
@@ -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 _chunkNCQM44P3js = require('./chunk-NCQM44P3.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkNU34IEWNjs = require('./chunk-NU34IEWN.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var _chunkUOEUE2GIjs = require('./chunk-UOEUE2GI.js');
|
|
12
11
|
|
|
12
|
+
var _chunkMHMPOWJNjs = require('./chunk-MHMPOWJN.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk2CDSXWFAjs = require('./chunk-2CDSXWFA.js');
|
|
19
19
|
|
|
20
20
|
// src/executors/r2-upload-publish/executor.ts
|
|
21
21
|
var _clients3 = require('@aws-sdk/client-s3');
|
|
@@ -39,8 +39,8 @@ 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 = _chunkMHMPOWJNjs.findWorkspaceRoot.call(void 0, );
|
|
43
|
+
const config = await _chunkMHMPOWJNjs.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
46
|
const projectDetails = _chunkNU34IEWNjs.getPackageInfo.call(void 0,
|
|
@@ -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
|
+
_chunk2CDSXWFAjs.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
|
+
_chunk2CDSXWFAjs.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 _chunkNCQM44P3js.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
|
+
_chunk2CDSXWFAjs.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
|
+
_chunk2CDSXWFAjs.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
|
+
_chunk2CDSXWFAjs.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
|
+
_chunk2CDSXWFAjs.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
|
+
_chunk2CDSXWFAjs.writeInfo.call(void 0, `Generating meta.json file:
|
|
162
162
|
${metaJson}`);
|
|
163
|
-
await
|
|
163
|
+
await _chunkNCQM44P3js.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) => _chunkNCQM44P3js.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
|
+
_chunk2CDSXWFAjs.writeSuccess.call(void 0,
|
|
191
191
|
`Successfully uploaded the ${projectName} component to the Cyclone Registry`,
|
|
192
192
|
config
|
|
193
193
|
);
|
|
@@ -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.61",
|
|
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",
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
// ../config-tools/src/types.ts
|
|
2
|
+
var LogLevel = {
|
|
3
|
+
SILENT: 0,
|
|
4
|
+
FATAL: 10,
|
|
5
|
+
ERROR: 20,
|
|
6
|
+
WARN: 30,
|
|
7
|
+
SUCCESS: 35,
|
|
8
|
+
INFO: 40,
|
|
9
|
+
DEBUG: 60,
|
|
10
|
+
TRACE: 70,
|
|
11
|
+
ALL: 100
|
|
12
|
+
};
|
|
13
|
+
var LogLevelLabel = {
|
|
14
|
+
SILENT: "silent",
|
|
15
|
+
FATAL: "fatal",
|
|
16
|
+
ERROR: "error",
|
|
17
|
+
WARN: "warn",
|
|
18
|
+
SUCCESS: "success",
|
|
19
|
+
INFO: "info",
|
|
20
|
+
DEBUG: "debug",
|
|
21
|
+
TRACE: "trace",
|
|
22
|
+
ALL: "all"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// ../config-tools/src/utilities/colors.ts
|
|
26
|
+
var DEFAULT_COLOR_CONFIG = {
|
|
27
|
+
light: {
|
|
28
|
+
background: "#fafafa",
|
|
29
|
+
foreground: "#1d1e22",
|
|
30
|
+
brand: "#1fb2a6",
|
|
31
|
+
alternate: "#db2777",
|
|
32
|
+
help: "#5C4EE5",
|
|
33
|
+
success: "#087f5b",
|
|
34
|
+
info: "#0550ae",
|
|
35
|
+
warning: "#e3b341",
|
|
36
|
+
danger: "#D8314A",
|
|
37
|
+
fatal: "#51070f",
|
|
38
|
+
link: "#3fa6ff",
|
|
39
|
+
positive: "#22c55e",
|
|
40
|
+
negative: "#dc2626",
|
|
41
|
+
gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
|
|
42
|
+
},
|
|
43
|
+
dark: {
|
|
44
|
+
background: "#1d1e22",
|
|
45
|
+
foreground: "#cbd5e1",
|
|
46
|
+
brand: "#2dd4bf",
|
|
47
|
+
alternate: "#db2777",
|
|
48
|
+
help: "#818cf8",
|
|
49
|
+
success: "#10b981",
|
|
50
|
+
info: "#58a6ff",
|
|
51
|
+
warning: "#f3d371",
|
|
52
|
+
danger: "#D8314A",
|
|
53
|
+
fatal: "#a40e26",
|
|
54
|
+
link: "#3fa6ff",
|
|
55
|
+
positive: "#22c55e",
|
|
56
|
+
negative: "#dc2626",
|
|
57
|
+
gradient: ["#1fb2a6", "#db2777", "#818cf8"]
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// ../config-tools/src/logger/chalk.ts
|
|
62
|
+
import chalk from "chalk";
|
|
63
|
+
var chalkDefault = {
|
|
64
|
+
hex: (_) => (message) => message,
|
|
65
|
+
bgHex: (_) => ({
|
|
66
|
+
whiteBright: (message) => message,
|
|
67
|
+
white: (message) => message
|
|
68
|
+
}),
|
|
69
|
+
white: (message) => message,
|
|
70
|
+
whiteBright: (message) => message,
|
|
71
|
+
gray: (message) => message,
|
|
72
|
+
bold: {
|
|
73
|
+
hex: (_) => (message) => message,
|
|
74
|
+
bgHex: (_) => ({
|
|
75
|
+
whiteBright: (message) => message,
|
|
76
|
+
white: (message) => message
|
|
77
|
+
}),
|
|
78
|
+
whiteBright: (message) => message,
|
|
79
|
+
white: (message) => message
|
|
80
|
+
},
|
|
81
|
+
dim: {
|
|
82
|
+
hex: (_) => (message) => message,
|
|
83
|
+
gray: (message) => message
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var getChalk = () => {
|
|
87
|
+
let _chalk = chalk;
|
|
88
|
+
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
89
|
+
_chalk = chalkDefault;
|
|
90
|
+
}
|
|
91
|
+
return _chalk;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
95
|
+
function isUnicodeSupported() {
|
|
96
|
+
if (process.platform !== "win32") {
|
|
97
|
+
return process.env.TERM !== "linux";
|
|
98
|
+
}
|
|
99
|
+
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
100
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
101
|
+
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
102
|
+
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
106
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
107
|
+
var CONSOLE_ICONS = {
|
|
108
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
109
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
110
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
111
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
112
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
113
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
114
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
115
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
119
|
+
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
120
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
124
|
+
var getLogLevel = (label) => {
|
|
125
|
+
switch (label) {
|
|
126
|
+
case "all":
|
|
127
|
+
return LogLevel.ALL;
|
|
128
|
+
case "trace":
|
|
129
|
+
return LogLevel.TRACE;
|
|
130
|
+
case "debug":
|
|
131
|
+
return LogLevel.DEBUG;
|
|
132
|
+
case "info":
|
|
133
|
+
return LogLevel.INFO;
|
|
134
|
+
case "warn":
|
|
135
|
+
return LogLevel.WARN;
|
|
136
|
+
case "error":
|
|
137
|
+
return LogLevel.ERROR;
|
|
138
|
+
case "fatal":
|
|
139
|
+
return LogLevel.FATAL;
|
|
140
|
+
case "silent":
|
|
141
|
+
return LogLevel.SILENT;
|
|
142
|
+
default:
|
|
143
|
+
return LogLevel.INFO;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
147
|
+
if (logLevel >= LogLevel.ALL) {
|
|
148
|
+
return LogLevelLabel.ALL;
|
|
149
|
+
}
|
|
150
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
151
|
+
return LogLevelLabel.TRACE;
|
|
152
|
+
}
|
|
153
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
154
|
+
return LogLevelLabel.DEBUG;
|
|
155
|
+
}
|
|
156
|
+
if (logLevel >= LogLevel.INFO) {
|
|
157
|
+
return LogLevelLabel.INFO;
|
|
158
|
+
}
|
|
159
|
+
if (logLevel >= LogLevel.WARN) {
|
|
160
|
+
return LogLevelLabel.WARN;
|
|
161
|
+
}
|
|
162
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
163
|
+
return LogLevelLabel.ERROR;
|
|
164
|
+
}
|
|
165
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
166
|
+
return LogLevelLabel.FATAL;
|
|
167
|
+
}
|
|
168
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
169
|
+
return LogLevelLabel.SILENT;
|
|
170
|
+
}
|
|
171
|
+
return LogLevelLabel.INFO;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// ../config-tools/src/logger/console.ts
|
|
175
|
+
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
176
|
+
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
177
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
178
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
179
|
+
return (_) => {
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
183
|
+
return (message) => {
|
|
184
|
+
console.error(
|
|
185
|
+
`
|
|
186
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
187
|
+
`
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
192
|
+
return (message) => {
|
|
193
|
+
console.error(
|
|
194
|
+
`
|
|
195
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
196
|
+
`
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
201
|
+
return (message) => {
|
|
202
|
+
console.warn(
|
|
203
|
+
`
|
|
204
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
205
|
+
`
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
210
|
+
return (message) => {
|
|
211
|
+
console.info(
|
|
212
|
+
`
|
|
213
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
214
|
+
`
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
219
|
+
return (message) => {
|
|
220
|
+
console.info(
|
|
221
|
+
`
|
|
222
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
223
|
+
`
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
228
|
+
return (message) => {
|
|
229
|
+
console.debug(
|
|
230
|
+
`
|
|
231
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
232
|
+
`
|
|
233
|
+
);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
237
|
+
return (message) => {
|
|
238
|
+
console.debug(
|
|
239
|
+
`
|
|
240
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
241
|
+
`
|
|
242
|
+
);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return (message) => {
|
|
246
|
+
console.log(
|
|
247
|
+
`
|
|
248
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
249
|
+
`
|
|
250
|
+
);
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
254
|
+
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
255
|
+
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
256
|
+
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
257
|
+
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
258
|
+
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
259
|
+
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
260
|
+
var getStopwatch = (name) => {
|
|
261
|
+
const start = process.hrtime();
|
|
262
|
+
return () => {
|
|
263
|
+
const end = process.hrtime(start);
|
|
264
|
+
console.info(
|
|
265
|
+
`
|
|
266
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
267
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
268
|
+
)}ms to complete
|
|
269
|
+
`
|
|
270
|
+
);
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
var MAX_DEPTH = 4;
|
|
274
|
+
var formatLogMessage = (message, options = {}, depth = 0) => {
|
|
275
|
+
if (depth > MAX_DEPTH) {
|
|
276
|
+
return "<max depth>";
|
|
277
|
+
}
|
|
278
|
+
const prefix = options.prefix ?? "-";
|
|
279
|
+
const skip = options.skip ?? [];
|
|
280
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
281
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
282
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
283
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
284
|
+
message[key],
|
|
285
|
+
{ prefix: `${prefix}-`, skip },
|
|
286
|
+
depth + 1
|
|
287
|
+
) : message[key]}`
|
|
288
|
+
).join("\n")}` : message;
|
|
289
|
+
};
|
|
290
|
+
var _isFunction = (value) => {
|
|
291
|
+
try {
|
|
292
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
293
|
+
} catch {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export {
|
|
299
|
+
LogLevel,
|
|
300
|
+
getLogLevel,
|
|
301
|
+
getLogLevelLabel,
|
|
302
|
+
writeFatal,
|
|
303
|
+
writeError,
|
|
304
|
+
writeWarning,
|
|
305
|
+
writeInfo,
|
|
306
|
+
writeSuccess,
|
|
307
|
+
writeDebug,
|
|
308
|
+
writeTrace,
|
|
309
|
+
getStopwatch,
|
|
310
|
+
formatLogMessage
|
|
311
|
+
};
|
package/dist/executors.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";require('./chunk-XO66D74Z.js');
|
|
2
2
|
require('./chunk-IRORGRVZ.js');
|
|
3
|
-
require('./chunk-
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
require('./chunk-FULKT5FT.js');
|
|
4
|
+
require('./chunk-R6LCC4LT.js');
|
|
5
|
+
require('./chunk-NCQM44P3.js');
|
|
6
6
|
require('./chunk-NU34IEWN.js');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-MHMPOWJN.js');
|
|
8
|
+
require('./chunk-2CDSXWFA.js');
|
|
9
9
|
require('./chunk-MCKGQKYU.js');
|
package/dist/executors.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./chunk-YSCEY447.mjs";
|
|
2
2
|
import "./chunk-Q243NONI.mjs";
|
|
3
|
-
import "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-7ZAYEHFL.mjs";
|
|
4
|
+
import "./chunk-47LTDAIV.mjs";
|
|
5
|
+
import "./chunk-IANDAPQS.mjs";
|
|
6
6
|
import "./chunk-PH3DHY4Q.mjs";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-LJBM3BJ3.mjs";
|
|
8
|
+
import "./chunk-V44DYGWX.mjs";
|
|
9
9
|
import "./chunk-ZJLCWNVH.mjs";
|
package/dist/generators.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkQ5A6EYKAjs = require('./chunk-Q5A6EYKA.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
9
|
+
var _chunkFVFZRRXEjs = require('./chunk-FVFZRRXE.js');
|
|
10
|
+
require('./chunk-MHMPOWJN.js');
|
|
11
|
+
require('./chunk-2CDSXWFA.js');
|
|
12
12
|
require('./chunk-MCKGQKYU.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.applicationGenerator =
|
|
18
|
+
exports.applicationGenerator = _chunkQ5A6EYKAjs.applicationGenerator; exports.applicationSchematic = _chunkQ5A6EYKAjs.applicationSchematic; exports.initGenerator = _chunkFVFZRRXEjs.initGenerator; exports.initSchematic = _chunkFVFZRRXEjs.initSchematic;
|
package/dist/generators.mjs
CHANGED
|
@@ -2,13 +2,13 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
applicationGenerator,
|
|
4
4
|
applicationSchematic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OULGED23.mjs";
|
|
6
6
|
import {
|
|
7
7
|
initGenerator,
|
|
8
8
|
initSchematic
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-TGT6YRXK.mjs";
|
|
10
|
+
import "./chunk-LJBM3BJ3.mjs";
|
|
11
|
+
import "./chunk-V44DYGWX.mjs";
|
|
12
12
|
import "./chunk-ZJLCWNVH.mjs";
|
|
13
13
|
export {
|
|
14
14
|
applicationGenerator,
|