@storm-software/workspace-tools 1.36.3 → 1.36.5
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 +14 -0
- package/index.js +96 -94
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +42 -41
- package/src/executors/tsup/executor.js +39 -38
- package/src/executors/tsup-browser/executor.js +42 -41
- package/src/executors/tsup-neutral/executor.js +42 -41
- package/src/executors/tsup-node/executor.js +42 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.36.4](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.36.3...workspace-tools-v1.36.4) (2024-01-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **workspace-tools:** Resolved entry point issue in package.json files ([7d2c178](https://github.com/storm-software/storm-ops/commit/7d2c1780cb398f04d5937b556e7bacc76cd1bf52))
|
|
7
|
+
|
|
8
|
+
## [1.36.3](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.36.2...workspace-tools-v1.36.3) (2024-01-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **workspace-tools:** Cleaned up the logic around running `getConfig` functions ([bcc3304](https://github.com/storm-software/storm-ops/commit/bcc3304cb976e01a55030221cd5c5f4f1c22f150))
|
|
14
|
+
|
|
1
15
|
## [1.36.2](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.36.1...workspace-tools-v1.36.2) (2024-01-05)
|
|
2
16
|
|
|
3
17
|
|
package/index.js
CHANGED
|
@@ -12226,12 +12226,12 @@ var require_install_packages_task = __commonJS({
|
|
|
12226
12226
|
var child_process_1 = require("child_process");
|
|
12227
12227
|
var path_1 = require("path");
|
|
12228
12228
|
var nx_1 = require_nx();
|
|
12229
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
12229
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments8 } = (0, nx_1.requireNx)();
|
|
12230
12230
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
12231
|
-
if (!tree.listChanges().find((f) => f.path ===
|
|
12231
|
+
if (!tree.listChanges().find((f) => f.path === joinPathFragments8(cwd, "package.json")) && !alwaysRun) {
|
|
12232
12232
|
return;
|
|
12233
12233
|
}
|
|
12234
|
-
const packageJsonValue = tree.read(
|
|
12234
|
+
const packageJsonValue = tree.read(joinPathFragments8(cwd, "package.json"), "utf-8");
|
|
12235
12235
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
12236
12236
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
12237
12237
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -29020,7 +29020,7 @@ var require_boolean = __commonJS({
|
|
|
29020
29020
|
"node_modules/.pnpm/enquirer@2.3.6/node_modules/enquirer/lib/types/boolean.js"(exports, module2) {
|
|
29021
29021
|
"use strict";
|
|
29022
29022
|
var Prompt = require_prompt();
|
|
29023
|
-
var { isPrimitive
|
|
29023
|
+
var { isPrimitive, hasColor } = require_utils2();
|
|
29024
29024
|
var BooleanPrompt = class extends Prompt {
|
|
29025
29025
|
constructor(options) {
|
|
29026
29026
|
super(options);
|
|
@@ -29051,7 +29051,7 @@ var require_boolean = __commonJS({
|
|
|
29051
29051
|
return /^[fn0]/i.test(input);
|
|
29052
29052
|
}
|
|
29053
29053
|
isValue(value) {
|
|
29054
|
-
return
|
|
29054
|
+
return isPrimitive(value) && (this.isTrue(value) || this.isFalse(value));
|
|
29055
29055
|
}
|
|
29056
29056
|
async hint() {
|
|
29057
29057
|
if (this.state.status === "pending") {
|
|
@@ -29226,11 +29226,11 @@ var require_string = __commonJS({
|
|
|
29226
29226
|
"use strict";
|
|
29227
29227
|
var Prompt = require_prompt();
|
|
29228
29228
|
var placeholder = require_placeholder();
|
|
29229
|
-
var { isPrimitive
|
|
29229
|
+
var { isPrimitive } = require_utils2();
|
|
29230
29230
|
var StringPrompt = class extends Prompt {
|
|
29231
29231
|
constructor(options) {
|
|
29232
29232
|
super(options);
|
|
29233
|
-
this.initial =
|
|
29233
|
+
this.initial = isPrimitive(this.initial) ? String(this.initial) : "";
|
|
29234
29234
|
if (this.initial)
|
|
29235
29235
|
this.cursorHide();
|
|
29236
29236
|
this.state.prevCursor = 0;
|
|
@@ -30864,7 +30864,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
30864
30864
|
var nx_1 = require_nx();
|
|
30865
30865
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
30866
30866
|
var names_1 = require_names();
|
|
30867
|
-
var { joinPathFragments:
|
|
30867
|
+
var { joinPathFragments: joinPathFragments8, normalizePath, logger, readJson: readJson2, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
30868
30868
|
var deprecationWarning = stripIndents`
|
|
30869
30869
|
In Nx 18, generating projects will no longer derive the name and root.
|
|
30870
30870
|
Please provide the exact project name and root in the future.`;
|
|
@@ -30940,14 +30940,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
30940
30940
|
if (directory === relativeCwd || directory.startsWith(`${relativeCwd}/`)) {
|
|
30941
30941
|
asProvidedProjectDirectory = directory;
|
|
30942
30942
|
} else {
|
|
30943
|
-
asProvidedProjectDirectory =
|
|
30943
|
+
asProvidedProjectDirectory = joinPathFragments8(relativeCwd, directory);
|
|
30944
30944
|
}
|
|
30945
30945
|
} else if (options.rootProject) {
|
|
30946
30946
|
asProvidedProjectDirectory = ".";
|
|
30947
30947
|
} else {
|
|
30948
30948
|
asProvidedProjectDirectory = relativeCwd;
|
|
30949
30949
|
if (!relativeCwd.endsWith(asProvidedProjectName) && !relativeCwd.endsWith(options.name)) {
|
|
30950
|
-
asProvidedProjectDirectory =
|
|
30950
|
+
asProvidedProjectDirectory = joinPathFragments8(relativeCwd, asProvidedProjectName);
|
|
30951
30951
|
}
|
|
30952
30952
|
}
|
|
30953
30953
|
if (asProvidedProjectName.startsWith("@")) {
|
|
@@ -30980,7 +30980,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
30980
30980
|
const derivedSimpleProjectName = name;
|
|
30981
30981
|
let derivedProjectDirectory = derivedProjectDirectoryWithoutLayout;
|
|
30982
30982
|
if (derivedProjectDirectoryWithoutLayout !== ".") {
|
|
30983
|
-
derivedProjectDirectory =
|
|
30983
|
+
derivedProjectDirectory = joinPathFragments8(layoutDirectory, derivedProjectDirectory);
|
|
30984
30984
|
}
|
|
30985
30985
|
let derivedImportPath;
|
|
30986
30986
|
if (options.projectType === "library") {
|
|
@@ -110611,6 +110611,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
110611
110611
|
};
|
|
110612
110612
|
|
|
110613
110613
|
// packages/workspace-tools/src/base/get-tsup-config.ts
|
|
110614
|
+
var import_devkit = __toESM(require_devkit());
|
|
110614
110615
|
function defaultConfig({
|
|
110615
110616
|
entry,
|
|
110616
110617
|
outDir,
|
|
@@ -110655,7 +110656,7 @@ function defaultConfig({
|
|
|
110655
110656
|
} : false,
|
|
110656
110657
|
projectRoot,
|
|
110657
110658
|
workspaceRoot,
|
|
110658
|
-
outDir,
|
|
110659
|
+
outDir: (0, import_devkit.joinPathFragments)(outDir, "dist"),
|
|
110659
110660
|
silent: !verbose,
|
|
110660
110661
|
metafile: true,
|
|
110661
110662
|
shims,
|
|
@@ -110671,7 +110672,7 @@ function defaultConfig({
|
|
|
110671
110672
|
...dtsTsConfig,
|
|
110672
110673
|
options: {
|
|
110673
110674
|
...dtsTsConfig.options,
|
|
110674
|
-
outDir
|
|
110675
|
+
outDir: (0, import_devkit.joinPathFragments)(outDir, "dist")
|
|
110675
110676
|
}
|
|
110676
110677
|
}
|
|
110677
110678
|
},
|
|
@@ -110729,7 +110730,7 @@ var outExtension = ({ format: format2 }) => {
|
|
|
110729
110730
|
};
|
|
110730
110731
|
|
|
110731
110732
|
// packages/workspace-tools/src/base/typescript-library-generator.ts
|
|
110732
|
-
var
|
|
110733
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
110733
110734
|
var import_project_name_and_root_utils = __toESM(require_project_name_and_root_utils());
|
|
110734
110735
|
var import_js = __toESM(require_src());
|
|
110735
110736
|
var import_init = __toESM(require_init());
|
|
@@ -110766,7 +110767,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
110766
110767
|
})
|
|
110767
110768
|
);
|
|
110768
110769
|
tasks.push(
|
|
110769
|
-
(0,
|
|
110770
|
+
(0, import_devkit2.addDependenciesToPackageJson)(
|
|
110770
110771
|
tree,
|
|
110771
110772
|
{},
|
|
110772
110773
|
{
|
|
@@ -110782,16 +110783,16 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
110782
110783
|
const projectConfig = {
|
|
110783
110784
|
root: options.directory,
|
|
110784
110785
|
projectType: "library",
|
|
110785
|
-
sourceRoot: (0,
|
|
110786
|
+
sourceRoot: (0, import_devkit2.joinPathFragments)(options.directory, "src"),
|
|
110786
110787
|
targets: {
|
|
110787
110788
|
build: {
|
|
110788
110789
|
executor: schema.buildExecutor,
|
|
110789
110790
|
outputs: ["{options.outputPath}"],
|
|
110790
110791
|
options: {
|
|
110791
|
-
entry: (0,
|
|
110792
|
+
entry: (0, import_devkit2.joinPathFragments)(options.projectRoot, "src", "index.ts"),
|
|
110792
110793
|
outputPath: getOutputPath(options),
|
|
110793
|
-
tsConfig: (0,
|
|
110794
|
-
project: (0,
|
|
110794
|
+
tsConfig: (0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
110795
|
+
project: (0, import_devkit2.joinPathFragments)(options.projectRoot, "package.json"),
|
|
110795
110796
|
defaultConfiguration: "production",
|
|
110796
110797
|
assets: [
|
|
110797
110798
|
{
|
|
@@ -110823,23 +110824,23 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
110823
110824
|
};
|
|
110824
110825
|
schema.platform && (projectConfig.targets.build.options.platform = schema.platform);
|
|
110825
110826
|
createProjectTsConfigJson(tree, options);
|
|
110826
|
-
(0,
|
|
110827
|
+
(0, import_devkit2.addProjectConfiguration)(tree, options.name, projectConfig);
|
|
110827
110828
|
let repository = {
|
|
110828
110829
|
type: "github",
|
|
110829
110830
|
url: "https://github.com/storm-software/storm-stack.git"
|
|
110830
110831
|
};
|
|
110831
110832
|
let description = schema.description ?? "\u26A1 A Storm package used to create modern, scalable web applications.";
|
|
110832
110833
|
if (tree.exists("package.json")) {
|
|
110833
|
-
const packageJson = (0,
|
|
110834
|
+
const packageJson = (0, import_devkit2.readJson)(tree, "package.json");
|
|
110834
110835
|
packageJson?.repository && (repository = packageJson.repository);
|
|
110835
110836
|
packageJson?.description && (description = packageJson.description);
|
|
110836
110837
|
}
|
|
110837
|
-
const packageJsonPath = (0,
|
|
110838
|
+
const packageJsonPath = (0, import_devkit2.joinPathFragments)(
|
|
110838
110839
|
options.projectRoot,
|
|
110839
110840
|
"package.json"
|
|
110840
110841
|
);
|
|
110841
110842
|
if (tree.exists(packageJsonPath)) {
|
|
110842
|
-
(0,
|
|
110843
|
+
(0, import_devkit2.updateJson)(tree, packageJsonPath, (json) => {
|
|
110843
110844
|
json.name = options.importPath;
|
|
110844
110845
|
json.version = "0.0.1";
|
|
110845
110846
|
if (json.private && (options.publishable || options.rootProject)) {
|
|
@@ -110863,7 +110864,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
110863
110864
|
};
|
|
110864
110865
|
});
|
|
110865
110866
|
} else {
|
|
110866
|
-
(0,
|
|
110867
|
+
(0, import_devkit2.writeJson)(tree, packageJsonPath, {
|
|
110867
110868
|
name: options.importPath,
|
|
110868
110869
|
version: "0.0.1",
|
|
110869
110870
|
description,
|
|
@@ -110879,7 +110880,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
110879
110880
|
});
|
|
110880
110881
|
}
|
|
110881
110882
|
if (tree.exists("package.json")) {
|
|
110882
|
-
(0,
|
|
110883
|
+
(0, import_devkit2.updateJson)(tree, "package.json", (json) => ({
|
|
110883
110884
|
...json,
|
|
110884
110885
|
pnpm: {
|
|
110885
110886
|
...json?.pnpm,
|
|
@@ -110891,32 +110892,32 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
110891
110892
|
}));
|
|
110892
110893
|
}
|
|
110893
110894
|
(0, import_js.addTsConfigPath)(tree, options.importPath, [
|
|
110894
|
-
(0,
|
|
110895
|
+
(0, import_devkit2.joinPathFragments)(
|
|
110895
110896
|
options.projectRoot,
|
|
110896
110897
|
"./src",
|
|
110897
110898
|
"index." + (options.js ? "js" : "ts")
|
|
110898
110899
|
)
|
|
110899
110900
|
]);
|
|
110900
|
-
(0, import_js.addTsConfigPath)(tree, (0,
|
|
110901
|
-
(0,
|
|
110901
|
+
(0, import_js.addTsConfigPath)(tree, (0, import_devkit2.joinPathFragments)(options.importPath, "/*"), [
|
|
110902
|
+
(0, import_devkit2.joinPathFragments)(options.projectRoot, "./src", "/*")
|
|
110902
110903
|
]);
|
|
110903
110904
|
if (tree.exists("package.json")) {
|
|
110904
|
-
const packageJson = (0,
|
|
110905
|
+
const packageJson = (0, import_devkit2.readJson)(tree, "package.json");
|
|
110905
110906
|
packageJson?.repository && (repository = packageJson.repository);
|
|
110906
110907
|
packageJson?.description && (description = packageJson.description);
|
|
110907
110908
|
}
|
|
110908
|
-
const tsconfigPath = (0,
|
|
110909
|
+
const tsconfigPath = (0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json");
|
|
110909
110910
|
if (tree.exists(tsconfigPath)) {
|
|
110910
|
-
(0,
|
|
110911
|
+
(0, import_devkit2.updateJson)(tree, tsconfigPath, (json) => {
|
|
110911
110912
|
json.composite ??= true;
|
|
110912
110913
|
return json;
|
|
110913
110914
|
});
|
|
110914
110915
|
} else {
|
|
110915
|
-
(0,
|
|
110916
|
-
extends: `${(0,
|
|
110916
|
+
(0, import_devkit2.writeJson)(tree, tsconfigPath, {
|
|
110917
|
+
extends: `${(0, import_devkit2.offsetFromRoot)(options.projectRoot)}tsconfig.base.json`,
|
|
110917
110918
|
composite: true,
|
|
110918
110919
|
compilerOptions: {
|
|
110919
|
-
outDir: `${(0,
|
|
110920
|
+
outDir: `${(0, import_devkit2.offsetFromRoot)(options.projectRoot)}dist/out-tsc`
|
|
110920
110921
|
},
|
|
110921
110922
|
files: [],
|
|
110922
110923
|
include: ["src/**/*.ts", "src/**/*.js"],
|
|
@@ -110925,21 +110926,21 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
110925
110926
|
}
|
|
110926
110927
|
const lintCallback = await addLint(tree, options);
|
|
110927
110928
|
tasks.push(lintCallback);
|
|
110928
|
-
await (0,
|
|
110929
|
+
await (0, import_devkit2.formatFiles)(tree);
|
|
110929
110930
|
return null;
|
|
110930
110931
|
}
|
|
110931
110932
|
async function addLint(tree, options) {
|
|
110932
|
-
const { lintProjectGenerator } = (0,
|
|
110933
|
+
const { lintProjectGenerator } = (0, import_devkit2.ensurePackage)("@nx/eslint", nxVersion);
|
|
110933
110934
|
const { mapLintPattern } = (
|
|
110934
110935
|
// nx-ignore-next-line
|
|
110935
110936
|
require_lint_project()
|
|
110936
110937
|
);
|
|
110937
|
-
const projectConfiguration = (0,
|
|
110938
|
+
const projectConfiguration = (0, import_devkit2.readProjectConfiguration)(tree, options.name);
|
|
110938
110939
|
const task = lintProjectGenerator(tree, {
|
|
110939
110940
|
project: options.name,
|
|
110940
110941
|
linter: options.linter,
|
|
110941
110942
|
skipFormat: true,
|
|
110942
|
-
tsConfigPaths: [(0,
|
|
110943
|
+
tsConfigPaths: [(0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json")],
|
|
110943
110944
|
unitTestRunner: options.unitTestRunner,
|
|
110944
110945
|
eslintFilePatterns: [
|
|
110945
110946
|
mapLintPattern(
|
|
@@ -111010,7 +111011,7 @@ function getOutputPath(options) {
|
|
|
111010
111011
|
} else {
|
|
111011
111012
|
parts.push(options.projectRoot);
|
|
111012
111013
|
}
|
|
111013
|
-
return (0,
|
|
111014
|
+
return (0, import_devkit2.joinPathFragments)(...parts);
|
|
111014
111015
|
}
|
|
111015
111016
|
function createProjectTsConfigJson(tree, options) {
|
|
111016
111017
|
const tsconfig = {
|
|
@@ -111018,8 +111019,8 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
111018
111019
|
...options?.tsConfigOptions ?? {},
|
|
111019
111020
|
compilerOptions: {
|
|
111020
111021
|
...options.rootProject ? import_js.tsConfigBaseOptions : {},
|
|
111021
|
-
outDir: (0,
|
|
111022
|
-
(0,
|
|
111022
|
+
outDir: (0, import_devkit2.joinPathFragments)(
|
|
111023
|
+
(0, import_devkit2.offsetFromRoot)(options.projectRoot),
|
|
111023
111024
|
"dist/out-tsc"
|
|
111024
111025
|
),
|
|
111025
111026
|
noEmit: true,
|
|
@@ -111039,9 +111040,9 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
111039
111040
|
"src/**/*.test.ts"
|
|
111040
111041
|
]
|
|
111041
111042
|
};
|
|
111042
|
-
(0,
|
|
111043
|
+
(0, import_devkit2.writeJson)(
|
|
111043
111044
|
tree,
|
|
111044
|
-
(0,
|
|
111045
|
+
(0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
111045
111046
|
tsconfig
|
|
111046
111047
|
);
|
|
111047
111048
|
}
|
|
@@ -111057,7 +111058,7 @@ async function normalizeOptions(tree, options) {
|
|
|
111057
111058
|
if (options.publishable === false && options.buildable === false) {
|
|
111058
111059
|
bundler = "none";
|
|
111059
111060
|
}
|
|
111060
|
-
const { Linter } = (0,
|
|
111061
|
+
const { Linter } = (0, import_devkit2.ensurePackage)("@nx/eslint", nxVersion);
|
|
111061
111062
|
const {
|
|
111062
111063
|
projectName,
|
|
111063
111064
|
names: projectNames,
|
|
@@ -111073,7 +111074,7 @@ async function normalizeOptions(tree, options) {
|
|
|
111073
111074
|
callingGenerator: "@nx/js:library"
|
|
111074
111075
|
});
|
|
111075
111076
|
options.rootProject = projectRoot === ".";
|
|
111076
|
-
const normalized = (0,
|
|
111077
|
+
const normalized = (0, import_devkit2.names)(projectNames.projectFileName);
|
|
111077
111078
|
const fileName = normalized.fileName;
|
|
111078
111079
|
return {
|
|
111079
111080
|
js: false,
|
|
@@ -111131,7 +111132,7 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
111131
111132
|
|
|
111132
111133
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
111133
111134
|
var import_esbuild_decorators = __toESM(require_src2());
|
|
111134
|
-
var
|
|
111135
|
+
var import_devkit3 = __toESM(require_devkit());
|
|
111135
111136
|
var import_js2 = __toESM(require_src());
|
|
111136
111137
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
111137
111138
|
var import_tsc = __toESM(require_tsc_impl());
|
|
@@ -117443,7 +117444,7 @@ async function tsupExecutorFn(options, context) {
|
|
|
117443
117444
|
options.verbose && console.log(
|
|
117444
117445
|
`\u2699\uFE0F Executor options:
|
|
117445
117446
|
${Object.keys(options).map(
|
|
117446
|
-
(key) => `${key}: ${!options[key] ||
|
|
117447
|
+
(key) => `${key}: ${!options[key] || _isPrimitive(options[key]) ? options[key] : JSON.stringify(options[key])}`
|
|
117447
117448
|
).join("\n")}
|
|
117448
117449
|
`
|
|
117449
117450
|
);
|
|
@@ -117492,8 +117493,8 @@ ${Object.keys(options).map(
|
|
|
117492
117493
|
throw new Error("The Build process failed trying to copy assets");
|
|
117493
117494
|
}
|
|
117494
117495
|
const pathToPackageJson = (0, import_path4.join)(context.root, projectRoot, "package.json");
|
|
117495
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
117496
|
-
const workspacePackageJson = (0,
|
|
117496
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit3.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
117497
|
+
const workspacePackageJson = (0, import_devkit3.readJsonFile)(
|
|
117497
117498
|
(0, import_path4.join)(workspaceRoot, "package.json")
|
|
117498
117499
|
);
|
|
117499
117500
|
options.external = options.external || [];
|
|
@@ -117532,7 +117533,7 @@ ${Object.keys(options).map(
|
|
|
117532
117533
|
console.log(`\u26A1 Adding implicit dependency: ${key}`);
|
|
117533
117534
|
const projectConfig = projectConfigs[key];
|
|
117534
117535
|
if (projectConfig?.targets?.build) {
|
|
117535
|
-
const projectPackageJson = (0,
|
|
117536
|
+
const projectPackageJson = (0, import_devkit3.readJsonFile)(
|
|
117536
117537
|
projectConfig.targets?.build.options.project
|
|
117537
117538
|
);
|
|
117538
117539
|
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
@@ -117582,7 +117583,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117582
117583
|
entryPoints.push(options.entry);
|
|
117583
117584
|
}
|
|
117584
117585
|
if (options.emitOnAll === true) {
|
|
117585
|
-
entryPoints.push((0,
|
|
117586
|
+
entryPoints.push((0, import_devkit3.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
117586
117587
|
}
|
|
117587
117588
|
if (options.additionalEntryPoints) {
|
|
117588
117589
|
entryPoints.push(...options.additionalEntryPoints);
|
|
@@ -117594,7 +117595,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117594
117595
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
117595
117596
|
formattedPath = formattedPath.substring(2);
|
|
117596
117597
|
}
|
|
117597
|
-
let propertyKey = (0,
|
|
117598
|
+
let propertyKey = (0, import_devkit3.joinPathFragments)(
|
|
117598
117599
|
filePath.path,
|
|
117599
117600
|
removeExtension(filePath.name)
|
|
117600
117601
|
).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
@@ -117603,19 +117604,19 @@ ${externalDependencies.map((dep) => {
|
|
|
117603
117604
|
propertyKey = propertyKey.substring(1);
|
|
117604
117605
|
}
|
|
117605
117606
|
console.debug(
|
|
117606
|
-
`Trying to add entry point ${propertyKey} at "${(0,
|
|
117607
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit3.joinPathFragments)(
|
|
117607
117608
|
filePath.path,
|
|
117608
117609
|
filePath.name
|
|
117609
117610
|
)}"`
|
|
117610
117611
|
);
|
|
117611
117612
|
if (!(propertyKey in ret)) {
|
|
117612
|
-
ret[propertyKey] = (0,
|
|
117613
|
+
ret[propertyKey] = (0, import_devkit3.joinPathFragments)(filePath.path, filePath.name);
|
|
117613
117614
|
}
|
|
117614
117615
|
}
|
|
117615
117616
|
return ret;
|
|
117616
117617
|
}, {});
|
|
117617
117618
|
if (options.generatePackageJson !== false) {
|
|
117618
|
-
const projectGraph = (0,
|
|
117619
|
+
const projectGraph = (0, import_devkit3.readCachedProjectGraph)();
|
|
117619
117620
|
delete packageJson.dependencies;
|
|
117620
117621
|
externalDependencies.forEach((externalDependency) => {
|
|
117621
117622
|
const packageConfig = externalDependency.node.data;
|
|
@@ -117635,9 +117636,9 @@ ${externalDependencies.map((dep) => {
|
|
|
117635
117636
|
}
|
|
117636
117637
|
});
|
|
117637
117638
|
console.log(JSON.stringify(options.getConfig));
|
|
117638
|
-
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? [""] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117639
|
+
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117639
117640
|
packageJson.type = "module";
|
|
117640
|
-
if (distPaths.length >
|
|
117641
|
+
if (distPaths.length > 0) {
|
|
117641
117642
|
packageJson.exports ??= {
|
|
117642
117643
|
".": {
|
|
117643
117644
|
import: {
|
|
@@ -117743,10 +117744,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117743
117744
|
}
|
|
117744
117745
|
if (options.includeSrc === true) {
|
|
117745
117746
|
const files = globSync([
|
|
117746
|
-
(0,
|
|
117747
|
-
(0,
|
|
117748
|
-
(0,
|
|
117749
|
-
(0,
|
|
117747
|
+
(0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117748
|
+
(0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
117749
|
+
(0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
117750
|
+
(0, import_devkit3.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
117750
117751
|
]);
|
|
117751
117752
|
await Promise.allSettled(
|
|
117752
117753
|
files.map(
|
|
@@ -117869,7 +117870,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
117869
117870
|
);
|
|
117870
117871
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
117871
117872
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
117872
|
-
tsConfig.options.tsBuildInfoFile = (0,
|
|
117873
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit3.joinPathFragments)(
|
|
117873
117874
|
outputPath,
|
|
117874
117875
|
"tsconfig.tsbuildinfo"
|
|
117875
117876
|
);
|
|
@@ -117884,13 +117885,6 @@ var build = async (options) => {
|
|
|
117884
117885
|
await (0, import_tsup.build)(options);
|
|
117885
117886
|
}
|
|
117886
117887
|
};
|
|
117887
|
-
var isPrimitive = (value) => {
|
|
117888
|
-
try {
|
|
117889
|
-
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
117890
|
-
} catch (e) {
|
|
117891
|
-
return false;
|
|
117892
|
-
}
|
|
117893
|
-
};
|
|
117894
117888
|
var applyDefaultOptions = (options) => {
|
|
117895
117889
|
options.entry ??= "{sourceRoot}/index.ts";
|
|
117896
117890
|
options.outputPath ??= "dist/{projectRoot}";
|
|
@@ -117916,7 +117910,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117916
117910
|
options.define ??= {};
|
|
117917
117911
|
options.env ??= {};
|
|
117918
117912
|
options.verbose ??= !!process.env.CI;
|
|
117919
|
-
options.getConfig ??= defaultConfig;
|
|
117913
|
+
options.getConfig ??= { "dist": defaultConfig };
|
|
117920
117914
|
return options;
|
|
117921
117915
|
};
|
|
117922
117916
|
var executor_default = withRunExecutor(
|
|
@@ -117929,6 +117923,13 @@ var executor_default = withRunExecutor(
|
|
|
117929
117923
|
}
|
|
117930
117924
|
}
|
|
117931
117925
|
);
|
|
117926
|
+
var _isPrimitive = (value) => {
|
|
117927
|
+
try {
|
|
117928
|
+
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
117929
|
+
} catch (e) {
|
|
117930
|
+
return false;
|
|
117931
|
+
}
|
|
117932
|
+
};
|
|
117932
117933
|
var _isFunction = (value) => {
|
|
117933
117934
|
try {
|
|
117934
117935
|
return value instanceof Function || typeof value === "function" || !!(value && value.constructor && value?.call && value?.apply);
|
|
@@ -117938,7 +117939,7 @@ var _isFunction = (value) => {
|
|
|
117938
117939
|
};
|
|
117939
117940
|
|
|
117940
117941
|
// packages/workspace-tools/src/executors/tsup-neutral/get-config.ts
|
|
117941
|
-
var
|
|
117942
|
+
var import_devkit4 = __toESM(require_devkit());
|
|
117942
117943
|
function modernNeutralConfig({
|
|
117943
117944
|
entry,
|
|
117944
117945
|
outDir,
|
|
@@ -117962,7 +117963,7 @@ function modernNeutralConfig({
|
|
|
117962
117963
|
generatePackageJson,
|
|
117963
117964
|
dtsTsConfig
|
|
117964
117965
|
}) {
|
|
117965
|
-
let outputPath = (0,
|
|
117966
|
+
let outputPath = (0, import_devkit4.joinPathFragments)(outDir, "dist", "modern");
|
|
117966
117967
|
return {
|
|
117967
117968
|
name: "modern",
|
|
117968
117969
|
entry,
|
|
@@ -118041,7 +118042,7 @@ function legacyNeutralConfig({
|
|
|
118041
118042
|
generatePackageJson,
|
|
118042
118043
|
dtsTsConfig
|
|
118043
118044
|
}) {
|
|
118044
|
-
let outputPath = (0,
|
|
118045
|
+
let outputPath = (0, import_devkit4.joinPathFragments)(outDir, "dist", "legacy");
|
|
118045
118046
|
return {
|
|
118046
118047
|
name: "legacy",
|
|
118047
118048
|
entry,
|
|
@@ -118142,6 +118143,7 @@ var executor_default2 = withRunExecutor(
|
|
|
118142
118143
|
);
|
|
118143
118144
|
|
|
118144
118145
|
// packages/workspace-tools/src/executors/tsup-node/get-config.ts
|
|
118146
|
+
var import_devkit5 = __toESM(require_devkit());
|
|
118145
118147
|
function nodeConfig({
|
|
118146
118148
|
entry,
|
|
118147
118149
|
outDir,
|
|
@@ -118178,7 +118180,7 @@ function nodeConfig({
|
|
|
118178
118180
|
} : false,
|
|
118179
118181
|
projectRoot,
|
|
118180
118182
|
workspaceRoot,
|
|
118181
|
-
outDir,
|
|
118183
|
+
outDir: (0, import_devkit5.joinPathFragments)(outDir, "dist"),
|
|
118182
118184
|
silent: !verbose,
|
|
118183
118185
|
metafile: true,
|
|
118184
118186
|
shims,
|
|
@@ -118194,7 +118196,7 @@ function nodeConfig({
|
|
|
118194
118196
|
...dtsTsConfig,
|
|
118195
118197
|
options: {
|
|
118196
118198
|
...dtsTsConfig.options,
|
|
118197
|
-
outDir
|
|
118199
|
+
outDir: (0, import_devkit5.joinPathFragments)(outDir, "dist")
|
|
118198
118200
|
}
|
|
118199
118201
|
}
|
|
118200
118202
|
},
|
|
@@ -118258,7 +118260,7 @@ var executor_default3 = withRunExecutor(
|
|
|
118258
118260
|
);
|
|
118259
118261
|
|
|
118260
118262
|
// packages/workspace-tools/src/generators/config-schema/generator.ts
|
|
118261
|
-
var
|
|
118263
|
+
var import_devkit6 = __toESM(require_devkit());
|
|
118262
118264
|
var import_fs5 = require("fs");
|
|
118263
118265
|
var import_path5 = require("path");
|
|
118264
118266
|
|
|
@@ -119310,12 +119312,12 @@ async function configSchemaGeneratorFn(tree, options) {
|
|
|
119310
119312
|
const ModulesSchema = unionType([workspaceSchema, StormConfigSchema]).describe(
|
|
119311
119313
|
"The values set in the Storm config file. This file is expected to be named `storm.config.js` and be located in the root of the workspace"
|
|
119312
119314
|
);
|
|
119313
|
-
(0,
|
|
119315
|
+
(0, import_devkit6.writeJson)(
|
|
119314
119316
|
tree,
|
|
119315
119317
|
options.outputFile ? (0, import_path5.join)(workspaceRoot, options.outputFile) : (0, import_path5.join)(workspaceRoot, "storm.schema.json"),
|
|
119316
119318
|
zodToJsonSchema(ModulesSchema, "StormConfig")
|
|
119317
119319
|
);
|
|
119318
|
-
await (0,
|
|
119320
|
+
await (0, import_devkit6.formatFiles)(tree);
|
|
119319
119321
|
return null;
|
|
119320
119322
|
}
|
|
119321
119323
|
var generator_default = withRunGenerator(
|
|
@@ -119324,9 +119326,9 @@ var generator_default = withRunGenerator(
|
|
|
119324
119326
|
);
|
|
119325
119327
|
|
|
119326
119328
|
// packages/workspace-tools/src/generators/init/init.ts
|
|
119327
|
-
var
|
|
119329
|
+
var import_devkit7 = __toESM(require_devkit());
|
|
119328
119330
|
async function stormInitGenerator(tree, schema) {
|
|
119329
|
-
const task = (0,
|
|
119331
|
+
const task = (0, import_devkit7.addDependenciesToPackageJson)(
|
|
119330
119332
|
tree,
|
|
119331
119333
|
{
|
|
119332
119334
|
"nx": nxVersion,
|
|
@@ -119339,15 +119341,15 @@ async function stormInitGenerator(tree, schema) {
|
|
|
119339
119341
|
{}
|
|
119340
119342
|
);
|
|
119341
119343
|
if (!schema.skipFormat) {
|
|
119342
|
-
await (0,
|
|
119344
|
+
await (0, import_devkit7.formatFiles)(tree);
|
|
119343
119345
|
}
|
|
119344
119346
|
return task;
|
|
119345
119347
|
}
|
|
119346
119348
|
|
|
119347
119349
|
// packages/workspace-tools/src/generators/node-library/generator.ts
|
|
119348
|
-
var
|
|
119350
|
+
var import_devkit8 = __toESM(require_devkit());
|
|
119349
119351
|
async function nodeLibraryGeneratorFn(tree, schema) {
|
|
119350
|
-
const filesDir = (0,
|
|
119352
|
+
const filesDir = (0, import_devkit8.joinPathFragments)(__dirname, "./files");
|
|
119351
119353
|
const tsLibraryGeneratorOptions = {
|
|
119352
119354
|
...schema,
|
|
119353
119355
|
platform: "node",
|
|
@@ -119357,10 +119359,10 @@ async function nodeLibraryGeneratorFn(tree, schema) {
|
|
|
119357
119359
|
buildExecutor: "@storm-software/workspace-tools:tsup-node"
|
|
119358
119360
|
};
|
|
119359
119361
|
const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
|
|
119360
|
-
const { className, name, propertyName } = (0,
|
|
119362
|
+
const { className, name, propertyName } = (0, import_devkit8.names)(
|
|
119361
119363
|
options.projectNames.projectFileName
|
|
119362
119364
|
);
|
|
119363
|
-
(0,
|
|
119365
|
+
(0, import_devkit8.generateFiles)(tree, filesDir, options.projectRoot, {
|
|
119364
119366
|
...schema,
|
|
119365
119367
|
dot: ".",
|
|
119366
119368
|
className,
|
|
@@ -119372,12 +119374,12 @@ async function nodeLibraryGeneratorFn(tree, schema) {
|
|
|
119372
119374
|
cliCommand: "nx",
|
|
119373
119375
|
strict: void 0,
|
|
119374
119376
|
tmpl: "",
|
|
119375
|
-
offsetFromRoot: (0,
|
|
119377
|
+
offsetFromRoot: (0, import_devkit8.offsetFromRoot)(options.projectRoot),
|
|
119376
119378
|
buildable: options.bundler && options.bundler !== "none",
|
|
119377
119379
|
hasUnitTestRunner: options.unitTestRunner !== "none"
|
|
119378
119380
|
});
|
|
119379
119381
|
await typeScriptLibraryGeneratorFn(tree, tsLibraryGeneratorOptions);
|
|
119380
|
-
await (0,
|
|
119382
|
+
await (0, import_devkit8.formatFiles)(tree);
|
|
119381
119383
|
return null;
|
|
119382
119384
|
}
|
|
119383
119385
|
var generator_default2 = withRunGenerator(
|
|
@@ -119386,13 +119388,13 @@ var generator_default2 = withRunGenerator(
|
|
|
119386
119388
|
);
|
|
119387
119389
|
|
|
119388
119390
|
// packages/workspace-tools/src/generators/preset/generator.ts
|
|
119389
|
-
var
|
|
119391
|
+
var import_devkit9 = __toESM(require_devkit());
|
|
119390
119392
|
var path2 = __toESM(require("path"));
|
|
119391
119393
|
async function presetGeneratorFn(tree, options) {
|
|
119392
119394
|
const projectRoot = `.`;
|
|
119393
119395
|
options.description ??= `\u26A1The ${options.namespace ? options.namespace : options.name} monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.`;
|
|
119394
119396
|
options.namespace ??= options.organization;
|
|
119395
|
-
(0,
|
|
119397
|
+
(0, import_devkit9.addProjectConfiguration)(tree, `@${options.namespace}/${options.name}`, {
|
|
119396
119398
|
root: projectRoot,
|
|
119397
119399
|
projectType: "application",
|
|
119398
119400
|
targets: {
|
|
@@ -119406,7 +119408,7 @@ async function presetGeneratorFn(tree, options) {
|
|
|
119406
119408
|
}
|
|
119407
119409
|
}
|
|
119408
119410
|
});
|
|
119409
|
-
(0,
|
|
119411
|
+
(0, import_devkit9.updateJson)(tree, "package.json", (json) => {
|
|
119410
119412
|
json.scripts = json.scripts || {};
|
|
119411
119413
|
json.version = "0.0.0";
|
|
119412
119414
|
json.triggerEmptyDevReleaseByIncrementingThisNumber = 0;
|
|
@@ -119530,12 +119532,12 @@ async function presetGeneratorFn(tree, options) {
|
|
|
119530
119532
|
};
|
|
119531
119533
|
return json;
|
|
119532
119534
|
});
|
|
119533
|
-
(0,
|
|
119535
|
+
(0, import_devkit9.generateFiles)(tree, path2.join(__dirname, "files"), projectRoot, {
|
|
119534
119536
|
...options,
|
|
119535
119537
|
pnpmVersion,
|
|
119536
119538
|
nodeVersion
|
|
119537
119539
|
});
|
|
119538
|
-
await (0,
|
|
119540
|
+
await (0, import_devkit9.formatFiles)(tree);
|
|
119539
119541
|
let dependencies = {
|
|
119540
119542
|
"@eslint/eslintrc": "^2.1.3",
|
|
119541
119543
|
"@nx/devkit": "^17.0.3",
|
|
@@ -119601,11 +119603,11 @@ async function presetGeneratorFn(tree, options) {
|
|
|
119601
119603
|
};
|
|
119602
119604
|
}
|
|
119603
119605
|
await Promise.resolve(
|
|
119604
|
-
(0,
|
|
119606
|
+
(0, import_devkit9.addDependenciesToPackageJson)(
|
|
119605
119607
|
tree,
|
|
119606
119608
|
dependencies,
|
|
119607
119609
|
{},
|
|
119608
|
-
(0,
|
|
119610
|
+
(0, import_devkit9.joinPathFragments)(projectRoot, "package.json")
|
|
119609
119611
|
)
|
|
119610
119612
|
);
|
|
119611
119613
|
return null;
|