@storm-software/workspace-tools 1.296.103 → 1.296.104
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/README.md +1 -1
- package/dist/chunk-2D2626GQ.js +128 -0
- package/dist/chunk-5T4QN26P.js +93 -0
- package/dist/chunk-62U3K4QL.js +31 -0
- package/dist/chunk-6DTG46OS.mjs +128 -0
- package/dist/{chunk-KDZGNUBS.mjs → chunk-77J7VIDG.mjs} +1 -1
- package/dist/chunk-7YO4PMLG.mjs +32 -0
- package/dist/chunk-BKTSNX4U.js +41 -0
- package/dist/chunk-BZB6C7OW.mjs +31 -0
- package/dist/chunk-CW6ERHR6.js +79 -0
- package/dist/chunk-DPKPIVRB.mjs +93 -0
- package/dist/{chunk-POHCCCR5.mjs → chunk-GESAJF7P.mjs} +1 -1
- package/dist/{chunk-ZQVMKLN3.mjs → chunk-J2AFJZUP.mjs} +1 -1
- package/dist/chunk-K4DWEHZO.js +262 -0
- package/dist/chunk-MBQOVLFH.js +32 -0
- package/dist/chunk-MVSTFKO3.mjs +318 -0
- package/dist/chunk-NP4JJVGY.js +32 -0
- package/dist/chunk-P42HBYJL.js +32 -0
- package/dist/chunk-PS3344Z2.js +318 -0
- package/dist/{chunk-LKCN5IIO.mjs → chunk-TRYTX34Z.mjs} +1 -1
- package/dist/chunk-TYLGU2FW.mjs +41 -0
- package/dist/chunk-UUWXIOS5.mjs +32 -0
- package/dist/chunk-WAXMGLST.mjs +32 -0
- package/dist/{chunk-4TGI6IUX.mjs → chunk-WSB4F36F.mjs} +4 -4
- package/dist/chunk-YJ6NNN24.mjs +82 -0
- package/dist/chunk-Z2ZHQ4GR.mjs +265 -0
- package/dist/executors.js +15 -15
- package/dist/executors.mjs +15 -15
- package/dist/generators.js +10 -10
- package/dist/generators.mjs +11 -11
- package/dist/index.js +46 -46
- package/dist/index.mjs +75 -75
- package/dist/src/base/base-executor.mjs +1 -1
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/base/base-generator.mjs +1 -1
- package/dist/src/base/base-generator.untyped.mjs +1 -1
- package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
- package/dist/src/base/index.js +10 -10
- package/dist/src/base/index.mjs +16 -16
- package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
- package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
- package/dist/src/executors/cargo-build/executor.js +4 -4
- package/dist/src/executors/cargo-build/executor.mjs +4 -4
- package/dist/src/executors/cargo-build/untyped.mjs +1 -1
- package/dist/src/executors/cargo-check/executor.js +4 -4
- package/dist/src/executors/cargo-check/executor.mjs +4 -4
- package/dist/src/executors/cargo-check/untyped.mjs +1 -1
- package/dist/src/executors/cargo-clippy/executor.js +4 -4
- package/dist/src/executors/cargo-clippy/executor.mjs +4 -4
- package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
- package/dist/src/executors/cargo-doc/executor.js +4 -4
- package/dist/src/executors/cargo-doc/executor.mjs +4 -4
- package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
- package/dist/src/executors/cargo-format/executor.js +4 -4
- package/dist/src/executors/cargo-format/executor.mjs +4 -4
- package/dist/src/executors/cargo-format/untyped.mjs +1 -1
- package/dist/src/executors/cargo-publish/executor.mjs +1 -1
- package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
- package/dist/src/executors/clean-package/executor.mjs +1 -1
- package/dist/src/executors/clean-package/untyped.mjs +1 -1
- package/dist/src/executors/esbuild/executor.mjs +1 -1
- package/dist/src/executors/esbuild/untyped.mjs +1 -1
- package/dist/src/executors/napi/executor.js +4 -4
- package/dist/src/executors/napi/executor.mjs +4 -4
- package/dist/src/executors/napi/untyped.mjs +1 -1
- package/dist/src/executors/npm-publish/executor.js +4 -4
- package/dist/src/executors/npm-publish/executor.mjs +4 -4
- package/dist/src/executors/npm-publish/untyped.mjs +1 -1
- package/dist/src/executors/size-limit/executor.mjs +1 -1
- package/dist/src/executors/size-limit/untyped.mjs +1 -1
- package/dist/src/executors/tsdown/executor.mjs +1 -1
- package/dist/src/executors/tsdown/untyped.mjs +1 -1
- package/dist/src/executors/typia/executor.mjs +1 -1
- package/dist/src/executors/typia/untyped.mjs +1 -1
- package/dist/src/executors/unbuild/executor.mjs +1 -1
- package/dist/src/executors/unbuild/untyped.mjs +1 -1
- package/dist/src/generators/browser-library/generator.js +2 -2
- package/dist/src/generators/browser-library/generator.mjs +4 -4
- package/dist/src/generators/browser-library/untyped.mjs +1 -1
- package/dist/src/generators/config-schema/generator.mjs +1 -1
- package/dist/src/generators/config-schema/untyped.mjs +1 -1
- package/dist/src/generators/init/init.mjs +1 -1
- package/dist/src/generators/init/untyped.mjs +1 -1
- package/dist/src/generators/neutral-library/generator.js +2 -2
- package/dist/src/generators/neutral-library/generator.mjs +4 -4
- package/dist/src/generators/neutral-library/untyped.mjs +1 -1
- package/dist/src/generators/node-library/generator.js +4 -4
- package/dist/src/generators/node-library/generator.mjs +4 -4
- package/dist/src/generators/node-library/untyped.mjs +1 -1
- package/dist/src/generators/preset/generator.js +4 -4
- package/dist/src/generators/preset/generator.mjs +4 -4
- package/dist/src/generators/preset/untyped.mjs +1 -1
- package/dist/src/plugins/rust/cargo-toml.js +1 -1
- package/dist/src/plugins/rust/cargo-toml.mjs +2 -2
- package/dist/src/plugins/rust/index.js +1 -1
- package/dist/src/plugins/rust/index.mjs +2 -2
- package/dist/src/plugins/typescript/index.mjs +1 -1
- package/dist/src/plugins/typescript/tsdown.mjs +1 -1
- package/dist/src/plugins/typescript/tsup.mjs +1 -1
- package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
- package/dist/src/release/index.mjs +1 -1
- package/dist/src/release/js-version-actions.mjs +1 -1
- package/dist/src/release/rust-version-actions.mjs +1 -1
- package/dist/src/types.mjs +1 -1
- package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
- package/dist/src/utils/cargo.mjs +1 -1
- package/dist/src/utils/create-cli-options.mjs +1 -1
- package/dist/src/utils/get-project-configurations.mjs +1 -1
- package/dist/src/utils/github.mjs +1 -1
- package/dist/src/utils/index.js +8 -8
- package/dist/src/utils/index.mjs +24 -24
- package/dist/src/utils/lock-file.mjs +1 -1
- package/dist/src/utils/nx-json.mjs +1 -1
- package/dist/src/utils/package-helpers.js +3 -3
- package/dist/src/utils/package-helpers.mjs +3 -3
- package/dist/src/utils/package-manager.mjs +1 -1
- package/dist/src/utils/plugin-helpers.mjs +1 -1
- package/dist/src/utils/project-tags.mjs +1 -1
- package/dist/src/utils/registry-helpers.mjs +1 -1
- package/dist/src/utils/typia-transform.mjs +1 -1
- package/dist/src/utils/versions.mjs +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
var _chunk2VQ55YPWjs = require('./chunk-2VQ55YPW.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkHYK7OVZ3js = require('./chunk-HYK7OVZ3.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkCLKU7UMGjs = require('./chunk-CLKU7UMG.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
|
|
16
|
+
|
|
17
|
+
// src/executors/napi/executor.ts
|
|
18
|
+
var _jiti = require('jiti');
|
|
19
|
+
var _fileutils = require('nx/src/utils/fileutils');
|
|
20
|
+
async function napiExecutor(options, context, config) {
|
|
21
|
+
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
22
|
+
fsCache: config.skipCache ? false : _chunkCQDBLKPFjs.joinPaths.call(void 0,
|
|
23
|
+
config.workspaceRoot,
|
|
24
|
+
config.directories.cache || "node_modules/.cache/storm",
|
|
25
|
+
"jiti"
|
|
26
|
+
),
|
|
27
|
+
interopDefault: true
|
|
28
|
+
});
|
|
29
|
+
const { NapiCli } = await jiti.import(
|
|
30
|
+
jiti.esmResolve("@napi-rs/cli")
|
|
31
|
+
);
|
|
32
|
+
if (!_optionalChain([context, 'access', _ => _.projectGraph, 'optionalAccess', _2 => _2.nodes, 'access', _3 => _3[_nullishCoalesce(context.projectName, () => ( ""))]])) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
"The Napi Build process failed because the project could not be found in the project graph. Please run this command from a workspace root directory."
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
const projectRoot = _optionalChain([context, 'access', _4 => _4.projectGraph, 'optionalAccess', _5 => _5.nodes, 'access', _6 => _6[_nullishCoalesce(context.projectName, () => ( ""))], 'optionalAccess', _7 => _7.data, 'access', _8 => _8.root]);
|
|
38
|
+
const packageJson = _chunkCQDBLKPFjs.joinPaths.call(void 0, _nullishCoalesce(projectRoot, () => ( ".")), "package.json");
|
|
39
|
+
if (!_fileutils.fileExists.call(void 0, packageJson)) {
|
|
40
|
+
throw new Error(`Could not find package.json at ${packageJson}`);
|
|
41
|
+
}
|
|
42
|
+
const napi = new NapiCli();
|
|
43
|
+
const normalizedOptions = { ...options };
|
|
44
|
+
const metadata = _chunkHYK7OVZ3js.cargoMetadata.call(void 0, );
|
|
45
|
+
normalizedOptions.targetDir = options.targetDir || _optionalChain([metadata, 'optionalAccess', _9 => _9.target_directory]) || _chunkCQDBLKPFjs.joinPaths.call(void 0, config.workspaceRoot, "dist", "target");
|
|
46
|
+
normalizedOptions.outputDir = options.outputPath;
|
|
47
|
+
normalizedOptions.packageJsonPath ??= packageJson;
|
|
48
|
+
if (options.cwd) {
|
|
49
|
+
normalizedOptions.cwd = _chunkCQDBLKPFjs.correctPaths.call(void 0, options.cwd);
|
|
50
|
+
} else {
|
|
51
|
+
const absoluteProjectRoot = _chunkCQDBLKPFjs.correctPaths.call(void 0,
|
|
52
|
+
_chunkCQDBLKPFjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot || ".")
|
|
53
|
+
);
|
|
54
|
+
normalizedOptions.cwd = absoluteProjectRoot;
|
|
55
|
+
if (normalizedOptions.outputDir) {
|
|
56
|
+
normalizedOptions.outputDir = _chunkCQDBLKPFjs.relative.call(void 0,
|
|
57
|
+
normalizedOptions.cwd,
|
|
58
|
+
_chunkCQDBLKPFjs.correctPaths.call(void 0,
|
|
59
|
+
_chunkCQDBLKPFjs.isAbsolute.call(void 0, normalizedOptions.outputDir) ? normalizedOptions.outputDir : _chunkCQDBLKPFjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.outputDir)
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
if (normalizedOptions.packageJsonPath) {
|
|
64
|
+
normalizedOptions.packageJsonPath = _chunkCQDBLKPFjs.relative.call(void 0,
|
|
65
|
+
normalizedOptions.cwd,
|
|
66
|
+
_chunkCQDBLKPFjs.correctPaths.call(void 0,
|
|
67
|
+
_chunkCQDBLKPFjs.isAbsolute.call(void 0, normalizedOptions.packageJsonPath) ? normalizedOptions.packageJsonPath : _chunkCQDBLKPFjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.packageJsonPath)
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (normalizedOptions.configPath) {
|
|
72
|
+
normalizedOptions.configPath = _chunkCQDBLKPFjs.relative.call(void 0,
|
|
73
|
+
normalizedOptions.cwd,
|
|
74
|
+
_chunkCQDBLKPFjs.correctPaths.call(void 0,
|
|
75
|
+
_chunkCQDBLKPFjs.isAbsolute.call(void 0, normalizedOptions.configPath) ? normalizedOptions.configPath : _chunkCQDBLKPFjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.configPath)
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (normalizedOptions.manifestPath) {
|
|
80
|
+
normalizedOptions.manifestPath = _chunkCQDBLKPFjs.relative.call(void 0,
|
|
81
|
+
normalizedOptions.cwd,
|
|
82
|
+
_chunkCQDBLKPFjs.correctPaths.call(void 0,
|
|
83
|
+
_chunkCQDBLKPFjs.isAbsolute.call(void 0, normalizedOptions.manifestPath) ? normalizedOptions.manifestPath : _chunkCQDBLKPFjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.manifestPath)
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (process.env.VERCEL) {
|
|
89
|
+
return { success: true };
|
|
90
|
+
}
|
|
91
|
+
_chunkCLKU7UMGjs.writeDebug.call(void 0,
|
|
92
|
+
`Normalized Napi Options:
|
|
93
|
+
packageJsonPath: ${normalizedOptions.packageJsonPath}
|
|
94
|
+
outputDir: ${normalizedOptions.outputDir}
|
|
95
|
+
targetDir: ${normalizedOptions.targetDir}
|
|
96
|
+
manifestPath: ${normalizedOptions.manifestPath}
|
|
97
|
+
configPath: ${normalizedOptions.configPath}
|
|
98
|
+
cwd: ${normalizedOptions.cwd}`,
|
|
99
|
+
config
|
|
100
|
+
);
|
|
101
|
+
const { task } = await napi.build(normalizedOptions);
|
|
102
|
+
return { success: true, terminalOutput: await task };
|
|
103
|
+
}
|
|
104
|
+
var executor_default = _chunk2VQ55YPWjs.withRunExecutor.call(void 0,
|
|
105
|
+
"Napi - Build Bindings",
|
|
106
|
+
napiExecutor,
|
|
107
|
+
{
|
|
108
|
+
skipReadingConfig: false,
|
|
109
|
+
hooks: {
|
|
110
|
+
applyDefaultOptions: (options) => {
|
|
111
|
+
options.outputPath ??= "{sourceRoot}";
|
|
112
|
+
options.toolchain ??= "stable";
|
|
113
|
+
options.dtsCache ??= true;
|
|
114
|
+
options.platform ??= true;
|
|
115
|
+
options.constEnum ??= false;
|
|
116
|
+
options.verbose ??= false;
|
|
117
|
+
options.jsBinding ??= "binding.js";
|
|
118
|
+
options.dts ??= "binding.d.ts";
|
|
119
|
+
return options;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
exports.napiExecutor = napiExecutor; exports.executor_default = executor_default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkTAP26ZJQjs = require('./chunk-TAP26ZJQ.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkN2365RCIjs = require('./chunk-N2365RCI.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
|
|
11
|
+
|
|
12
|
+
// src/utils/package-helpers.ts
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _devkit = require('@nx/devkit');
|
|
17
|
+
var _child_process = require('child_process');
|
|
18
|
+
var _fs = require('fs');
|
|
19
|
+
var _promises = require('fs/promises');
|
|
20
|
+
var _path = require('path');
|
|
21
|
+
var _prettier = require('prettier');
|
|
22
|
+
var PackageManagerTypes = {
|
|
23
|
+
PackageJson: "package.json",
|
|
24
|
+
CargoToml: "Cargo.toml"
|
|
25
|
+
};
|
|
26
|
+
var getPackageInfo = (project) => {
|
|
27
|
+
if (_chunkTAP26ZJQjs.isEqualProjectTag.call(void 0,
|
|
28
|
+
project,
|
|
29
|
+
_chunkTAP26ZJQjs.ProjectTagConstants.Language.TAG_ID,
|
|
30
|
+
_chunkTAP26ZJQjs.ProjectTagConstants.Language.RUST
|
|
31
|
+
) && _fs.existsSync.call(void 0, _devkit.joinPathFragments.call(void 0, project.root, "Cargo.toml"))) {
|
|
32
|
+
return {
|
|
33
|
+
type: "Cargo.toml",
|
|
34
|
+
content: _chunkN2365RCIjs.parseCargoToml.call(void 0, _devkit.joinPathFragments.call(void 0, project.root, "Cargo.toml"))
|
|
35
|
+
};
|
|
36
|
+
} else if (_chunkTAP26ZJQjs.isEqualProjectTag.call(void 0,
|
|
37
|
+
project,
|
|
38
|
+
_chunkTAP26ZJQjs.ProjectTagConstants.Language.TAG_ID,
|
|
39
|
+
_chunkTAP26ZJQjs.ProjectTagConstants.Language.TYPESCRIPT
|
|
40
|
+
) && _fs.existsSync.call(void 0, _devkit.joinPathFragments.call(void 0, project.root, "package.json"))) {
|
|
41
|
+
return {
|
|
42
|
+
type: "package.json",
|
|
43
|
+
content: _devkit.readJsonFile.call(void 0,
|
|
44
|
+
_devkit.joinPathFragments.call(void 0, project.root, "package.json")
|
|
45
|
+
)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
async function addPackageJsonGitHead(packageRoot) {
|
|
51
|
+
const packageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, packageRoot, "package.json");
|
|
52
|
+
if (!packageJsonPath) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
"No file path provided. Please provide a valid path to the package.json file."
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
const packageJsonValue = JSON.parse(await _promises.readFile.call(void 0, packageJsonPath, "utf8"));
|
|
58
|
+
if (!packageJsonValue || typeof packageJsonValue !== "object") {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Invalid package.json file at ${packageJsonPath}. Please ensure it is a valid JSON file.`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
const gitHead = _child_process.execFileSync.call(void 0, "git", ["rev-parse", "HEAD"], {
|
|
64
|
+
cwd: _path.dirname.call(void 0, _path.resolve.call(void 0, packageJsonPath)),
|
|
65
|
+
encoding: "utf8"
|
|
66
|
+
}).trim();
|
|
67
|
+
packageJsonValue.gitHead = gitHead;
|
|
68
|
+
return _promises.writeFile.call(void 0,
|
|
69
|
+
packageJsonPath,
|
|
70
|
+
await _prettier.format.call(void 0, JSON.stringify(packageJsonValue), {
|
|
71
|
+
parser: "json",
|
|
72
|
+
proseWrap: "preserve",
|
|
73
|
+
trailingComma: "none",
|
|
74
|
+
tabWidth: 2,
|
|
75
|
+
semi: true,
|
|
76
|
+
singleQuote: false,
|
|
77
|
+
quoteProps: "as-needed",
|
|
78
|
+
insertPragma: false,
|
|
79
|
+
bracketSameLine: true,
|
|
80
|
+
printWidth: 80,
|
|
81
|
+
bracketSpacing: true,
|
|
82
|
+
arrowParens: "avoid",
|
|
83
|
+
endOfLine: "lf",
|
|
84
|
+
plugins: ["prettier-plugin-packagejson"]
|
|
85
|
+
})
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
exports.PackageManagerTypes = PackageManagerTypes; exports.getPackageInfo = getPackageInfo; exports.addPackageJsonGitHead = addPackageJsonGitHead;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2VQ55YPWjs = require('./chunk-2VQ55YPW.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkHYK7OVZ3js = require('./chunk-HYK7OVZ3.js');
|
|
8
|
+
|
|
9
|
+
// src/executors/cargo-check/executor.ts
|
|
10
|
+
async function cargoCheckExecutor(options, context) {
|
|
11
|
+
const command = _chunkHYK7OVZ3js.buildCargoCommand.call(void 0, "check", options, context);
|
|
12
|
+
return await _chunkHYK7OVZ3js.cargoCommand.call(void 0, context.root, ...command);
|
|
13
|
+
}
|
|
14
|
+
var executor_default = _chunk2VQ55YPWjs.withRunExecutor.call(void 0,
|
|
15
|
+
"Cargo - Check",
|
|
16
|
+
cargoCheckExecutor,
|
|
17
|
+
{
|
|
18
|
+
skipReadingConfig: false,
|
|
19
|
+
hooks: {
|
|
20
|
+
applyDefaultOptions: (options) => {
|
|
21
|
+
options.toolchain ??= "stable";
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
exports.cargoCheckExecutor = cargoCheckExecutor; exports.executor_default = executor_default;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import {
|
|
2
|
+
withRunExecutor
|
|
3
|
+
} from "./chunk-Y3CN5O3K.mjs";
|
|
4
|
+
import {
|
|
5
|
+
cargoMetadata
|
|
6
|
+
} from "./chunk-C3G4MZGP.mjs";
|
|
7
|
+
import {
|
|
8
|
+
writeDebug
|
|
9
|
+
} from "./chunk-45CW7OJB.mjs";
|
|
10
|
+
import {
|
|
11
|
+
correctPaths,
|
|
12
|
+
isAbsolute,
|
|
13
|
+
joinPaths,
|
|
14
|
+
relative
|
|
15
|
+
} from "./chunk-TBW5MCN6.mjs";
|
|
16
|
+
|
|
17
|
+
// src/executors/napi/executor.ts
|
|
18
|
+
import { createJiti } from "jiti";
|
|
19
|
+
import { fileExists } from "nx/src/utils/fileutils";
|
|
20
|
+
async function napiExecutor(options, context, config) {
|
|
21
|
+
const jiti = createJiti(config.workspaceRoot, {
|
|
22
|
+
fsCache: config.skipCache ? false : joinPaths(
|
|
23
|
+
config.workspaceRoot,
|
|
24
|
+
config.directories.cache || "node_modules/.cache/storm",
|
|
25
|
+
"jiti"
|
|
26
|
+
),
|
|
27
|
+
interopDefault: true
|
|
28
|
+
});
|
|
29
|
+
const { NapiCli } = await jiti.import(
|
|
30
|
+
jiti.esmResolve("@napi-rs/cli")
|
|
31
|
+
);
|
|
32
|
+
if (!context.projectGraph?.nodes[context.projectName ?? ""]) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
"The Napi Build process failed because the project could not be found in the project graph. Please run this command from a workspace root directory."
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
const projectRoot = context.projectGraph?.nodes[context.projectName ?? ""]?.data.root;
|
|
38
|
+
const packageJson = joinPaths(projectRoot ?? ".", "package.json");
|
|
39
|
+
if (!fileExists(packageJson)) {
|
|
40
|
+
throw new Error(`Could not find package.json at ${packageJson}`);
|
|
41
|
+
}
|
|
42
|
+
const napi = new NapiCli();
|
|
43
|
+
const normalizedOptions = { ...options };
|
|
44
|
+
const metadata = cargoMetadata();
|
|
45
|
+
normalizedOptions.targetDir = options.targetDir || metadata?.target_directory || joinPaths(config.workspaceRoot, "dist", "target");
|
|
46
|
+
normalizedOptions.outputDir = options.outputPath;
|
|
47
|
+
normalizedOptions.packageJsonPath ??= packageJson;
|
|
48
|
+
if (options.cwd) {
|
|
49
|
+
normalizedOptions.cwd = correctPaths(options.cwd);
|
|
50
|
+
} else {
|
|
51
|
+
const absoluteProjectRoot = correctPaths(
|
|
52
|
+
joinPaths(config.workspaceRoot, projectRoot || ".")
|
|
53
|
+
);
|
|
54
|
+
normalizedOptions.cwd = absoluteProjectRoot;
|
|
55
|
+
if (normalizedOptions.outputDir) {
|
|
56
|
+
normalizedOptions.outputDir = relative(
|
|
57
|
+
normalizedOptions.cwd,
|
|
58
|
+
correctPaths(
|
|
59
|
+
isAbsolute(normalizedOptions.outputDir) ? normalizedOptions.outputDir : joinPaths(config.workspaceRoot, normalizedOptions.outputDir)
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
if (normalizedOptions.packageJsonPath) {
|
|
64
|
+
normalizedOptions.packageJsonPath = relative(
|
|
65
|
+
normalizedOptions.cwd,
|
|
66
|
+
correctPaths(
|
|
67
|
+
isAbsolute(normalizedOptions.packageJsonPath) ? normalizedOptions.packageJsonPath : joinPaths(config.workspaceRoot, normalizedOptions.packageJsonPath)
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (normalizedOptions.configPath) {
|
|
72
|
+
normalizedOptions.configPath = relative(
|
|
73
|
+
normalizedOptions.cwd,
|
|
74
|
+
correctPaths(
|
|
75
|
+
isAbsolute(normalizedOptions.configPath) ? normalizedOptions.configPath : joinPaths(config.workspaceRoot, normalizedOptions.configPath)
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (normalizedOptions.manifestPath) {
|
|
80
|
+
normalizedOptions.manifestPath = relative(
|
|
81
|
+
normalizedOptions.cwd,
|
|
82
|
+
correctPaths(
|
|
83
|
+
isAbsolute(normalizedOptions.manifestPath) ? normalizedOptions.manifestPath : joinPaths(config.workspaceRoot, normalizedOptions.manifestPath)
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (process.env.VERCEL) {
|
|
89
|
+
return { success: true };
|
|
90
|
+
}
|
|
91
|
+
writeDebug(
|
|
92
|
+
`Normalized Napi Options:
|
|
93
|
+
packageJsonPath: ${normalizedOptions.packageJsonPath}
|
|
94
|
+
outputDir: ${normalizedOptions.outputDir}
|
|
95
|
+
targetDir: ${normalizedOptions.targetDir}
|
|
96
|
+
manifestPath: ${normalizedOptions.manifestPath}
|
|
97
|
+
configPath: ${normalizedOptions.configPath}
|
|
98
|
+
cwd: ${normalizedOptions.cwd}`,
|
|
99
|
+
config
|
|
100
|
+
);
|
|
101
|
+
const { task } = await napi.build(normalizedOptions);
|
|
102
|
+
return { success: true, terminalOutput: await task };
|
|
103
|
+
}
|
|
104
|
+
var executor_default = withRunExecutor(
|
|
105
|
+
"Napi - Build Bindings",
|
|
106
|
+
napiExecutor,
|
|
107
|
+
{
|
|
108
|
+
skipReadingConfig: false,
|
|
109
|
+
hooks: {
|
|
110
|
+
applyDefaultOptions: (options) => {
|
|
111
|
+
options.outputPath ??= "{sourceRoot}";
|
|
112
|
+
options.toolchain ??= "stable";
|
|
113
|
+
options.dtsCache ??= true;
|
|
114
|
+
options.platform ??= true;
|
|
115
|
+
options.constEnum ??= false;
|
|
116
|
+
options.verbose ??= false;
|
|
117
|
+
options.jsBinding ??= "binding.js";
|
|
118
|
+
options.dts ??= "binding.d.ts";
|
|
119
|
+
return options;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
napiExecutor,
|
|
127
|
+
executor_default
|
|
128
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__4d095a6822ae9e861869bf27b505de0b/node_modules/tsup/assets/esm_shims.js
|
|
2
2
|
import { fileURLToPath } from "url";
|
|
3
3
|
import path from "path";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
withRunExecutor
|
|
3
|
+
} from "./chunk-Y3CN5O3K.mjs";
|
|
4
|
+
import {
|
|
5
|
+
buildCargoCommand,
|
|
6
|
+
cargoCommand
|
|
7
|
+
} from "./chunk-C3G4MZGP.mjs";
|
|
8
|
+
|
|
9
|
+
// src/executors/cargo-build/executor.ts
|
|
10
|
+
async function cargoBuildExecutor(options, context) {
|
|
11
|
+
const command = buildCargoCommand("build", options, context);
|
|
12
|
+
return await cargoCommand(context.root, ...command);
|
|
13
|
+
}
|
|
14
|
+
var executor_default = withRunExecutor(
|
|
15
|
+
"Cargo - Build",
|
|
16
|
+
cargoBuildExecutor,
|
|
17
|
+
{
|
|
18
|
+
skipReadingConfig: false,
|
|
19
|
+
hooks: {
|
|
20
|
+
applyDefaultOptions: (options) => {
|
|
21
|
+
options.outputPath ??= "dist/{projectRoot}/target";
|
|
22
|
+
options.toolchain ??= "stable";
|
|
23
|
+
return options;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
cargoBuildExecutor,
|
|
31
|
+
executor_default
|
|
32
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2VQ55YPWjs = require('./chunk-2VQ55YPW.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkHYK7OVZ3js = require('./chunk-HYK7OVZ3.js');
|
|
8
|
+
|
|
9
|
+
// src/executors/cargo-doc/executor.ts
|
|
10
|
+
async function cargoDocExecutor(options, context) {
|
|
11
|
+
const opts = { ...options };
|
|
12
|
+
opts["no-deps"] = opts.noDeps;
|
|
13
|
+
delete opts.noDeps;
|
|
14
|
+
const command = _chunkHYK7OVZ3js.buildCargoCommand.call(void 0, "doc", options, context);
|
|
15
|
+
return await _chunkHYK7OVZ3js.cargoCommand.call(void 0, context.root, ...command);
|
|
16
|
+
}
|
|
17
|
+
var executor_default = _chunk2VQ55YPWjs.withRunExecutor.call(void 0,
|
|
18
|
+
"Cargo - Doc",
|
|
19
|
+
cargoDocExecutor,
|
|
20
|
+
{
|
|
21
|
+
skipReadingConfig: false,
|
|
22
|
+
hooks: {
|
|
23
|
+
applyDefaultOptions: (options) => {
|
|
24
|
+
options.outputPath ??= "dist/{projectRoot}/docs";
|
|
25
|
+
options.toolchain ??= "stable";
|
|
26
|
+
options.release ??= options.profile ? false : true;
|
|
27
|
+
options.allFeatures ??= true;
|
|
28
|
+
options.lib ??= true;
|
|
29
|
+
options.bins ??= true;
|
|
30
|
+
options.examples ??= true;
|
|
31
|
+
options.noDeps ??= false;
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
exports.cargoDocExecutor = cargoDocExecutor; exports.executor_default = executor_default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
withRunExecutor
|
|
3
|
+
} from "./chunk-Y3CN5O3K.mjs";
|
|
4
|
+
import {
|
|
5
|
+
buildCargoCommand,
|
|
6
|
+
cargoCommand
|
|
7
|
+
} from "./chunk-C3G4MZGP.mjs";
|
|
8
|
+
|
|
9
|
+
// src/executors/cargo-check/executor.ts
|
|
10
|
+
async function cargoCheckExecutor(options, context) {
|
|
11
|
+
const command = buildCargoCommand("check", options, context);
|
|
12
|
+
return await cargoCommand(context.root, ...command);
|
|
13
|
+
}
|
|
14
|
+
var executor_default = withRunExecutor(
|
|
15
|
+
"Cargo - Check",
|
|
16
|
+
cargoCheckExecutor,
|
|
17
|
+
{
|
|
18
|
+
skipReadingConfig: false,
|
|
19
|
+
hooks: {
|
|
20
|
+
applyDefaultOptions: (options) => {
|
|
21
|
+
options.toolchain ??= "stable";
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
cargoCheckExecutor,
|
|
30
|
+
executor_default
|
|
31
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkILSI74FWjs = require('./chunk-ILSI74FW.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkIZLEVS44js = require('./chunk-IZLEVS44.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunk3G7PNDZ5js = require('./chunk-3G7PNDZ5.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
|
|
14
|
+
|
|
15
|
+
// src/generators/node-library/generator.ts
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _devkit = require('@nx/devkit');
|
|
22
|
+
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
23
|
+
const filesDir = _chunkCQDBLKPFjs.joinPaths.call(void 0,
|
|
24
|
+
__dirname,
|
|
25
|
+
"src",
|
|
26
|
+
"generators",
|
|
27
|
+
"node-library",
|
|
28
|
+
"files"
|
|
29
|
+
);
|
|
30
|
+
const tsLibraryGeneratorOptions = {
|
|
31
|
+
platform: "node",
|
|
32
|
+
devDependencies: {
|
|
33
|
+
"@types/node": _chunk3G7PNDZ5js.typesNodeVersion
|
|
34
|
+
},
|
|
35
|
+
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
36
|
+
...schema,
|
|
37
|
+
directory: schema.directory,
|
|
38
|
+
description: schema.description
|
|
39
|
+
};
|
|
40
|
+
const options = await _chunkILSI74FWjs.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
|
|
41
|
+
const { className, name, propertyName } = _devkit.names.call(void 0, options.name);
|
|
42
|
+
_devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
|
|
43
|
+
...schema,
|
|
44
|
+
dot: ".",
|
|
45
|
+
className,
|
|
46
|
+
name,
|
|
47
|
+
namespace: _nullishCoalesce(process.env.STORM_NAMESPACE, () => ( "storm-software")),
|
|
48
|
+
description: _nullishCoalesce(schema.description, () => ( "")),
|
|
49
|
+
propertyName,
|
|
50
|
+
js: !!options.js,
|
|
51
|
+
cliCommand: "nx",
|
|
52
|
+
strict: void 0,
|
|
53
|
+
tmpl: "",
|
|
54
|
+
offsetFromRoot: _devkit.offsetFromRoot.call(void 0, options.projectRoot),
|
|
55
|
+
buildable: options.bundler && options.bundler !== "none",
|
|
56
|
+
hasUnitTestRunner: options.unitTestRunner !== "none"
|
|
57
|
+
});
|
|
58
|
+
await _chunkILSI74FWjs.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
|
|
59
|
+
await _devkit.formatFiles.call(void 0, tree);
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
var generator_default = _chunkIZLEVS44js.withRunGenerator.call(void 0,
|
|
63
|
+
"TypeScript Library Creator (NodeJs Platform)",
|
|
64
|
+
nodeLibraryGeneratorFn,
|
|
65
|
+
{
|
|
66
|
+
hooks: {
|
|
67
|
+
applyDefaultOptions: (options) => {
|
|
68
|
+
options.description ??= "A library used by Storm Software to support NodeJs applications";
|
|
69
|
+
options.platform ??= "node";
|
|
70
|
+
return options;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
exports.nodeLibraryGeneratorFn = nodeLibraryGeneratorFn; exports.generator_default = generator_default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProjectTagConstants,
|
|
3
|
+
isEqualProjectTag
|
|
4
|
+
} from "./chunk-2GQSCZ3J.mjs";
|
|
5
|
+
import {
|
|
6
|
+
parseCargoToml
|
|
7
|
+
} from "./chunk-UA33NH5O.mjs";
|
|
8
|
+
import {
|
|
9
|
+
joinPaths
|
|
10
|
+
} from "./chunk-TBW5MCN6.mjs";
|
|
11
|
+
|
|
12
|
+
// src/utils/package-helpers.ts
|
|
13
|
+
import {
|
|
14
|
+
joinPathFragments,
|
|
15
|
+
readJsonFile
|
|
16
|
+
} from "@nx/devkit";
|
|
17
|
+
import { execFileSync } from "child_process";
|
|
18
|
+
import { existsSync } from "node:fs";
|
|
19
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
20
|
+
import { dirname, resolve } from "path";
|
|
21
|
+
import { format } from "prettier";
|
|
22
|
+
var PackageManagerTypes = {
|
|
23
|
+
PackageJson: "package.json",
|
|
24
|
+
CargoToml: "Cargo.toml"
|
|
25
|
+
};
|
|
26
|
+
var getPackageInfo = (project) => {
|
|
27
|
+
if (isEqualProjectTag(
|
|
28
|
+
project,
|
|
29
|
+
ProjectTagConstants.Language.TAG_ID,
|
|
30
|
+
ProjectTagConstants.Language.RUST
|
|
31
|
+
) && existsSync(joinPathFragments(project.root, "Cargo.toml"))) {
|
|
32
|
+
return {
|
|
33
|
+
type: "Cargo.toml",
|
|
34
|
+
content: parseCargoToml(joinPathFragments(project.root, "Cargo.toml"))
|
|
35
|
+
};
|
|
36
|
+
} else if (isEqualProjectTag(
|
|
37
|
+
project,
|
|
38
|
+
ProjectTagConstants.Language.TAG_ID,
|
|
39
|
+
ProjectTagConstants.Language.TYPESCRIPT
|
|
40
|
+
) && existsSync(joinPathFragments(project.root, "package.json"))) {
|
|
41
|
+
return {
|
|
42
|
+
type: "package.json",
|
|
43
|
+
content: readJsonFile(
|
|
44
|
+
joinPathFragments(project.root, "package.json")
|
|
45
|
+
)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
async function addPackageJsonGitHead(packageRoot) {
|
|
51
|
+
const packageJsonPath = joinPaths(packageRoot, "package.json");
|
|
52
|
+
if (!packageJsonPath) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
"No file path provided. Please provide a valid path to the package.json file."
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
const packageJsonValue = JSON.parse(await readFile(packageJsonPath, "utf8"));
|
|
58
|
+
if (!packageJsonValue || typeof packageJsonValue !== "object") {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Invalid package.json file at ${packageJsonPath}. Please ensure it is a valid JSON file.`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
const gitHead = execFileSync("git", ["rev-parse", "HEAD"], {
|
|
64
|
+
cwd: dirname(resolve(packageJsonPath)),
|
|
65
|
+
encoding: "utf8"
|
|
66
|
+
}).trim();
|
|
67
|
+
packageJsonValue.gitHead = gitHead;
|
|
68
|
+
return writeFile(
|
|
69
|
+
packageJsonPath,
|
|
70
|
+
await format(JSON.stringify(packageJsonValue), {
|
|
71
|
+
parser: "json",
|
|
72
|
+
proseWrap: "preserve",
|
|
73
|
+
trailingComma: "none",
|
|
74
|
+
tabWidth: 2,
|
|
75
|
+
semi: true,
|
|
76
|
+
singleQuote: false,
|
|
77
|
+
quoteProps: "as-needed",
|
|
78
|
+
insertPragma: false,
|
|
79
|
+
bracketSameLine: true,
|
|
80
|
+
printWidth: 80,
|
|
81
|
+
bracketSpacing: true,
|
|
82
|
+
arrowParens: "avoid",
|
|
83
|
+
endOfLine: "lf",
|
|
84
|
+
plugins: ["prettier-plugin-packagejson"]
|
|
85
|
+
})
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
PackageManagerTypes,
|
|
91
|
+
getPackageInfo,
|
|
92
|
+
addPackageJsonGitHead
|
|
93
|
+
};
|