@storm-software/workspace-tools 1.294.40 → 1.294.42

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.
@@ -1,93 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkUHTWNVEZjs = require('./chunk-UHTWNVEZ.js');
5
-
6
-
7
- var _chunkK2HA4BJNjs = require('./chunk-K2HA4BJN.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 (_chunkUHTWNVEZjs.isEqualProjectTag.call(void 0,
28
- project,
29
- _chunkUHTWNVEZjs.ProjectTagConstants.Language.TAG_ID,
30
- _chunkUHTWNVEZjs.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: _chunkK2HA4BJNjs.parseCargoToml.call(void 0, _devkit.joinPathFragments.call(void 0, project.root, "Cargo.toml"))
35
- };
36
- } else if (_chunkUHTWNVEZjs.isEqualProjectTag.call(void 0,
37
- project,
38
- _chunkUHTWNVEZjs.ProjectTagConstants.Language.TAG_ID,
39
- _chunkUHTWNVEZjs.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;
@@ -1,41 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk2DEV7MTDjs = require('./chunk-2DEV7MTD.js');
4
-
5
-
6
-
7
- var _chunkD2PV33E5js = require('./chunk-D2PV33E5.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 = _chunkD2PV33E5js.buildCargoCommand.call(void 0, "doc", options, context);
15
- return await _chunkD2PV33E5js.cargoCommand.call(void 0, context.root, ...command);
16
- }
17
- var executor_default = _chunk2DEV7MTDjs.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;
@@ -1,41 +0,0 @@
1
- import {
2
- withRunExecutor
3
- } from "./chunk-S3RWO7R6.mjs";
4
- import {
5
- buildCargoCommand,
6
- cargoCommand
7
- } from "./chunk-ZTN2676G.mjs";
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 = buildCargoCommand("doc", options, context);
15
- return await cargoCommand(context.root, ...command);
16
- }
17
- var executor_default = withRunExecutor(
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
- export {
39
- cargoDocExecutor,
40
- executor_default
41
- };
@@ -1,32 +0,0 @@
1
- import {
2
- withRunExecutor
3
- } from "./chunk-S3RWO7R6.mjs";
4
- import {
5
- buildCargoCommand,
6
- cargoCommand
7
- } from "./chunk-ZTN2676G.mjs";
8
-
9
- // src/executors/cargo-format/executor.ts
10
- async function cargoFormatExecutor(options, context) {
11
- const command = buildCargoCommand("fmt", options, context);
12
- return await cargoCommand(context.root, ...command);
13
- }
14
- var executor_default = withRunExecutor(
15
- "Cargo - Format",
16
- cargoFormatExecutor,
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
- cargoFormatExecutor,
31
- executor_default
32
- };
@@ -1,116 +0,0 @@
1
- import {
2
- withRunExecutor
3
- } from "./chunk-S3RWO7R6.mjs";
4
- import {
5
- cargoMetadata
6
- } from "./chunk-ZTN2676G.mjs";
7
- import {
8
- correctPaths,
9
- isAbsolute,
10
- joinPaths,
11
- relative
12
- } from "./chunk-TBW5MCN6.mjs";
13
-
14
- // src/executors/napi/executor.ts
15
- import { createJiti } from "jiti";
16
- import { fileExists } from "nx/src/utils/fileutils";
17
- async function napiExecutor(options, context, config) {
18
- const jiti = createJiti(config.workspaceRoot, {
19
- fsCache: config.skipCache ? false : joinPaths(
20
- config.workspaceRoot,
21
- config.directories.cache || "node_modules/.cache/storm",
22
- "jiti"
23
- ),
24
- interopDefault: true
25
- });
26
- const { NapiCli } = await jiti.import(
27
- jiti.esmResolve("@napi-rs/cli")
28
- );
29
- if (!context.projectGraph?.nodes[context.projectName ?? ""]) {
30
- throw new Error(
31
- "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."
32
- );
33
- }
34
- const projectRoot = context.projectGraph?.nodes[context.projectName ?? ""].data.root;
35
- const packageJson = joinPaths(projectRoot ?? ".", "package.json");
36
- if (!fileExists(packageJson)) {
37
- throw new Error(`Could not find package.json at ${packageJson}`);
38
- }
39
- const napi = new NapiCli();
40
- const normalizedOptions = { ...options };
41
- const metadata = cargoMetadata();
42
- normalizedOptions.targetDir = options.targetDir || metadata?.target_directory || joinPaths(config.workspaceRoot, "dist", "target");
43
- normalizedOptions.outputDir = options.outputPath;
44
- normalizedOptions.packageJsonPath = options.packageJsonPath || packageJson;
45
- if (options.cwd) {
46
- normalizedOptions.cwd = correctPaths(options.cwd);
47
- } else {
48
- normalizedOptions.cwd = correctPaths(projectRoot);
49
- const absoluteProjectRoot = joinPaths(
50
- config.workspaceRoot,
51
- projectRoot || "."
52
- );
53
- if (normalizedOptions.outputDir) {
54
- normalizedOptions.outputDir = relative(
55
- absoluteProjectRoot,
56
- correctPaths(
57
- isAbsolute(normalizedOptions.outputDir) ? normalizedOptions.outputDir : joinPaths(config.workspaceRoot, normalizedOptions.outputDir)
58
- )
59
- );
60
- }
61
- if (normalizedOptions.packageJsonPath) {
62
- normalizedOptions.packageJsonPath = relative(
63
- absoluteProjectRoot,
64
- correctPaths(
65
- isAbsolute(normalizedOptions.packageJsonPath) ? normalizedOptions.packageJsonPath : joinPaths(config.workspaceRoot, normalizedOptions.packageJsonPath)
66
- )
67
- );
68
- }
69
- if (normalizedOptions.configPath) {
70
- normalizedOptions.configPath = relative(
71
- absoluteProjectRoot,
72
- correctPaths(
73
- isAbsolute(normalizedOptions.configPath) ? normalizedOptions.configPath : joinPaths(config.workspaceRoot, normalizedOptions.configPath)
74
- )
75
- );
76
- }
77
- if (normalizedOptions.manifestPath) {
78
- normalizedOptions.manifestPath = relative(
79
- absoluteProjectRoot,
80
- correctPaths(
81
- isAbsolute(normalizedOptions.manifestPath) ? normalizedOptions.manifestPath : joinPaths(config.workspaceRoot, normalizedOptions.manifestPath)
82
- )
83
- );
84
- }
85
- }
86
- if (process.env.VERCEL) {
87
- return { success: true };
88
- }
89
- const { task } = await napi.build(normalizedOptions);
90
- return { success: true, terminalOutput: await task };
91
- }
92
- var executor_default = withRunExecutor(
93
- "Napi - Build Bindings",
94
- napiExecutor,
95
- {
96
- skipReadingConfig: false,
97
- hooks: {
98
- applyDefaultOptions: (options) => {
99
- options.outputPath ??= "{sourceRoot}";
100
- options.toolchain ??= "stable";
101
- options.dtsCache ??= true;
102
- options.platform ??= true;
103
- options.constEnum ??= false;
104
- options.verbose ??= false;
105
- options.jsBinding ??= "binding.js";
106
- options.dts ??= "binding.d.ts";
107
- return options;
108
- }
109
- }
110
- }
111
- );
112
-
113
- export {
114
- napiExecutor,
115
- executor_default
116
- };
@@ -1,31 +0,0 @@
1
- import {
2
- withRunExecutor
3
- } from "./chunk-S3RWO7R6.mjs";
4
- import {
5
- buildCargoCommand,
6
- cargoCommand
7
- } from "./chunk-ZTN2676G.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
- };