@storm-software/workspace-tools 1.27.0 → 1.29.0
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/executors.json +5 -0
- package/generators.json +5 -0
- package/index.js +165 -118
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +94 -59
- package/src/executors/tsup/get-config.js +18427 -627
- package/src/executors/tsup/schema.json +1 -1
- package/src/executors/tsup-browser/executor.js +117986 -0
- package/src/executors/tsup-browser/schema.d.ts +9 -0
- package/src/executors/tsup-browser/schema.json +11 -0
- package/src/executors/tsup-neutral/executor.js +94 -59
- package/src/executors/tsup-node/executor.js +94 -59
- package/src/generators/browser-library/files/README.md +58 -0
- package/src/generators/browser-library/files/jest.config.ts +3 -0
- package/src/generators/browser-library/files/src/index.ts.template +10 -0
- package/src/generators/browser-library/files/tsconfig.spec.json +13 -0
- package/src/generators/browser-library/generator.js +48471 -0
- package/src/generators/browser-library/schema.d.ts +22 -0
- package/src/generators/browser-library/schema.json +82 -0
- package/src/generators/neutral-library/generator.js +48445 -0
- package/src/generators/node-library/generator.js +17 -5
|
@@ -12458,12 +12458,12 @@ var require_install_packages_task = __commonJS({
|
|
|
12458
12458
|
var child_process_1 = require("child_process");
|
|
12459
12459
|
var path_1 = require("path");
|
|
12460
12460
|
var nx_1 = require_nx();
|
|
12461
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
12461
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments3 } = (0, nx_1.requireNx)();
|
|
12462
12462
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
12463
|
-
if (!tree.listChanges().find((f) => f.path ===
|
|
12463
|
+
if (!tree.listChanges().find((f) => f.path === joinPathFragments3(cwd, "package.json")) && !alwaysRun) {
|
|
12464
12464
|
return;
|
|
12465
12465
|
}
|
|
12466
|
-
const packageJsonValue = tree.read(
|
|
12466
|
+
const packageJsonValue = tree.read(joinPathFragments3(cwd, "package.json"), "utf-8");
|
|
12467
12467
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
12468
12468
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
12469
12469
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -41784,7 +41784,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41784
41784
|
var nx_1 = require_nx();
|
|
41785
41785
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
41786
41786
|
var names_1 = require_names();
|
|
41787
|
-
var { joinPathFragments:
|
|
41787
|
+
var { joinPathFragments: joinPathFragments3, normalizePath, logger, readJson, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
41788
41788
|
var deprecationWarning = stripIndents`
|
|
41789
41789
|
In Nx 18, generating projects will no longer derive the name and root.
|
|
41790
41790
|
Please provide the exact project name and root in the future.`;
|
|
@@ -41860,14 +41860,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41860
41860
|
if (directory === relativeCwd || directory.startsWith(`${relativeCwd}/`)) {
|
|
41861
41861
|
asProvidedProjectDirectory = directory;
|
|
41862
41862
|
} else {
|
|
41863
|
-
asProvidedProjectDirectory =
|
|
41863
|
+
asProvidedProjectDirectory = joinPathFragments3(relativeCwd, directory);
|
|
41864
41864
|
}
|
|
41865
41865
|
} else if (options.rootProject) {
|
|
41866
41866
|
asProvidedProjectDirectory = ".";
|
|
41867
41867
|
} else {
|
|
41868
41868
|
asProvidedProjectDirectory = relativeCwd;
|
|
41869
41869
|
if (!relativeCwd.endsWith(asProvidedProjectName) && !relativeCwd.endsWith(options.name)) {
|
|
41870
|
-
asProvidedProjectDirectory =
|
|
41870
|
+
asProvidedProjectDirectory = joinPathFragments3(relativeCwd, asProvidedProjectName);
|
|
41871
41871
|
}
|
|
41872
41872
|
}
|
|
41873
41873
|
if (asProvidedProjectName.startsWith("@")) {
|
|
@@ -41900,7 +41900,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41900
41900
|
const derivedSimpleProjectName = name;
|
|
41901
41901
|
let derivedProjectDirectory = derivedProjectDirectoryWithoutLayout;
|
|
41902
41902
|
if (derivedProjectDirectoryWithoutLayout !== ".") {
|
|
41903
|
-
derivedProjectDirectory =
|
|
41903
|
+
derivedProjectDirectory = joinPathFragments3(layoutDirectory, derivedProjectDirectory);
|
|
41904
41904
|
}
|
|
41905
41905
|
let derivedImportPath;
|
|
41906
41906
|
if (options.projectType === "library") {
|
|
@@ -49563,7 +49563,7 @@ var require_dist2 = __commonJS({
|
|
|
49563
49563
|
loadTsConfig: () => loadTsConfig2
|
|
49564
49564
|
});
|
|
49565
49565
|
module2.exports = __toCommonJS2(src_exports);
|
|
49566
|
-
var
|
|
49566
|
+
var import_path4 = __toESM2(require("path"), 1);
|
|
49567
49567
|
var import_fs4 = __toESM2(require("fs"), 1);
|
|
49568
49568
|
var singleComment = Symbol("singleComment");
|
|
49569
49569
|
var multiComment = Symbol("multiComment");
|
|
@@ -49659,10 +49659,10 @@ var require_dist2 = __commonJS({
|
|
|
49659
49659
|
}
|
|
49660
49660
|
}
|
|
49661
49661
|
var req = false ? createRequire(import_meta.url) : require;
|
|
49662
|
-
var findUp = (name, startDir, stopDir =
|
|
49662
|
+
var findUp = (name, startDir, stopDir = import_path4.default.parse(startDir).root) => {
|
|
49663
49663
|
let dir = startDir;
|
|
49664
49664
|
while (dir !== stopDir) {
|
|
49665
|
-
const file =
|
|
49665
|
+
const file = import_path4.default.join(dir, name);
|
|
49666
49666
|
if (import_fs4.default.existsSync(file))
|
|
49667
49667
|
return file;
|
|
49668
49668
|
if (!file.endsWith(".json")) {
|
|
@@ -49670,17 +49670,17 @@ var require_dist2 = __commonJS({
|
|
|
49670
49670
|
if (import_fs4.default.existsSync(fileWithExt))
|
|
49671
49671
|
return fileWithExt;
|
|
49672
49672
|
}
|
|
49673
|
-
dir =
|
|
49673
|
+
dir = import_path4.default.dirname(dir);
|
|
49674
49674
|
}
|
|
49675
49675
|
return null;
|
|
49676
49676
|
};
|
|
49677
49677
|
var resolveTsConfigFromFile = (cwd, filename) => {
|
|
49678
|
-
if (
|
|
49678
|
+
if (import_path4.default.isAbsolute(filename))
|
|
49679
49679
|
return import_fs4.default.existsSync(filename) ? filename : null;
|
|
49680
49680
|
return findUp(filename, cwd);
|
|
49681
49681
|
};
|
|
49682
49682
|
var resolveTsConfigFromExtends = (cwd, name) => {
|
|
49683
|
-
if (
|
|
49683
|
+
if (import_path4.default.isAbsolute(name))
|
|
49684
49684
|
return import_fs4.default.existsSync(name) ? name : null;
|
|
49685
49685
|
if (name.startsWith("."))
|
|
49686
49686
|
return findUp(name, cwd);
|
|
@@ -49689,14 +49689,14 @@ var require_dist2 = __commonJS({
|
|
|
49689
49689
|
};
|
|
49690
49690
|
var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExtends = false) => {
|
|
49691
49691
|
var _a, _b;
|
|
49692
|
-
dir =
|
|
49692
|
+
dir = import_path4.default.resolve(dir);
|
|
49693
49693
|
const id = isExtends ? resolveTsConfigFromExtends(dir, name) : resolveTsConfigFromFile(dir, name);
|
|
49694
49694
|
if (!id)
|
|
49695
49695
|
return null;
|
|
49696
49696
|
const data = jsoncParse(import_fs4.default.readFileSync(id, "utf-8"));
|
|
49697
|
-
const configDir =
|
|
49697
|
+
const configDir = import_path4.default.dirname(id);
|
|
49698
49698
|
if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) {
|
|
49699
|
-
data.compilerOptions.baseUrl =
|
|
49699
|
+
data.compilerOptions.baseUrl = import_path4.default.join(
|
|
49700
49700
|
configDir,
|
|
49701
49701
|
data.compilerOptions.baseUrl
|
|
49702
49702
|
);
|
|
@@ -49779,11 +49779,11 @@ var require_dist3 = __commonJS({
|
|
|
49779
49779
|
var import_esbuild = require("esbuild");
|
|
49780
49780
|
var import_load_tsconfig = require_dist2();
|
|
49781
49781
|
var import_fs4 = __toESM2(require("fs"), 1);
|
|
49782
|
-
var
|
|
49782
|
+
var import_path4 = __toESM2(require("path"), 1);
|
|
49783
49783
|
var getPkgType = () => {
|
|
49784
49784
|
try {
|
|
49785
49785
|
const pkg = JSON.parse(
|
|
49786
|
-
import_fs4.default.readFileSync(
|
|
49786
|
+
import_fs4.default.readFileSync(import_path4.default.resolve("package.json"), "utf-8")
|
|
49787
49787
|
);
|
|
49788
49788
|
return pkg.type;
|
|
49789
49789
|
} catch (error) {
|
|
@@ -49792,7 +49792,7 @@ var require_dist3 = __commonJS({
|
|
|
49792
49792
|
function guessFormat(inputFile) {
|
|
49793
49793
|
if (!usingDynamicImport)
|
|
49794
49794
|
return "cjs";
|
|
49795
|
-
const ext2 =
|
|
49795
|
+
const ext2 = import_path4.default.extname(inputFile);
|
|
49796
49796
|
const type = getPkgType();
|
|
49797
49797
|
if (ext2 === ".js") {
|
|
49798
49798
|
return type === "module" ? "esm" : "cjs";
|
|
@@ -75530,7 +75530,7 @@ var require_util6 = __commonJS({
|
|
|
75530
75530
|
var normalize2 = createSafeHandler((url) => {
|
|
75531
75531
|
});
|
|
75532
75532
|
exports.normalize = normalize2;
|
|
75533
|
-
function
|
|
75533
|
+
function join3(aRoot, aPath) {
|
|
75534
75534
|
const pathType = getURLType(aPath);
|
|
75535
75535
|
const rootType = getURLType(aRoot);
|
|
75536
75536
|
aRoot = ensureDirectory(aRoot);
|
|
@@ -75556,7 +75556,7 @@ var require_util6 = __commonJS({
|
|
|
75556
75556
|
const newPath = withBase(aPath, withBase(aRoot, base));
|
|
75557
75557
|
return computeRelativeURL(base, newPath);
|
|
75558
75558
|
}
|
|
75559
|
-
exports.join =
|
|
75559
|
+
exports.join = join3;
|
|
75560
75560
|
function relative(rootURL, targetURL) {
|
|
75561
75561
|
const result = relativeIfPossible(rootURL, targetURL);
|
|
75562
75562
|
return typeof result === "string" ? result : normalize2(targetURL);
|
|
@@ -75586,9 +75586,9 @@ var require_util6 = __commonJS({
|
|
|
75586
75586
|
}
|
|
75587
75587
|
let url = normalize2(sourceURL || "");
|
|
75588
75588
|
if (sourceRoot)
|
|
75589
|
-
url =
|
|
75589
|
+
url = join3(sourceRoot, url);
|
|
75590
75590
|
if (sourceMapURL)
|
|
75591
|
-
url =
|
|
75591
|
+
url = join3(trimFilename(sourceMapURL), url);
|
|
75592
75592
|
return url;
|
|
75593
75593
|
}
|
|
75594
75594
|
exports.computeSourceURL = computeSourceURL;
|
|
@@ -77354,7 +77354,7 @@ var require_source_map = __commonJS({
|
|
|
77354
77354
|
var require_native = __commonJS({
|
|
77355
77355
|
"node_modules/.pnpm/rollup@4.5.0/node_modules/rollup/dist/native.js"(exports, module2) {
|
|
77356
77356
|
var { existsSync: existsSync2 } = require("node:fs");
|
|
77357
|
-
var { join:
|
|
77357
|
+
var { join: join3 } = require("node:path");
|
|
77358
77358
|
var { platform, arch, report } = require("node:process");
|
|
77359
77359
|
var isMusl = () => !report.getReport().header.glibcVersionRuntime;
|
|
77360
77360
|
var bindingsByPlatformAndArch = {
|
|
@@ -77404,7 +77404,7 @@ If this is important to you, please consider supporting Rollup to make a native
|
|
|
77404
77404
|
return imported.base;
|
|
77405
77405
|
}
|
|
77406
77406
|
var localName = `./rollup.${packageBase}.node`;
|
|
77407
|
-
var { parse, parseAsync, xxhashBase64Url } = existsSync2(
|
|
77407
|
+
var { parse, parseAsync, xxhashBase64Url } = existsSync2(join3(__dirname, localName)) ? require(localName) : require(`@rollup/rollup-${packageBase}`);
|
|
77408
77408
|
module2.exports.parse = parse;
|
|
77409
77409
|
module2.exports.parseAsync = parseAsync;
|
|
77410
77410
|
module2.exports.xxhashBase64Url = xxhashBase64Url;
|
|
@@ -110771,7 +110771,7 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
110771
110771
|
|
|
110772
110772
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
110773
110773
|
var import_esbuild_decorators = __toESM(require_src());
|
|
110774
|
-
var
|
|
110774
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
110775
110775
|
var import_get_extra_dependencies = __toESM(require_get_extra_dependencies());
|
|
110776
110776
|
var import_js = __toESM(require_src2());
|
|
110777
110777
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
@@ -117000,7 +117000,7 @@ glob.glob = glob;
|
|
|
117000
117000
|
|
|
117001
117001
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
117002
117002
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
117003
|
-
var
|
|
117003
|
+
var import_path3 = require("path");
|
|
117004
117004
|
var import_prettier = require("prettier");
|
|
117005
117005
|
var import_tsup2 = __toESM(require_dist6());
|
|
117006
117006
|
var ts = __toESM(require("typescript"));
|
|
@@ -117011,7 +117011,7 @@ var removeExtension = (filePath) => {
|
|
|
117011
117011
|
};
|
|
117012
117012
|
|
|
117013
117013
|
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
117014
|
-
var
|
|
117014
|
+
var import_devkit = __toESM(require_devkit());
|
|
117015
117015
|
var import_tsup = __toESM(require_dist6());
|
|
117016
117016
|
function modernConfig({
|
|
117017
117017
|
entry,
|
|
@@ -117036,7 +117036,7 @@ function modernConfig({
|
|
|
117036
117036
|
generatePackageJson,
|
|
117037
117037
|
dtsTsConfig
|
|
117038
117038
|
}) {
|
|
117039
|
-
let outputPath = (0,
|
|
117039
|
+
let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist", "modern");
|
|
117040
117040
|
return {
|
|
117041
117041
|
name: "modern",
|
|
117042
117042
|
entry,
|
|
@@ -117115,7 +117115,7 @@ function legacyConfig({
|
|
|
117115
117115
|
generatePackageJson,
|
|
117116
117116
|
dtsTsConfig
|
|
117117
117117
|
}) {
|
|
117118
|
-
let outputPath = (0,
|
|
117118
|
+
let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist", "legacy");
|
|
117119
117119
|
return {
|
|
117120
117120
|
name: "legacy",
|
|
117121
117121
|
entry,
|
|
@@ -117181,14 +117181,14 @@ function workerConfig({
|
|
|
117181
117181
|
apiReport = true,
|
|
117182
117182
|
docModel = true,
|
|
117183
117183
|
tsdocMetadata = true,
|
|
117184
|
-
shims =
|
|
117184
|
+
shims = true,
|
|
117185
117185
|
define: define2,
|
|
117186
117186
|
env,
|
|
117187
117187
|
plugins,
|
|
117188
117188
|
generatePackageJson,
|
|
117189
117189
|
dtsTsConfig
|
|
117190
117190
|
}) {
|
|
117191
|
-
let outputPath = (0,
|
|
117191
|
+
let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist");
|
|
117192
117192
|
return {
|
|
117193
117193
|
name: "worker",
|
|
117194
117194
|
entry,
|
|
@@ -117223,13 +117223,13 @@ function workerConfig({
|
|
|
117223
117223
|
}
|
|
117224
117224
|
}
|
|
117225
117225
|
},
|
|
117226
|
-
|
|
117226
|
+
minify: debug ? false : "terser",
|
|
117227
117227
|
terserOptions: {
|
|
117228
117228
|
compress: true,
|
|
117229
117229
|
ecma: 2020,
|
|
117230
117230
|
keep_classnames: true,
|
|
117231
117231
|
keep_fnames: true
|
|
117232
|
-
}
|
|
117232
|
+
},
|
|
117233
117233
|
apiReport,
|
|
117234
117234
|
docModel,
|
|
117235
117235
|
tsdocMetadata,
|
|
@@ -117249,20 +117249,32 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
117249
117249
|
}) {
|
|
117250
117250
|
const entry = globSync(
|
|
117251
117251
|
[
|
|
117252
|
-
rest.entry ? rest.entry : (0,
|
|
117252
|
+
rest.entry ? rest.entry : (0, import_devkit.joinPathFragments)(
|
|
117253
|
+
sourceRoot.includes(workspaceRoot) ? sourceRoot : (0, import_devkit.joinPathFragments)(workspaceRoot, sourceRoot),
|
|
117254
|
+
"**/*.{ts,tsx}"
|
|
117255
|
+
),
|
|
117253
117256
|
...additionalEntryPoints ?? []
|
|
117254
117257
|
],
|
|
117255
117258
|
{
|
|
117256
117259
|
withFileTypes: true
|
|
117257
117260
|
}
|
|
117258
117261
|
).reduce((ret, filePath) => {
|
|
117259
|
-
let propertyKey = (0,
|
|
117262
|
+
let propertyKey = (0, import_devkit.joinPathFragments)(
|
|
117263
|
+
filePath.path,
|
|
117264
|
+
removeExtension(filePath.name)
|
|
117265
|
+
).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
117260
117266
|
if (propertyKey) {
|
|
117261
117267
|
while (propertyKey.startsWith("/")) {
|
|
117262
117268
|
propertyKey = propertyKey.substring(1);
|
|
117263
117269
|
}
|
|
117270
|
+
console.debug(
|
|
117271
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit.joinPathFragments)(
|
|
117272
|
+
filePath.path,
|
|
117273
|
+
filePath.name
|
|
117274
|
+
)}"`
|
|
117275
|
+
);
|
|
117264
117276
|
if (!(propertyKey in ret)) {
|
|
117265
|
-
ret[propertyKey] = (0,
|
|
117277
|
+
ret[propertyKey] = (0, import_devkit.joinPathFragments)(filePath.path, filePath.name);
|
|
117266
117278
|
}
|
|
117267
117279
|
}
|
|
117268
117280
|
return ret;
|
|
@@ -117357,8 +117369,8 @@ ${Object.keys(options).map(
|
|
|
117357
117369
|
if (!result.success) {
|
|
117358
117370
|
throw new Error("The Build process failed trying to copy assets");
|
|
117359
117371
|
}
|
|
117360
|
-
const workspacePackageJson = (0,
|
|
117361
|
-
(0,
|
|
117372
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)(
|
|
117373
|
+
(0, import_path3.join)(workspaceRoot, "package.json")
|
|
117362
117374
|
);
|
|
117363
117375
|
options.external = options.external || [];
|
|
117364
117376
|
if (workspacePackageJson?.dependencies) {
|
|
@@ -117377,8 +117389,8 @@ ${Object.keys(options).map(
|
|
|
117377
117389
|
options.external = implicitDependencies.reduce(
|
|
117378
117390
|
(ret, key) => {
|
|
117379
117391
|
if (context.projectsConfigurations.projects[key].root) {
|
|
117380
|
-
const packageJson = (0,
|
|
117381
|
-
(0,
|
|
117392
|
+
const packageJson = (0, import_devkit2.readJsonFile)(
|
|
117393
|
+
(0, import_path3.join)(
|
|
117382
117394
|
context.root,
|
|
117383
117395
|
context.projectsConfigurations.projects[key].root,
|
|
117384
117396
|
"package.json"
|
|
@@ -117444,9 +117456,9 @@ ${externalDependencies.map((dep) => {
|
|
|
117444
117456
|
endOfLine: "lf"
|
|
117445
117457
|
};
|
|
117446
117458
|
if (options.generatePackageJson !== false) {
|
|
117447
|
-
const projectGraph = (0,
|
|
117448
|
-
const pathToPackageJson = (0,
|
|
117449
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
117459
|
+
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
117460
|
+
const pathToPackageJson = (0, import_path3.join)(context.root, projectRoot, "package.json");
|
|
117461
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
117450
117462
|
delete packageJson.dependencies;
|
|
117451
117463
|
externalDependencies.forEach((entry) => {
|
|
117452
117464
|
const packageConfig = entry.node.data;
|
|
@@ -117470,13 +117482,31 @@ ${externalDependencies.map((dep) => {
|
|
|
117470
117482
|
types: "./dist/modern/index.d.cts",
|
|
117471
117483
|
default: "./dist/modern/index.cjs"
|
|
117472
117484
|
},
|
|
117485
|
+
default: {
|
|
117486
|
+
types: "./dist/modern/**/*.d.ts",
|
|
117487
|
+
default: "./dist/modern/**/*.js"
|
|
117488
|
+
},
|
|
117489
|
+
"./*": {
|
|
117490
|
+
"import": {
|
|
117491
|
+
types: "./dist/modern/**/*.d.ts",
|
|
117492
|
+
default: "./dist/modern/**/*.js"
|
|
117493
|
+
},
|
|
117494
|
+
require: {
|
|
117495
|
+
types: "./dist/modern/**/*.d.cts",
|
|
117496
|
+
default: "./dist/modern/**/*.cjs"
|
|
117497
|
+
},
|
|
117498
|
+
"default": {
|
|
117499
|
+
types: "./dist/modern/**/*.d.ts",
|
|
117500
|
+
default: "./dist/modern/**/*.js"
|
|
117501
|
+
}
|
|
117502
|
+
},
|
|
117473
117503
|
...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
|
|
117474
117504
|
[removeExtension(entryPoint).replace(sourceRoot, "")]: {
|
|
117475
|
-
types: (0,
|
|
117505
|
+
types: (0, import_path3.join)(
|
|
117476
117506
|
"./dist/modern",
|
|
117477
117507
|
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
|
|
117478
117508
|
),
|
|
117479
|
-
default: (0,
|
|
117509
|
+
default: (0, import_path3.join)(
|
|
117480
117510
|
"./dist/modern",
|
|
117481
117511
|
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
|
|
117482
117512
|
)
|
|
@@ -117487,6 +117517,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117487
117517
|
};
|
|
117488
117518
|
packageJson.funding ??= workspacePackageJson.funding;
|
|
117489
117519
|
packageJson.types ??= "dist/legacy/index.d.ts";
|
|
117520
|
+
packageJson.typings ??= "dist/legacy/index.d.ts";
|
|
117521
|
+
packageJson.typescript ??= {
|
|
117522
|
+
definition: "dist/legacy/index.d.ts"
|
|
117523
|
+
};
|
|
117490
117524
|
packageJson.main ??= "dist/legacy/index.cjs";
|
|
117491
117525
|
packageJson.module ??= "dist/legacy/index.js";
|
|
117492
117526
|
options.platform && options.platform !== "node" && (packageJson.browser ??= "dist/modern/index.global.js");
|
|
@@ -117495,15 +117529,15 @@ ${externalDependencies.map((dep) => {
|
|
|
117495
117529
|
if (distSrc.startsWith("/")) {
|
|
117496
117530
|
distSrc = distSrc.substring(1);
|
|
117497
117531
|
}
|
|
117498
|
-
packageJson.source ??= `${(0,
|
|
117532
|
+
packageJson.source ??= `${(0, import_path3.join)(distSrc, "index.ts").replaceAll(
|
|
117499
117533
|
"\\",
|
|
117500
117534
|
"/"
|
|
117501
117535
|
)}`;
|
|
117502
117536
|
}
|
|
117503
117537
|
packageJson.sideEffects ??= false;
|
|
117504
|
-
packageJson.files ??= ["dist"];
|
|
117538
|
+
packageJson.files ??= ["dist/**/*"];
|
|
117505
117539
|
if (options.includeSrc !== false && !packageJson.files.includes("src")) {
|
|
117506
|
-
packageJson.files.push("src");
|
|
117540
|
+
packageJson.files.push("src/**/*");
|
|
117507
117541
|
}
|
|
117508
117542
|
packageJson.publishConfig ??= {
|
|
117509
117543
|
access: "public"
|
|
@@ -117515,8 +117549,8 @@ ${externalDependencies.map((dep) => {
|
|
|
117515
117549
|
packageJson.license ??= workspacePackageJson.license;
|
|
117516
117550
|
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
117517
117551
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
117518
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot : (0,
|
|
117519
|
-
const packageJsonPath = (0,
|
|
117552
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_path3.join)("packages", context.projectName);
|
|
117553
|
+
const packageJsonPath = (0, import_path3.join)(
|
|
117520
117554
|
context.root,
|
|
117521
117555
|
options.outputPath,
|
|
117522
117556
|
"package.json"
|
|
@@ -117532,10 +117566,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117532
117566
|
}
|
|
117533
117567
|
if (options.includeSrc !== false) {
|
|
117534
117568
|
const files = globSync([
|
|
117535
|
-
(0,
|
|
117536
|
-
(0,
|
|
117537
|
-
(0,
|
|
117538
|
-
(0,
|
|
117569
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117570
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
117571
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
117572
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
117539
117573
|
]);
|
|
117540
117574
|
await Promise.allSettled(
|
|
117541
117575
|
files.map(
|
|
@@ -117637,15 +117671,15 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
117637
117671
|
declaration: true,
|
|
117638
117672
|
declarationMap: true,
|
|
117639
117673
|
emitDeclarationOnly: true,
|
|
117640
|
-
declarationDir: (0,
|
|
117674
|
+
declarationDir: (0, import_path3.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
117641
117675
|
}
|
|
117642
117676
|
},
|
|
117643
117677
|
ts.sys,
|
|
117644
|
-
(0,
|
|
117678
|
+
(0, import_path3.dirname)(options.tsConfig)
|
|
117645
117679
|
);
|
|
117646
117680
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
117647
117681
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
117648
|
-
tsConfig.options.tsBuildInfoFile = (0,
|
|
117682
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(
|
|
117649
117683
|
outputPath,
|
|
117650
117684
|
"tsconfig.tsbuildinfo"
|
|
117651
117685
|
);
|
|
@@ -117680,7 +117714,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117680
117714
|
options.additionalEntryPoints ??= [];
|
|
117681
117715
|
options.assets ??= [];
|
|
117682
117716
|
options.plugins ??= [];
|
|
117683
|
-
options.includeSrc ??=
|
|
117717
|
+
options.includeSrc ??= false;
|
|
117684
117718
|
options.clean ??= true;
|
|
117685
117719
|
options.bundle ??= true;
|
|
117686
117720
|
options.debug ??= false;
|
|
@@ -117690,6 +117724,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117690
117724
|
options.tsdocMetadata ??= true;
|
|
117691
117725
|
options.define ??= {};
|
|
117692
117726
|
options.env ??= {};
|
|
117727
|
+
options.verbose ??= !!process.env.CI;
|
|
117693
117728
|
return options;
|
|
117694
117729
|
};
|
|
117695
117730
|
var executor_default = withRunExecutor(
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!-- START header -->
|
|
2
|
+
<!-- END header -->
|
|
3
|
+
|
|
4
|
+
# <%= name %>
|
|
5
|
+
|
|
6
|
+
<%= description %>
|
|
7
|
+
|
|
8
|
+
<!-- START doctoc -->
|
|
9
|
+
<!-- END doctoc -->
|
|
10
|
+
|
|
11
|
+
## Installing
|
|
12
|
+
|
|
13
|
+
Using [pnpm](http://pnpm.io):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add -D <%= namespace %>/<%= name %>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
<details>
|
|
20
|
+
<summary>Using npm</summary>
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -D <%= namespace %>/<%= name %>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
</details>
|
|
27
|
+
|
|
28
|
+
<details>
|
|
29
|
+
<summary>Using yarn</summary>
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
yarn add -D <%= namespace %>/<%= name %>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
</details>
|
|
36
|
+
|
|
37
|
+
## Reduced Package Size
|
|
38
|
+
|
|
39
|
+
This project uses [tsup](https://tsup.egoist.dev/) to package the source code due to its ability to remove unused code and ship smaller javascript files thanks to code splitting. This helps to greatly reduce the size of the package and to make it easier to use in other projects.
|
|
40
|
+
|
|
41
|
+
## Development
|
|
42
|
+
|
|
43
|
+
This project is built using [Nx](https://nx.dev). As a result, many of the usual commands are available to assist in development.
|
|
44
|
+
|
|
45
|
+
### Building
|
|
46
|
+
|
|
47
|
+
Run `nx build <%= name %>` to build the library.
|
|
48
|
+
|
|
49
|
+
### Running unit tests
|
|
50
|
+
|
|
51
|
+
Run `nx test <%= name %>` to execute the unit tests via [Jest](https://jestjs.io).
|
|
52
|
+
|
|
53
|
+
### Linting
|
|
54
|
+
|
|
55
|
+
Run `nx lint <%= name %>` to run [ESLint](https://eslint.org/) on the package.
|
|
56
|
+
|
|
57
|
+
<!-- START footer -->
|
|
58
|
+
<!-- END footer -->
|