@arcgis/components-build-utils 5.0.0-next.17 → 5.0.0-next.170
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/LICENSE.md +9 -5
- package/README.md +2 -3
- package/dist/file.d.cts +3 -1
- package/dist/file.d.ts +3 -1
- package/dist/index.cjs +58 -12
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +58 -12
- package/dist/packageJson.d.cts +15 -10
- package/dist/packageJson.d.ts +15 -10
- package/package.json +4 -16
- package/dist/commands/affected-packages.d.cts +0 -2
- package/dist/commands/affected-packages.d.ts +0 -2
- package/dist/commands/assign-zenhub-release.d.cts +0 -2
- package/dist/commands/assign-zenhub-release.d.ts +0 -2
- package/dist/commands/compare-rss.d.cts +0 -10
- package/dist/commands/compare-rss.d.ts +0 -10
- package/dist/commands/copy-folder.d.cts +0 -2
- package/dist/commands/copy-folder.d.ts +0 -2
- package/dist/commands/create-mock-doc.d.cts +0 -2
- package/dist/commands/create-mock-doc.d.ts +0 -2
- package/dist/commands/deprecate.d.cts +0 -2
- package/dist/commands/deprecate.d.ts +0 -2
- package/dist/commands/detect-broken-links.d.cts +0 -2
- package/dist/commands/detect-broken-links.d.ts +0 -2
- package/dist/commands/detect-large-files.d.cts +0 -3
- package/dist/commands/detect-large-files.d.ts +0 -3
- package/dist/commands/ensure-working-tree-clean.d.cts +0 -6
- package/dist/commands/ensure-working-tree-clean.d.ts +0 -6
- package/dist/commands/generate-builddate.d.cts +0 -12
- package/dist/commands/generate-builddate.d.ts +0 -12
- package/dist/commands/generate-info-html.d.cts +0 -2
- package/dist/commands/generate-info-html.d.ts +0 -2
- package/dist/commands/generate-t9n-manifest.d.cts +0 -2
- package/dist/commands/generate-t9n-manifest.d.ts +0 -2
- package/dist/commands/git-copy/dumpSizes.d.cts +0 -1
- package/dist/commands/git-copy/dumpSizes.d.ts +0 -1
- package/dist/commands/git-copy/getFileNames.d.cts +0 -4
- package/dist/commands/git-copy/getFileNames.d.ts +0 -4
- package/dist/commands/git-copy/helpers.d.cts +0 -4
- package/dist/commands/git-copy/helpers.d.ts +0 -4
- package/dist/commands/git-copy/index.d.cts +0 -16
- package/dist/commands/git-copy/index.d.ts +0 -16
- package/dist/commands/git-copy/updateReferences.d.cts +0 -4
- package/dist/commands/git-copy/updateReferences.d.ts +0 -4
- package/dist/commands/git-copy/utils.d.cts +0 -8
- package/dist/commands/git-copy/utils.d.ts +0 -8
- package/dist/commands/git-copy.d.cts +0 -2
- package/dist/commands/git-copy.d.ts +0 -2
- package/dist/commands/migrate-repo-issues/devtopia.d.cts +0 -44
- package/dist/commands/migrate-repo-issues/devtopia.d.ts +0 -44
- package/dist/commands/migrate-repo-issues/zentopia.d.cts +0 -102
- package/dist/commands/migrate-repo-issues/zentopia.d.ts +0 -102
- package/dist/commands/migrate-repo-issues.d.cts +0 -2
- package/dist/commands/migrate-repo-issues.d.ts +0 -2
- package/dist/commands/npm-utils.d.cts +0 -29
- package/dist/commands/npm-utils.d.ts +0 -29
- package/dist/commands/run-lint-test.d.cts +0 -2
- package/dist/commands/run-lint-test.d.ts +0 -2
- package/dist/commands/run.d.cts +0 -1
- package/dist/commands/run.d.ts +0 -1
- package/dist/commands/scan-dist.d.cts +0 -7
- package/dist/commands/scan-dist.d.ts +0 -7
- package/dist/commands/update-version.d.cts +0 -2
- package/dist/commands/update-version.d.ts +0 -2
- package/dist/commands/utils.d.cts +0 -66
- package/dist/commands/utils.d.ts +0 -66
- package/src/commands/run-wrapper.js +0 -6
package/LICENSE.md
CHANGED
|
@@ -4,10 +4,14 @@ COPYRIGHT © Esri
|
|
|
4
4
|
|
|
5
5
|
All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
|
|
6
6
|
|
|
7
|
-
This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement.
|
|
7
|
+
This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
|
|
8
|
+
You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
For additional information, contact:
|
|
11
|
+
Environmental Systems Research Institute, Inc.
|
|
12
|
+
Attn: Contracts and Legal Services Department
|
|
13
|
+
380 New York Street
|
|
14
|
+
Redlands, California, USA 92373
|
|
15
|
+
USA
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
email: contracts@esri.com
|
|
17
|
+
email: legal@esri.com
|
package/README.md
CHANGED
|
@@ -8,6 +8,5 @@ It is not intended to be used directly, but rather used as a dependency by other
|
|
|
8
8
|
|
|
9
9
|
## License
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package.
|
|
11
|
+
This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.0/LICENSE.txt.
|
|
12
|
+
For third party notices, see https://js.arcgis.com/5.0/third-party-notices.txt.
|
package/dist/file.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
|
|
1
2
|
export declare const existsAsync: (file: string) => Promise<boolean>;
|
|
2
3
|
/** Wrapper for execSync to execute shell commands */
|
|
3
|
-
export declare
|
|
4
|
+
export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): string;
|
|
5
|
+
export declare function asyncSh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): Promise<string>;
|
|
4
6
|
export declare function createFileIfNotExists(filePath: string, content: string): Promise<void>;
|
|
5
7
|
/**
|
|
6
8
|
* Climb the directory tree upward, until found a directory that contains the
|
package/dist/file.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
|
|
1
2
|
export declare const existsAsync: (file: string) => Promise<boolean>;
|
|
2
3
|
/** Wrapper for execSync to execute shell commands */
|
|
3
|
-
export declare
|
|
4
|
+
export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): string;
|
|
5
|
+
export declare function asyncSh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): Promise<string>;
|
|
4
6
|
export declare function createFileIfNotExists(filePath: string, content: string): Promise<void>;
|
|
5
7
|
/**
|
|
6
8
|
* Climb the directory tree upward, until found a directory that contains the
|
package/dist/index.cjs
CHANGED
|
@@ -24,16 +24,59 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
25
|
const node_fs = require("node:fs");
|
|
26
26
|
const promises = require("node:fs/promises");
|
|
27
|
-
const node_child_process = require("node:child_process");
|
|
28
27
|
const path$1 = require("path");
|
|
29
28
|
const node_url = require("node:url");
|
|
29
|
+
const node_child_process = require("node:child_process");
|
|
30
|
+
const node_util = require("node:util");
|
|
30
31
|
const node_module = require("node:module");
|
|
31
32
|
const existsAsync = async (file) => (
|
|
32
33
|
// Using un-promisified version because promises version creates exceptions
|
|
33
34
|
// which interferes with debugging when "Pause on caught exceptions" is enabled
|
|
34
35
|
await new Promise((resolve2) => node_fs.access(file, promises.constants.F_OK, (error) => resolve2(!error)))
|
|
35
36
|
);
|
|
36
|
-
|
|
37
|
+
function sh(command, options = {}) {
|
|
38
|
+
try {
|
|
39
|
+
const normalizedOptions = { encoding: "utf8", ...options };
|
|
40
|
+
return node_child_process.execSync(command.trim(), normalizedOptions).trim();
|
|
41
|
+
} catch (error) {
|
|
42
|
+
makeExecErrorReadable(error);
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function asyncSh(command, options = {}) {
|
|
47
|
+
const normalizedOptions = { encoding: "utf8", ...options };
|
|
48
|
+
return await new Promise((resolve2, reject) => {
|
|
49
|
+
node_child_process.exec(command.trim(), normalizedOptions, (error, stdout, stderr) => {
|
|
50
|
+
if (error) {
|
|
51
|
+
makeExecErrorReadable(error);
|
|
52
|
+
reject(error);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
resolve2(stdout.trim() || stderr.trim());
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function makeExecErrorReadable(error) {
|
|
60
|
+
if (error instanceof Error && error.stack && "output" in error && Array.isArray(error.output) && "status" in error) {
|
|
61
|
+
const stackIndex = error.stack.indexOf("\n at ");
|
|
62
|
+
if (stackIndex !== -1) {
|
|
63
|
+
const output = error.output.filter(Boolean).join("\n").trim();
|
|
64
|
+
const newHeader = `${node_util.styleText("red", error.message)} (exit code: ${String(error.status)})
|
|
65
|
+
${output}`;
|
|
66
|
+
const oldStackFrames = error.stack.substring(stackIndex);
|
|
67
|
+
error.stack = `Error: ${newHeader}${oldStackFrames}`;
|
|
68
|
+
}
|
|
69
|
+
Object.defineProperties(error, {
|
|
70
|
+
output: { enumerable: false },
|
|
71
|
+
stdout: { enumerable: false },
|
|
72
|
+
stderr: { enumerable: false },
|
|
73
|
+
signal: { enumerable: false },
|
|
74
|
+
status: { enumerable: false },
|
|
75
|
+
pid: { enumerable: false },
|
|
76
|
+
stdio: { enumerable: false }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
37
80
|
async function createFileIfNotExists(filePath, content) {
|
|
38
81
|
await promises.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
39
82
|
if (!await existsAsync(filePath)) {
|
|
@@ -43,7 +86,7 @@ async function createFileIfNotExists(filePath, content) {
|
|
|
43
86
|
function findPath(target, startDirectory = process.cwd()) {
|
|
44
87
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? path$1.dirname(node_url.fileURLToPath(startDirectory)) : path$1.resolve(startDirectory);
|
|
45
88
|
const parentPath = resolvedStartDirectory.split(path$1.sep);
|
|
46
|
-
while (parentPath.length >
|
|
89
|
+
while (parentPath.length > searchStopIndex) {
|
|
47
90
|
const fullPath = path$1.join(
|
|
48
91
|
...path$1.sep === "/" ? ["/"] : [],
|
|
49
92
|
...parentPath,
|
|
@@ -56,10 +99,11 @@ function findPath(target, startDirectory = process.cwd()) {
|
|
|
56
99
|
}
|
|
57
100
|
return void 0;
|
|
58
101
|
}
|
|
102
|
+
const searchStopIndex = 0;
|
|
59
103
|
async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
60
104
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? path$1.dirname(node_url.fileURLToPath(startDirectory)) : path$1.resolve(startDirectory);
|
|
61
105
|
const parentPath = resolvedStartDirectory.split(path$1.sep);
|
|
62
|
-
while (parentPath.length >
|
|
106
|
+
while (parentPath.length > searchStopIndex) {
|
|
63
107
|
const fullPath = path$1.join(
|
|
64
108
|
...path$1.sep === "/" ? ["/"] : [],
|
|
65
109
|
...parentPath,
|
|
@@ -132,13 +176,16 @@ const path = isPosix ? path$1.posix : {
|
|
|
132
176
|
const cachedPackageJson = {};
|
|
133
177
|
const cachedPackageJsonPromises = {};
|
|
134
178
|
let rootPackageJsonLocation;
|
|
135
|
-
function retrievePackageJson(location) {
|
|
179
|
+
function retrievePackageJson(location, cache = true) {
|
|
136
180
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
137
|
-
|
|
138
|
-
|
|
181
|
+
if (cache) {
|
|
182
|
+
cachedPackageJson[packageJsonPath] ??= JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
|
|
183
|
+
return cachedPackageJson[packageJsonPath];
|
|
184
|
+
}
|
|
185
|
+
return JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
|
|
139
186
|
}
|
|
140
|
-
async function asyncRetrievePackageJson(location
|
|
141
|
-
const packageJsonPath = path.resolve(location, "package.json");
|
|
187
|
+
async function asyncRetrievePackageJson(location) {
|
|
188
|
+
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
142
189
|
if (packageJsonPath in cachedPackageJson) {
|
|
143
190
|
return cachedPackageJson[packageJsonPath];
|
|
144
191
|
}
|
|
@@ -212,7 +259,7 @@ function vitePresetPlugin({
|
|
|
212
259
|
build: {
|
|
213
260
|
// REFACTOR: get this from tsconfig
|
|
214
261
|
// It's a best practice to let the final bundler down-level as needed.
|
|
215
|
-
target: target ?? "
|
|
262
|
+
target: target ?? "es2024"
|
|
216
263
|
},
|
|
217
264
|
define: env.mode === "test" ? {
|
|
218
265
|
"process.env.ESRI_INTERNAL": true
|
|
@@ -249,8 +296,6 @@ function vitePresetPlugin({
|
|
|
249
296
|
},
|
|
250
297
|
...dtsOptions,
|
|
251
298
|
compilerOptions: {
|
|
252
|
-
// For details, see comment above excludeOutsideFiles in
|
|
253
|
-
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
254
299
|
rootDir: ".",
|
|
255
300
|
...dtsOptions.compilerOptions
|
|
256
301
|
},
|
|
@@ -327,6 +372,7 @@ function externalizeDependencies(options) {
|
|
|
327
372
|
const stringToStartsWithGlob = (option) => typeof option === "string" ? new RegExp(`^${option.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}(?:/.+)?$`, "u") : option;
|
|
328
373
|
exports.asyncFindPath = asyncFindPath;
|
|
329
374
|
exports.asyncRetrievePackageJson = asyncRetrievePackageJson;
|
|
375
|
+
exports.asyncSh = asyncSh;
|
|
330
376
|
exports.createFileIfNotExists = createFileIfNotExists;
|
|
331
377
|
exports.detectPackageManager = detectPackageManager;
|
|
332
378
|
exports.existsAsync = existsAsync;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { existsAsync, sh, createFileIfNotExists, findPath, asyncFindPath } from './file';
|
|
2
|
-
export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob';
|
|
3
|
-
export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path';
|
|
4
|
-
export { type
|
|
5
|
-
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
|
|
1
|
+
export { existsAsync, sh, asyncSh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
|
|
2
|
+
export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob.ts';
|
|
3
|
+
export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path.ts';
|
|
4
|
+
export { type PackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson.ts';
|
|
5
|
+
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite.ts';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { existsAsync, sh, createFileIfNotExists, findPath, asyncFindPath } from './file';
|
|
2
|
-
export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob';
|
|
3
|
-
export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path';
|
|
4
|
-
export { type
|
|
5
|
-
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
|
|
1
|
+
export { existsAsync, sh, asyncSh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
|
|
2
|
+
export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob.ts';
|
|
3
|
+
export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path.ts';
|
|
4
|
+
export { type PackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson.ts';
|
|
5
|
+
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,58 @@
|
|
|
1
1
|
import { access, existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { constants, mkdir, writeFile, readFile } from "node:fs/promises";
|
|
3
|
-
import { execSync } from "node:child_process";
|
|
4
3
|
import { dirname, resolve, sep, join, posix, win32 } from "path";
|
|
5
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { execSync, exec } from "node:child_process";
|
|
6
|
+
import { styleText } from "node:util";
|
|
6
7
|
import { builtinModules } from "node:module";
|
|
7
8
|
const existsAsync = async (file) => (
|
|
8
9
|
// Using un-promisified version because promises version creates exceptions
|
|
9
10
|
// which interferes with debugging when "Pause on caught exceptions" is enabled
|
|
10
11
|
await new Promise((resolve2) => access(file, constants.F_OK, (error) => resolve2(!error)))
|
|
11
12
|
);
|
|
12
|
-
|
|
13
|
+
function sh(command, options = {}) {
|
|
14
|
+
try {
|
|
15
|
+
const normalizedOptions = { encoding: "utf8", ...options };
|
|
16
|
+
return execSync(command.trim(), normalizedOptions).trim();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
makeExecErrorReadable(error);
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function asyncSh(command, options = {}) {
|
|
23
|
+
const normalizedOptions = { encoding: "utf8", ...options };
|
|
24
|
+
return await new Promise((resolve2, reject) => {
|
|
25
|
+
exec(command.trim(), normalizedOptions, (error, stdout, stderr) => {
|
|
26
|
+
if (error) {
|
|
27
|
+
makeExecErrorReadable(error);
|
|
28
|
+
reject(error);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
resolve2(stdout.trim() || stderr.trim());
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function makeExecErrorReadable(error) {
|
|
36
|
+
if (error instanceof Error && error.stack && "output" in error && Array.isArray(error.output) && "status" in error) {
|
|
37
|
+
const stackIndex = error.stack.indexOf("\n at ");
|
|
38
|
+
if (stackIndex !== -1) {
|
|
39
|
+
const output = error.output.filter(Boolean).join("\n").trim();
|
|
40
|
+
const newHeader = `${styleText("red", error.message)} (exit code: ${String(error.status)})
|
|
41
|
+
${output}`;
|
|
42
|
+
const oldStackFrames = error.stack.substring(stackIndex);
|
|
43
|
+
error.stack = `Error: ${newHeader}${oldStackFrames}`;
|
|
44
|
+
}
|
|
45
|
+
Object.defineProperties(error, {
|
|
46
|
+
output: { enumerable: false },
|
|
47
|
+
stdout: { enumerable: false },
|
|
48
|
+
stderr: { enumerable: false },
|
|
49
|
+
signal: { enumerable: false },
|
|
50
|
+
status: { enumerable: false },
|
|
51
|
+
pid: { enumerable: false },
|
|
52
|
+
stdio: { enumerable: false }
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
13
56
|
async function createFileIfNotExists(filePath, content) {
|
|
14
57
|
await mkdir(dirname(filePath), { recursive: true });
|
|
15
58
|
if (!await existsAsync(filePath)) {
|
|
@@ -19,7 +62,7 @@ async function createFileIfNotExists(filePath, content) {
|
|
|
19
62
|
function findPath(target, startDirectory = process.cwd()) {
|
|
20
63
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory);
|
|
21
64
|
const parentPath = resolvedStartDirectory.split(sep);
|
|
22
|
-
while (parentPath.length >
|
|
65
|
+
while (parentPath.length > searchStopIndex) {
|
|
23
66
|
const fullPath = join(
|
|
24
67
|
...sep === "/" ? ["/"] : [],
|
|
25
68
|
...parentPath,
|
|
@@ -32,10 +75,11 @@ function findPath(target, startDirectory = process.cwd()) {
|
|
|
32
75
|
}
|
|
33
76
|
return void 0;
|
|
34
77
|
}
|
|
78
|
+
const searchStopIndex = 0;
|
|
35
79
|
async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
36
80
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory);
|
|
37
81
|
const parentPath = resolvedStartDirectory.split(sep);
|
|
38
|
-
while (parentPath.length >
|
|
82
|
+
while (parentPath.length > searchStopIndex) {
|
|
39
83
|
const fullPath = join(
|
|
40
84
|
...sep === "/" ? ["/"] : [],
|
|
41
85
|
...parentPath,
|
|
@@ -108,13 +152,16 @@ const path = isPosix ? posix : {
|
|
|
108
152
|
const cachedPackageJson = {};
|
|
109
153
|
const cachedPackageJsonPromises = {};
|
|
110
154
|
let rootPackageJsonLocation;
|
|
111
|
-
function retrievePackageJson(location) {
|
|
155
|
+
function retrievePackageJson(location, cache = true) {
|
|
112
156
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
113
|
-
|
|
114
|
-
|
|
157
|
+
if (cache) {
|
|
158
|
+
cachedPackageJson[packageJsonPath] ??= JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
159
|
+
return cachedPackageJson[packageJsonPath];
|
|
160
|
+
}
|
|
161
|
+
return JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
115
162
|
}
|
|
116
|
-
async function asyncRetrievePackageJson(location
|
|
117
|
-
const packageJsonPath = path.resolve(location, "package.json");
|
|
163
|
+
async function asyncRetrievePackageJson(location) {
|
|
164
|
+
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
118
165
|
if (packageJsonPath in cachedPackageJson) {
|
|
119
166
|
return cachedPackageJson[packageJsonPath];
|
|
120
167
|
}
|
|
@@ -188,7 +235,7 @@ function vitePresetPlugin({
|
|
|
188
235
|
build: {
|
|
189
236
|
// REFACTOR: get this from tsconfig
|
|
190
237
|
// It's a best practice to let the final bundler down-level as needed.
|
|
191
|
-
target: target ?? "
|
|
238
|
+
target: target ?? "es2024"
|
|
192
239
|
},
|
|
193
240
|
define: env.mode === "test" ? {
|
|
194
241
|
"process.env.ESRI_INTERNAL": true
|
|
@@ -225,8 +272,6 @@ function vitePresetPlugin({
|
|
|
225
272
|
},
|
|
226
273
|
...dtsOptions,
|
|
227
274
|
compilerOptions: {
|
|
228
|
-
// For details, see comment above excludeOutsideFiles in
|
|
229
|
-
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
230
275
|
rootDir: ".",
|
|
231
276
|
...dtsOptions.compilerOptions
|
|
232
277
|
},
|
|
@@ -304,6 +349,7 @@ const stringToStartsWithGlob = (option) => typeof option === "string" ? new RegE
|
|
|
304
349
|
export {
|
|
305
350
|
asyncFindPath,
|
|
306
351
|
asyncRetrievePackageJson,
|
|
352
|
+
asyncSh,
|
|
307
353
|
createFileIfNotExists,
|
|
308
354
|
detectPackageManager,
|
|
309
355
|
existsAsync,
|
package/dist/packageJson.d.cts
CHANGED
|
@@ -4,42 +4,47 @@
|
|
|
4
4
|
* The full package.json type is insanely large (20k lines):
|
|
5
5
|
* https://github.com/ffflorian/schemastore-updater/blob/main/schemas/package/index.d.ts#L20067
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
7
|
+
export type PackageJson = {
|
|
8
8
|
"name": string;
|
|
9
9
|
"version": string;
|
|
10
10
|
"private"?: boolean;
|
|
11
11
|
"type"?: "commonjs" | "module";
|
|
12
|
-
"
|
|
12
|
+
"main"?: string;
|
|
13
|
+
"module"?: string;
|
|
14
|
+
"types"?: string;
|
|
13
15
|
"publishConfig"?: {
|
|
14
16
|
access?: string;
|
|
15
17
|
registry?: string;
|
|
18
|
+
provenance?: boolean;
|
|
16
19
|
};
|
|
17
20
|
"files"?: string[];
|
|
18
|
-
"dependencies"?: Record<string, string
|
|
19
|
-
"devDependencies"?: Record<string, string
|
|
20
|
-
"peerDependencies"?: Record<string, string
|
|
21
|
+
"dependencies"?: Record<string, string>;
|
|
22
|
+
"devDependencies"?: Record<string, string>;
|
|
23
|
+
"peerDependencies"?: Record<string, string>;
|
|
21
24
|
"peerDependenciesMeta"?: Record<string, {
|
|
22
25
|
optional?: boolean;
|
|
23
26
|
}>;
|
|
24
|
-
"optionalDependencies"?: Record<string, string
|
|
27
|
+
"optionalDependencies"?: Record<string, string>;
|
|
25
28
|
"css.customData"?: string[];
|
|
26
29
|
"customElements"?: string;
|
|
27
30
|
"html.customData"?: string[];
|
|
28
31
|
"web-types"?: string;
|
|
29
32
|
"exports"?: Record<string, Record<string, string> | string>;
|
|
30
33
|
"scripts"?: Record<string, string>;
|
|
34
|
+
"packageManager"?: string;
|
|
31
35
|
"webGISComponents"?: {
|
|
32
|
-
deployBuilds?: Record<string,
|
|
36
|
+
deployBuilds?: Record<string, string>;
|
|
37
|
+
artifactsDeployPath?: string;
|
|
33
38
|
};
|
|
34
39
|
};
|
|
35
|
-
export declare function retrievePackageJson(location?: string):
|
|
36
|
-
export declare function asyncRetrievePackageJson(location?: string): Promise<
|
|
40
|
+
export declare function retrievePackageJson(location?: string, cache?: boolean): PackageJson;
|
|
41
|
+
export declare function asyncRetrievePackageJson(location?: string): Promise<PackageJson>;
|
|
37
42
|
/**
|
|
38
43
|
* Returns an absolute path to the root of a package in node_modules, without
|
|
39
44
|
* trailing slash.
|
|
40
45
|
*/
|
|
41
46
|
export declare function fetchPackageLocation(packageName: string, cwd?: string): Promise<string>;
|
|
42
47
|
/**
|
|
43
|
-
* Detect if current repository/monorepo uses npm,
|
|
48
|
+
* Detect if current repository/monorepo uses npm, pnpm, or yarn
|
|
44
49
|
*/
|
|
45
50
|
export declare function detectPackageManager(cwd?: string): string;
|
package/dist/packageJson.d.ts
CHANGED
|
@@ -4,42 +4,47 @@
|
|
|
4
4
|
* The full package.json type is insanely large (20k lines):
|
|
5
5
|
* https://github.com/ffflorian/schemastore-updater/blob/main/schemas/package/index.d.ts#L20067
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
7
|
+
export type PackageJson = {
|
|
8
8
|
"name": string;
|
|
9
9
|
"version": string;
|
|
10
10
|
"private"?: boolean;
|
|
11
11
|
"type"?: "commonjs" | "module";
|
|
12
|
-
"
|
|
12
|
+
"main"?: string;
|
|
13
|
+
"module"?: string;
|
|
14
|
+
"types"?: string;
|
|
13
15
|
"publishConfig"?: {
|
|
14
16
|
access?: string;
|
|
15
17
|
registry?: string;
|
|
18
|
+
provenance?: boolean;
|
|
16
19
|
};
|
|
17
20
|
"files"?: string[];
|
|
18
|
-
"dependencies"?: Record<string, string
|
|
19
|
-
"devDependencies"?: Record<string, string
|
|
20
|
-
"peerDependencies"?: Record<string, string
|
|
21
|
+
"dependencies"?: Record<string, string>;
|
|
22
|
+
"devDependencies"?: Record<string, string>;
|
|
23
|
+
"peerDependencies"?: Record<string, string>;
|
|
21
24
|
"peerDependenciesMeta"?: Record<string, {
|
|
22
25
|
optional?: boolean;
|
|
23
26
|
}>;
|
|
24
|
-
"optionalDependencies"?: Record<string, string
|
|
27
|
+
"optionalDependencies"?: Record<string, string>;
|
|
25
28
|
"css.customData"?: string[];
|
|
26
29
|
"customElements"?: string;
|
|
27
30
|
"html.customData"?: string[];
|
|
28
31
|
"web-types"?: string;
|
|
29
32
|
"exports"?: Record<string, Record<string, string> | string>;
|
|
30
33
|
"scripts"?: Record<string, string>;
|
|
34
|
+
"packageManager"?: string;
|
|
31
35
|
"webGISComponents"?: {
|
|
32
|
-
deployBuilds?: Record<string,
|
|
36
|
+
deployBuilds?: Record<string, string>;
|
|
37
|
+
artifactsDeployPath?: string;
|
|
33
38
|
};
|
|
34
39
|
};
|
|
35
|
-
export declare function retrievePackageJson(location?: string):
|
|
36
|
-
export declare function asyncRetrievePackageJson(location?: string): Promise<
|
|
40
|
+
export declare function retrievePackageJson(location?: string, cache?: boolean): PackageJson;
|
|
41
|
+
export declare function asyncRetrievePackageJson(location?: string): Promise<PackageJson>;
|
|
37
42
|
/**
|
|
38
43
|
* Returns an absolute path to the root of a package in node_modules, without
|
|
39
44
|
* trailing slash.
|
|
40
45
|
*/
|
|
41
46
|
export declare function fetchPackageLocation(packageName: string, cwd?: string): Promise<string>;
|
|
42
47
|
/**
|
|
43
|
-
* Detect if current repository/monorepo uses npm,
|
|
48
|
+
* Detect if current repository/monorepo uses npm, pnpm, or yarn
|
|
44
49
|
*/
|
|
45
50
|
export declare function detectPackageManager(cwd?: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/components-build-utils",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.170",
|
|
4
4
|
"description": "Collection of common internal build-time patterns and utilities for ArcGIS Maps SDK for JavaScript components.",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"type": "module",
|
|
@@ -12,28 +12,16 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"import": "./dist/index.js",
|
|
14
14
|
"require": "./dist/index.cjs"
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"./ts": "./src/index.ts"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
18
19
|
"dist/"
|
|
19
20
|
],
|
|
20
|
-
"bin": {
|
|
21
|
-
"awc": "src/commands/run-wrapper.js"
|
|
22
|
-
},
|
|
23
21
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
22
|
"dependencies": {
|
|
25
|
-
"@commander-js/extra-typings": "^14.0.0",
|
|
26
|
-
"chalk": "^5.4.1",
|
|
27
|
-
"commander": "^14.0.0",
|
|
28
|
-
"fast-glob": "^3.3.3",
|
|
29
|
-
"fast-xml-parser": "^5.2.5",
|
|
30
|
-
"glob": "^11.0.3",
|
|
31
|
-
"ora": "^8.2.0",
|
|
32
|
-
"p-limit": "^7.1.1",
|
|
33
|
-
"semver": "^7.7.2",
|
|
34
|
-
"split2": "^4.2.0",
|
|
35
23
|
"tslib": "^2.8.1",
|
|
36
|
-
"vite": "^7.
|
|
24
|
+
"vite": "^7.2.2",
|
|
37
25
|
"vite-plugin-dts": "^4.5.4"
|
|
38
26
|
}
|
|
39
27
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
/**
|
|
3
|
-
* !important
|
|
4
|
-
* The class makes a TLS request to qawebgis
|
|
5
|
-
* You need to make sure node trusts the certificate authority that signed the certificate used by qawebgis.esri.com
|
|
6
|
-
*
|
|
7
|
-
* Include your certificate authority in the NODE_EXTRA_CA_CERTS environment variable
|
|
8
|
-
* Reference: https://qawebgis.esri.com/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
9
|
-
*/
|
|
10
|
-
export declare const registerCommand: (command: Command) => undefined;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
/**
|
|
3
|
-
* !important
|
|
4
|
-
* The class makes a TLS request to qawebgis
|
|
5
|
-
* You need to make sure node trusts the certificate authority that signed the certificate used by qawebgis.esri.com
|
|
6
|
-
*
|
|
7
|
-
* Include your certificate authority in the NODE_EXTRA_CA_CERTS environment variable
|
|
8
|
-
* Reference: https://qawebgis.esri.com/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
9
|
-
*/
|
|
10
|
-
export declare const registerCommand: (command: Command) => undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Command } from '@commander-js/extra-typings';
|
|
2
|
-
export declare const registerCommand: (command: Command) => undefined;
|
|
3
|
-
export declare function ensureWorkingTreeClean({ cwd }?: {
|
|
4
|
-
cwd?: string;
|
|
5
|
-
}): void;
|
|
6
|
-
export declare const readWorkingTree: (cwd?: string) => string | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Command } from '@commander-js/extra-typings';
|
|
2
|
-
export declare const registerCommand: (command: Command) => undefined;
|
|
3
|
-
export declare function ensureWorkingTreeClean({ cwd }?: {
|
|
4
|
-
cwd?: string;
|
|
5
|
-
}): void;
|
|
6
|
-
export declare const readWorkingTree: (cwd?: string) => string | undefined;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Command } from '@commander-js/extra-typings';
|
|
2
|
-
export declare const registerCommand: (command: Command) => undefined;
|
|
3
|
-
export type Builddate = {
|
|
4
|
-
"builddate": string;
|
|
5
|
-
"commit": string;
|
|
6
|
-
"branch": string;
|
|
7
|
-
"version": string;
|
|
8
|
-
"@arcgis/core": string;
|
|
9
|
-
"@esri/calcite-components": string;
|
|
10
|
-
"@esri/arcgis-html-sanitizer": string;
|
|
11
|
-
};
|
|
12
|
-
export declare function generateBuilddate(): Promise<Builddate>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Command } from '@commander-js/extra-typings';
|
|
2
|
-
export declare const registerCommand: (command: Command) => undefined;
|
|
3
|
-
export type Builddate = {
|
|
4
|
-
"builddate": string;
|
|
5
|
-
"commit": string;
|
|
6
|
-
"branch": string;
|
|
7
|
-
"version": string;
|
|
8
|
-
"@arcgis/core": string;
|
|
9
|
-
"@esri/calcite-components": string;
|
|
10
|
-
"@esri/arcgis-html-sanitizer": string;
|
|
11
|
-
};
|
|
12
|
-
export declare function generateBuilddate(): Promise<Builddate>;
|