@arcgis/components-build-utils 5.0.0-next.7 → 5.0.0-next.71
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/dist/commands/compare-rss.d.cts +3 -3
- package/dist/commands/compare-rss.d.ts +3 -3
- package/dist/commands/github-actions-utils.d.cts +7 -0
- package/dist/commands/github-actions-utils.d.ts +7 -0
- package/dist/commands/migrate-repo-issues/devtopia.d.cts +2 -2
- package/dist/commands/migrate-repo-issues/devtopia.d.ts +2 -2
- package/dist/commands/migrate-repo-issues/zentopia.d.cts +6 -6
- package/dist/commands/migrate-repo-issues/zentopia.d.ts +6 -6
- package/dist/commands/scan-dist.d.cts +1 -1
- package/dist/commands/scan-dist.d.ts +1 -1
- package/dist/commands/utils.d.cts +7 -2
- package/dist/commands/utils.d.ts +7 -2
- package/dist/index.cjs +98 -70
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +65 -59
- package/dist/packageJson.d.cts +2 -1
- package/dist/packageJson.d.ts +2 -1
- package/dist/path.d.cts +1 -1
- package/dist/path.d.ts +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/package.json +3 -2
- /package/dist/commands/{assign-zehub-release.d.cts → assign-zenhub-release.d.cts} +0 -0
- /package/dist/commands/{assign-zehub-release.d.ts → assign-zenhub-release.d.ts} +0 -0
- /package/dist/commands/{create-mock-doc.d.cts → update-core-dep.d.cts} +0 -0
- /package/dist/commands/{create-mock-doc.d.ts → update-core-dep.d.ts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
/**
|
|
3
3
|
* !important
|
|
4
|
-
* The class makes a TLS request to
|
|
5
|
-
* You need to make sure node trusts the certificate authority that signed the certificate used by
|
|
4
|
+
* The class makes a TLS request to webgis
|
|
5
|
+
* You need to make sure node trusts the certificate authority that signed the certificate used by webgis.esri.com
|
|
6
6
|
*
|
|
7
7
|
* Include your certificate authority in the NODE_EXTRA_CA_CERTS environment variable
|
|
8
|
-
* Reference: https://
|
|
8
|
+
* Reference: https://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
9
9
|
*/
|
|
10
10
|
export declare const registerCommand: (command: Command) => undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
/**
|
|
3
3
|
* !important
|
|
4
|
-
* The class makes a TLS request to
|
|
5
|
-
* You need to make sure node trusts the certificate authority that signed the certificate used by
|
|
4
|
+
* The class makes a TLS request to webgis
|
|
5
|
+
* You need to make sure node trusts the certificate authority that signed the certificate used by webgis.esri.com
|
|
6
6
|
*
|
|
7
7
|
* Include your certificate authority in the NODE_EXTRA_CA_CERTS environment variable
|
|
8
|
-
* Reference: https://
|
|
8
|
+
* Reference: https://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
9
9
|
*/
|
|
10
10
|
export declare const registerCommand: (command: Command) => undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const markdownLog: string[];
|
|
2
|
+
export declare function addKeyValueToOutput(key: string, value: string[] | string): void;
|
|
3
|
+
export declare function addMarkdownToOutput(key?: string): void;
|
|
4
|
+
export declare function addHeadingToSummary(text: string, level?: 1 | 2 | 3): void;
|
|
5
|
+
export declare function addListToSummary(items: string[], ordered?: boolean): void;
|
|
6
|
+
export declare function addNewlineToSummary(): void;
|
|
7
|
+
export declare function writeSummary(): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const markdownLog: string[];
|
|
2
|
+
export declare function addKeyValueToOutput(key: string, value: string[] | string): void;
|
|
3
|
+
export declare function addMarkdownToOutput(key?: string): void;
|
|
4
|
+
export declare function addHeadingToSummary(text: string, level?: 1 | 2 | 3): void;
|
|
5
|
+
export declare function addListToSummary(items: string[], ordered?: boolean): void;
|
|
6
|
+
export declare function addNewlineToSummary(): void;
|
|
7
|
+
export declare function writeSummary(): void;
|
|
@@ -7,10 +7,10 @@ export interface Issue {
|
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
declare class Devtopia {
|
|
10
|
-
readonly owner: string;
|
|
11
|
-
readonly name: string;
|
|
12
10
|
private issuesPerPage;
|
|
13
11
|
constructor(owner: string, name: string);
|
|
12
|
+
readonly owner: string;
|
|
13
|
+
readonly name: string;
|
|
14
14
|
/**
|
|
15
15
|
* Requests to github graphql server
|
|
16
16
|
*/
|
|
@@ -7,10 +7,10 @@ export interface Issue {
|
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
declare class Devtopia {
|
|
10
|
-
readonly owner: string;
|
|
11
|
-
readonly name: string;
|
|
12
10
|
private issuesPerPage;
|
|
13
11
|
constructor(owner: string, name: string);
|
|
12
|
+
readonly owner: string;
|
|
13
|
+
readonly name: string;
|
|
14
14
|
/**
|
|
15
15
|
* Requests to github graphql server
|
|
16
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue } from './devtopia';
|
|
1
|
+
import { Issue } from './devtopia.ts';
|
|
2
2
|
export type IssueWithZenhub = {
|
|
3
3
|
gitHubId: string;
|
|
4
4
|
zenhubId: string;
|
|
@@ -30,17 +30,17 @@ export type IssueWithZenhub = {
|
|
|
30
30
|
* You need to make sure node trusts the certificate authority that signed the certificate used by zentopia.esri.com
|
|
31
31
|
*
|
|
32
32
|
* Include your certificate authority in the NODE_EXTRA_CA_CERTS environment variable
|
|
33
|
-
* Reference: https://
|
|
33
|
+
* Reference: https://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
34
34
|
*/
|
|
35
35
|
declare class Zentopia {
|
|
36
|
-
readonly repoId: number;
|
|
37
|
-
readonly workspaceId: string;
|
|
38
|
-
readonly token?: string | undefined;
|
|
39
36
|
private _issueIdCache;
|
|
40
37
|
private _pipelinesCache?;
|
|
41
38
|
private _sprintsCache?;
|
|
42
39
|
private _releasesCache?;
|
|
43
|
-
constructor(repoId: number, workspaceId: string, token?: string
|
|
40
|
+
constructor(repoId: number, workspaceId: string, token?: string);
|
|
41
|
+
readonly repoId: number;
|
|
42
|
+
readonly workspaceId: string;
|
|
43
|
+
readonly token?: string;
|
|
44
44
|
/**
|
|
45
45
|
* Requests to graphql server
|
|
46
46
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue } from './devtopia';
|
|
1
|
+
import { Issue } from './devtopia.ts';
|
|
2
2
|
export type IssueWithZenhub = {
|
|
3
3
|
gitHubId: string;
|
|
4
4
|
zenhubId: string;
|
|
@@ -30,17 +30,17 @@ export type IssueWithZenhub = {
|
|
|
30
30
|
* You need to make sure node trusts the certificate authority that signed the certificate used by zentopia.esri.com
|
|
31
31
|
*
|
|
32
32
|
* Include your certificate authority in the NODE_EXTRA_CA_CERTS environment variable
|
|
33
|
-
* Reference: https://
|
|
33
|
+
* Reference: https://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
34
34
|
*/
|
|
35
35
|
declare class Zentopia {
|
|
36
|
-
readonly repoId: number;
|
|
37
|
-
readonly workspaceId: string;
|
|
38
|
-
readonly token?: string | undefined;
|
|
39
36
|
private _issueIdCache;
|
|
40
37
|
private _pipelinesCache?;
|
|
41
38
|
private _sprintsCache?;
|
|
42
39
|
private _releasesCache?;
|
|
43
|
-
constructor(repoId: number, workspaceId: string, token?: string
|
|
40
|
+
constructor(repoId: number, workspaceId: string, token?: string);
|
|
41
|
+
readonly repoId: number;
|
|
42
|
+
readonly workspaceId: string;
|
|
43
|
+
readonly token?: string;
|
|
44
44
|
/**
|
|
45
45
|
* Requests to graphql server
|
|
46
46
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from '@commander-js/extra-typings';
|
|
2
|
-
import { PackageWalkerItem } from './utils';
|
|
2
|
+
import { PackageWalkerItem } from './utils.ts';
|
|
3
3
|
export declare const registerCommand: (command: Command) => undefined;
|
|
4
4
|
export declare function scanDist({ blocklistedNames }: {
|
|
5
5
|
blocklistedNames?: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from '@commander-js/extra-typings';
|
|
2
|
-
import { PackageWalkerItem } from './utils';
|
|
2
|
+
import { PackageWalkerItem } from './utils.ts';
|
|
3
3
|
export declare const registerCommand: (command: Command) => undefined;
|
|
4
4
|
export declare function scanDist({ blocklistedNames }: {
|
|
5
5
|
blocklistedNames?: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
|
|
2
|
-
import { MiniPackageJson } from '../packageJson';
|
|
2
|
+
import { MiniPackageJson } from '../packageJson.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Sets the exit code to 1 and prints the error message to stderr.
|
|
5
5
|
* This is used to indicate an error condition in the script.
|
|
@@ -10,7 +10,7 @@ export declare function error(...messages: unknown[]): void;
|
|
|
10
10
|
* This is used to indicate a fatal error that cannot be recovered from.
|
|
11
11
|
*/
|
|
12
12
|
export declare function errorAndExit(...messages: unknown[]): never;
|
|
13
|
-
export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding
|
|
13
|
+
export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>, quiet?: boolean): string;
|
|
14
14
|
export declare function findRepositoryRoot(): string;
|
|
15
15
|
export declare function isURL(source: string): boolean;
|
|
16
16
|
/**
|
|
@@ -63,4 +63,9 @@ export declare function getAffectedPackages(changed: Iterable<string>, options?:
|
|
|
63
63
|
* Helper to check if an error is a SIGINT (interrupt) error.
|
|
64
64
|
*/
|
|
65
65
|
export declare function isSigint(err: unknown): boolean;
|
|
66
|
+
export declare function getBranchName(): string;
|
|
67
|
+
export declare function getStagedFiles(options?: Partial<ExecSyncOptionsWithStringEncoding>): string[];
|
|
68
|
+
export declare function getModifiedFiles(options?: Partial<ExecSyncOptionsWithStringEncoding>): string[];
|
|
69
|
+
export declare function commitStagedFiles(messages: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
70
|
+
export declare function pushCommits(options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
66
71
|
export {};
|
package/dist/commands/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
|
|
2
|
-
import { MiniPackageJson } from '../packageJson';
|
|
2
|
+
import { MiniPackageJson } from '../packageJson.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Sets the exit code to 1 and prints the error message to stderr.
|
|
5
5
|
* This is used to indicate an error condition in the script.
|
|
@@ -10,7 +10,7 @@ export declare function error(...messages: unknown[]): void;
|
|
|
10
10
|
* This is used to indicate a fatal error that cannot be recovered from.
|
|
11
11
|
*/
|
|
12
12
|
export declare function errorAndExit(...messages: unknown[]): never;
|
|
13
|
-
export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding
|
|
13
|
+
export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>, quiet?: boolean): string;
|
|
14
14
|
export declare function findRepositoryRoot(): string;
|
|
15
15
|
export declare function isURL(source: string): boolean;
|
|
16
16
|
/**
|
|
@@ -63,4 +63,9 @@ export declare function getAffectedPackages(changed: Iterable<string>, options?:
|
|
|
63
63
|
* Helper to check if an error is a SIGINT (interrupt) error.
|
|
64
64
|
*/
|
|
65
65
|
export declare function isSigint(err: unknown): boolean;
|
|
66
|
+
export declare function getBranchName(): string;
|
|
67
|
+
export declare function getStagedFiles(options?: Partial<ExecSyncOptionsWithStringEncoding>): string[];
|
|
68
|
+
export declare function getModifiedFiles(options?: Partial<ExecSyncOptionsWithStringEncoding>): string[];
|
|
69
|
+
export declare function commitStagedFiles(messages: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
70
|
+
export declare function pushCommits(options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
66
71
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
2
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
25
|
const node_fs = require("node:fs");
|
|
4
26
|
const promises = require("node:fs/promises");
|
|
5
27
|
const node_child_process = require("node:child_process");
|
|
6
28
|
const path$1 = require("path");
|
|
7
29
|
const node_url = require("node:url");
|
|
8
|
-
const posix = require("path/posix");
|
|
9
|
-
const win32 = require("path/win32");
|
|
10
|
-
const dts = require("vite-plugin-dts");
|
|
11
30
|
const node_module = require("node:module");
|
|
12
31
|
const existsAsync = async (file) => (
|
|
13
32
|
// Using un-promisified version because promises version creates exceptions
|
|
@@ -24,7 +43,7 @@ async function createFileIfNotExists(filePath, content) {
|
|
|
24
43
|
function findPath(target, startDirectory = process.cwd()) {
|
|
25
44
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? path$1.dirname(node_url.fileURLToPath(startDirectory)) : path$1.resolve(startDirectory);
|
|
26
45
|
const parentPath = resolvedStartDirectory.split(path$1.sep);
|
|
27
|
-
while (parentPath.length >
|
|
46
|
+
while (parentPath.length > searchStopIndex) {
|
|
28
47
|
const fullPath = path$1.join(
|
|
29
48
|
...path$1.sep === "/" ? ["/"] : [],
|
|
30
49
|
...parentPath,
|
|
@@ -37,10 +56,11 @@ function findPath(target, startDirectory = process.cwd()) {
|
|
|
37
56
|
}
|
|
38
57
|
return void 0;
|
|
39
58
|
}
|
|
59
|
+
const searchStopIndex = path$1.sep === "/" ? 2 : 0;
|
|
40
60
|
async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
41
61
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? path$1.dirname(node_url.fileURLToPath(startDirectory)) : path$1.resolve(startDirectory);
|
|
42
62
|
const parentPath = resolvedStartDirectory.split(path$1.sep);
|
|
43
|
-
while (parentPath.length >
|
|
63
|
+
while (parentPath.length > searchStopIndex) {
|
|
44
64
|
const fullPath = path$1.join(
|
|
45
65
|
...path$1.sep === "/" ? ["/"] : [],
|
|
46
66
|
...parentPath,
|
|
@@ -76,50 +96,53 @@ function fixMatchFilesSyntax(pattern) {
|
|
|
76
96
|
}
|
|
77
97
|
return pattern.endsWith("/*") ? `${pattern}*` : pattern.endsWith("/") ? `${pattern}**` : `${pattern}/**`;
|
|
78
98
|
}
|
|
79
|
-
const isPosix = path$1.sep === posix.sep;
|
|
80
|
-
const toPosixPathSeparators = (relativePath) => relativePath.includes(win32.sep) ? relativePath.replaceAll(win32.sep, posix.sep) : relativePath;
|
|
99
|
+
const isPosix = path$1.sep === path$1.posix.sep;
|
|
100
|
+
const toPosixPathSeparators = (relativePath) => relativePath.includes(path$1.win32.sep) ? relativePath.replaceAll(path$1.win32.sep, path$1.posix.sep) : relativePath;
|
|
81
101
|
const normalizePath = isPosix ? (path2) => path2 : toPosixPathSeparators;
|
|
82
|
-
const toWin32PathSeparators = (relativePath) => relativePath.includes(posix.sep) ? relativePath.replaceAll(posix.sep, win32.sep) : relativePath;
|
|
102
|
+
const toWin32PathSeparators = (relativePath) => relativePath.includes(path$1.posix.sep) ? relativePath.replaceAll(path$1.posix.sep, path$1.win32.sep) : relativePath;
|
|
83
103
|
const toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators;
|
|
84
104
|
const getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd());
|
|
85
|
-
const path = isPosix ? posix : {
|
|
86
|
-
...win32,
|
|
87
|
-
sep: posix.sep,
|
|
105
|
+
const path = isPosix ? path$1.posix : {
|
|
106
|
+
...path$1.win32,
|
|
107
|
+
sep: path$1.posix.sep,
|
|
88
108
|
join(...paths) {
|
|
89
|
-
const result = win32.join(...paths);
|
|
109
|
+
const result = path$1.win32.join(...paths);
|
|
90
110
|
return toPosixPathSeparators(result);
|
|
91
111
|
},
|
|
92
112
|
normalize(path2) {
|
|
93
|
-
const result = win32.normalize(path2);
|
|
113
|
+
const result = path$1.win32.normalize(path2);
|
|
94
114
|
return toPosixPathSeparators(result);
|
|
95
115
|
},
|
|
96
116
|
relative(from, to) {
|
|
97
|
-
const result = win32.relative(from, to);
|
|
117
|
+
const result = path$1.win32.relative(from, to);
|
|
98
118
|
return toPosixPathSeparators(result);
|
|
99
119
|
},
|
|
100
120
|
dirname(path2) {
|
|
101
|
-
const result = win32.dirname(path2);
|
|
121
|
+
const result = path$1.win32.dirname(path2);
|
|
102
122
|
return toPosixPathSeparators(result);
|
|
103
123
|
},
|
|
104
124
|
resolve(...paths) {
|
|
105
|
-
const result = win32.resolve(...paths);
|
|
125
|
+
const result = path$1.win32.resolve(...paths);
|
|
106
126
|
return toPosixPathSeparators(result);
|
|
107
127
|
},
|
|
108
128
|
toNamespacedPath(path2) {
|
|
109
|
-
const result = win32.toNamespacedPath(path2);
|
|
129
|
+
const result = path$1.win32.toNamespacedPath(path2);
|
|
110
130
|
return toPosixPathSeparators(result);
|
|
111
131
|
}
|
|
112
132
|
};
|
|
113
133
|
const cachedPackageJson = {};
|
|
114
134
|
const cachedPackageJsonPromises = {};
|
|
115
135
|
let rootPackageJsonLocation;
|
|
116
|
-
function retrievePackageJson(location) {
|
|
136
|
+
function retrievePackageJson(location, cache = true) {
|
|
117
137
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
118
|
-
|
|
119
|
-
|
|
138
|
+
if (cache) {
|
|
139
|
+
cachedPackageJson[packageJsonPath] ??= JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
|
|
140
|
+
return cachedPackageJson[packageJsonPath];
|
|
141
|
+
}
|
|
142
|
+
return JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
|
|
120
143
|
}
|
|
121
|
-
async function asyncRetrievePackageJson(location
|
|
122
|
-
const packageJsonPath = path.resolve(location, "package.json");
|
|
144
|
+
async function asyncRetrievePackageJson(location) {
|
|
145
|
+
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
123
146
|
if (packageJsonPath in cachedPackageJson) {
|
|
124
147
|
return cachedPackageJson[packageJsonPath];
|
|
125
148
|
}
|
|
@@ -193,7 +216,7 @@ function vitePresetPlugin({
|
|
|
193
216
|
build: {
|
|
194
217
|
// REFACTOR: get this from tsconfig
|
|
195
218
|
// It's a best practice to let the final bundler down-level as needed.
|
|
196
|
-
target: target ?? "
|
|
219
|
+
target: target ?? "es2024"
|
|
197
220
|
},
|
|
198
221
|
define: env.mode === "test" ? {
|
|
199
222
|
"process.env.ESRI_INTERNAL": true
|
|
@@ -208,54 +231,59 @@ function vitePresetPlugin({
|
|
|
208
231
|
externalize,
|
|
209
232
|
bundleIn
|
|
210
233
|
}),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
234
|
+
// This dependency pulls in many others. Since components-build-utils has a
|
|
235
|
+
// single entry point, we load a large module tree needlessly. To avoid,
|
|
236
|
+
// load the plugin on demand.
|
|
237
|
+
import("vite-plugin-dts").then(
|
|
238
|
+
({ default: dts }) => dts({
|
|
239
|
+
logLevel: "warn",
|
|
240
|
+
// Copies .d.ts files to d.cjs file for CommonJS.
|
|
241
|
+
// Adds a performance hit as it occurs after the build
|
|
242
|
+
async afterBuild(emitted) {
|
|
243
|
+
if (userConfig?.build?.lib && userConfig.build.lib.formats?.includes("cjs")) {
|
|
244
|
+
await Promise.all(
|
|
245
|
+
emitted.entries().map(async ([filePath, content]) => {
|
|
246
|
+
if (filePath.endsWith(".d.ts")) {
|
|
247
|
+
await promises.writeFile(filePath.replace(".d.ts", ".d.cts"), content);
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
await dtsOptions?.afterBuild?.(emitted);
|
|
253
|
+
},
|
|
254
|
+
...dtsOptions,
|
|
255
|
+
compilerOptions: {
|
|
256
|
+
// For details, see comment above excludeOutsideFiles in
|
|
257
|
+
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
258
|
+
rootDir: ".",
|
|
259
|
+
...dtsOptions.compilerOptions
|
|
260
|
+
},
|
|
261
|
+
/**
|
|
262
|
+
* Do not emit any .d.ts files for files outside the dist directory
|
|
263
|
+
* (i.e vite.config.ts, storybook stories and etc)
|
|
264
|
+
* This also applies for references to node_modules/.../components.d.ts files in
|
|
265
|
+
* tsconfig.json - these must be included in TypeScript program to provide
|
|
266
|
+
* types, but should not be re-emitted during build.
|
|
267
|
+
*/
|
|
268
|
+
beforeWriteFile: async (filePath, content) => {
|
|
269
|
+
if (filePath.startsWith(distSrc) && !shouldSkip(filePath)) {
|
|
270
|
+
const baseBeforeWriteFile = dtsOptions?.beforeWriteFile ?? ((filePath2, content2) => ({ filePath: filePath2, content: content2 }));
|
|
271
|
+
return await baseBeforeWriteFile(`${dist}${filePath.slice(distSrc.length)}`, content);
|
|
272
|
+
} else {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
afterDiagnostic(diagnostics) {
|
|
277
|
+
const hasErrors = diagnostics.length > 0;
|
|
278
|
+
const isBuilding = command === "build";
|
|
279
|
+
const stopBuild = hasErrors && isBuilding;
|
|
280
|
+
if (stopBuild) {
|
|
281
|
+
throw new Error("TypeScript errors reported. See error messages above");
|
|
282
|
+
}
|
|
283
|
+
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
255
284
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
})
|
|
285
|
+
})
|
|
286
|
+
)
|
|
259
287
|
];
|
|
260
288
|
}
|
|
261
289
|
function shouldSkip(id) {
|
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 MiniPackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson';
|
|
5
|
-
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
|
|
1
|
+
export { existsAsync, sh, 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 MiniPackageJson, 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 MiniPackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson';
|
|
5
|
-
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
|
|
1
|
+
export { existsAsync, sh, 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 MiniPackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson.ts';
|
|
5
|
+
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { access, existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { constants, mkdir, writeFile, readFile } from "node:fs/promises";
|
|
3
3
|
import { execSync } from "node:child_process";
|
|
4
|
-
import { dirname, resolve, sep, join } from "path";
|
|
4
|
+
import { dirname, resolve, sep, join, posix, win32 } from "path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import posix from "path/posix";
|
|
7
|
-
import win32 from "path/win32";
|
|
8
|
-
import dts from "vite-plugin-dts";
|
|
9
6
|
import { builtinModules } from "node:module";
|
|
10
7
|
const existsAsync = async (file) => (
|
|
11
8
|
// Using un-promisified version because promises version creates exceptions
|
|
@@ -22,7 +19,7 @@ async function createFileIfNotExists(filePath, content) {
|
|
|
22
19
|
function findPath(target, startDirectory = process.cwd()) {
|
|
23
20
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory);
|
|
24
21
|
const parentPath = resolvedStartDirectory.split(sep);
|
|
25
|
-
while (parentPath.length >
|
|
22
|
+
while (parentPath.length > searchStopIndex) {
|
|
26
23
|
const fullPath = join(
|
|
27
24
|
...sep === "/" ? ["/"] : [],
|
|
28
25
|
...parentPath,
|
|
@@ -35,10 +32,11 @@ function findPath(target, startDirectory = process.cwd()) {
|
|
|
35
32
|
}
|
|
36
33
|
return void 0;
|
|
37
34
|
}
|
|
35
|
+
const searchStopIndex = sep === "/" ? 2 : 0;
|
|
38
36
|
async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
39
37
|
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory);
|
|
40
38
|
const parentPath = resolvedStartDirectory.split(sep);
|
|
41
|
-
while (parentPath.length >
|
|
39
|
+
while (parentPath.length > searchStopIndex) {
|
|
42
40
|
const fullPath = join(
|
|
43
41
|
...sep === "/" ? ["/"] : [],
|
|
44
42
|
...parentPath,
|
|
@@ -111,13 +109,16 @@ const path = isPosix ? posix : {
|
|
|
111
109
|
const cachedPackageJson = {};
|
|
112
110
|
const cachedPackageJsonPromises = {};
|
|
113
111
|
let rootPackageJsonLocation;
|
|
114
|
-
function retrievePackageJson(location) {
|
|
112
|
+
function retrievePackageJson(location, cache = true) {
|
|
115
113
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
if (cache) {
|
|
115
|
+
cachedPackageJson[packageJsonPath] ??= JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
116
|
+
return cachedPackageJson[packageJsonPath];
|
|
117
|
+
}
|
|
118
|
+
return JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
118
119
|
}
|
|
119
|
-
async function asyncRetrievePackageJson(location
|
|
120
|
-
const packageJsonPath = path.resolve(location, "package.json");
|
|
120
|
+
async function asyncRetrievePackageJson(location) {
|
|
121
|
+
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
121
122
|
if (packageJsonPath in cachedPackageJson) {
|
|
122
123
|
return cachedPackageJson[packageJsonPath];
|
|
123
124
|
}
|
|
@@ -191,7 +192,7 @@ function vitePresetPlugin({
|
|
|
191
192
|
build: {
|
|
192
193
|
// REFACTOR: get this from tsconfig
|
|
193
194
|
// It's a best practice to let the final bundler down-level as needed.
|
|
194
|
-
target: target ?? "
|
|
195
|
+
target: target ?? "es2024"
|
|
195
196
|
},
|
|
196
197
|
define: env.mode === "test" ? {
|
|
197
198
|
"process.env.ESRI_INTERNAL": true
|
|
@@ -206,54 +207,59 @@ function vitePresetPlugin({
|
|
|
206
207
|
externalize,
|
|
207
208
|
bundleIn
|
|
208
209
|
}),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
210
|
+
// This dependency pulls in many others. Since components-build-utils has a
|
|
211
|
+
// single entry point, we load a large module tree needlessly. To avoid,
|
|
212
|
+
// load the plugin on demand.
|
|
213
|
+
import("vite-plugin-dts").then(
|
|
214
|
+
({ default: dts }) => dts({
|
|
215
|
+
logLevel: "warn",
|
|
216
|
+
// Copies .d.ts files to d.cjs file for CommonJS.
|
|
217
|
+
// Adds a performance hit as it occurs after the build
|
|
218
|
+
async afterBuild(emitted) {
|
|
219
|
+
if (userConfig?.build?.lib && userConfig.build.lib.formats?.includes("cjs")) {
|
|
220
|
+
await Promise.all(
|
|
221
|
+
emitted.entries().map(async ([filePath, content]) => {
|
|
222
|
+
if (filePath.endsWith(".d.ts")) {
|
|
223
|
+
await writeFile(filePath.replace(".d.ts", ".d.cts"), content);
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
await dtsOptions?.afterBuild?.(emitted);
|
|
229
|
+
},
|
|
230
|
+
...dtsOptions,
|
|
231
|
+
compilerOptions: {
|
|
232
|
+
// For details, see comment above excludeOutsideFiles in
|
|
233
|
+
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
234
|
+
rootDir: ".",
|
|
235
|
+
...dtsOptions.compilerOptions
|
|
236
|
+
},
|
|
237
|
+
/**
|
|
238
|
+
* Do not emit any .d.ts files for files outside the dist directory
|
|
239
|
+
* (i.e vite.config.ts, storybook stories and etc)
|
|
240
|
+
* This also applies for references to node_modules/.../components.d.ts files in
|
|
241
|
+
* tsconfig.json - these must be included in TypeScript program to provide
|
|
242
|
+
* types, but should not be re-emitted during build.
|
|
243
|
+
*/
|
|
244
|
+
beforeWriteFile: async (filePath, content) => {
|
|
245
|
+
if (filePath.startsWith(distSrc) && !shouldSkip(filePath)) {
|
|
246
|
+
const baseBeforeWriteFile = dtsOptions?.beforeWriteFile ?? ((filePath2, content2) => ({ filePath: filePath2, content: content2 }));
|
|
247
|
+
return await baseBeforeWriteFile(`${dist}${filePath.slice(distSrc.length)}`, content);
|
|
248
|
+
} else {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
afterDiagnostic(diagnostics) {
|
|
253
|
+
const hasErrors = diagnostics.length > 0;
|
|
254
|
+
const isBuilding = command === "build";
|
|
255
|
+
const stopBuild = hasErrors && isBuilding;
|
|
256
|
+
if (stopBuild) {
|
|
257
|
+
throw new Error("TypeScript errors reported. See error messages above");
|
|
258
|
+
}
|
|
259
|
+
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
253
260
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
})
|
|
261
|
+
})
|
|
262
|
+
)
|
|
257
263
|
];
|
|
258
264
|
}
|
|
259
265
|
function shouldSkip(id) {
|
package/dist/packageJson.d.cts
CHANGED
|
@@ -32,8 +32,9 @@ export type MiniPackageJson = {
|
|
|
32
32
|
deployBuilds?: Record<string, unknown>;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
export declare function retrievePackageJson(location?: string): MiniPackageJson;
|
|
35
|
+
export declare function retrievePackageJson(location?: string, cache?: boolean): MiniPackageJson;
|
|
36
36
|
export declare function asyncRetrievePackageJson(location?: string): Promise<MiniPackageJson>;
|
|
37
|
+
export declare function asyncWritePackageJson(location: string, content: MiniPackageJson): Promise<string>;
|
|
37
38
|
/**
|
|
38
39
|
* Returns an absolute path to the root of a package in node_modules, without
|
|
39
40
|
* trailing slash.
|
package/dist/packageJson.d.ts
CHANGED
|
@@ -32,8 +32,9 @@ export type MiniPackageJson = {
|
|
|
32
32
|
deployBuilds?: Record<string, unknown>;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
export declare function retrievePackageJson(location?: string): MiniPackageJson;
|
|
35
|
+
export declare function retrievePackageJson(location?: string, cache?: boolean): MiniPackageJson;
|
|
36
36
|
export declare function asyncRetrievePackageJson(location?: string): Promise<MiniPackageJson>;
|
|
37
|
+
export declare function asyncWritePackageJson(location: string, content: MiniPackageJson): Promise<string>;
|
|
37
38
|
/**
|
|
38
39
|
* Returns an absolute path to the root of a package in node_modules, without
|
|
39
40
|
* trailing slash.
|
package/dist/path.d.cts
CHANGED
package/dist/path.d.ts
CHANGED
package/dist/vite.d.cts
CHANGED
|
@@ -8,7 +8,7 @@ import { default as dts } from 'vite-plugin-dts';
|
|
|
8
8
|
export declare function vitePresetPlugin({ dtsOptions, externalize, bundleIn, }?: DependencyManagementOptions & {
|
|
9
9
|
/** Additional options for `vite-plugin-dts` */
|
|
10
10
|
dtsOptions?: Parameters<typeof dts>[0];
|
|
11
|
-
}): [Plugin, Plugin, Plugin];
|
|
11
|
+
}): [Plugin, Plugin, Promise<Plugin>];
|
|
12
12
|
/**
|
|
13
13
|
* Options for externalizing dependencies.
|
|
14
14
|
*/
|
package/dist/vite.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { default as dts } from 'vite-plugin-dts';
|
|
|
8
8
|
export declare function vitePresetPlugin({ dtsOptions, externalize, bundleIn, }?: DependencyManagementOptions & {
|
|
9
9
|
/** Additional options for `vite-plugin-dts` */
|
|
10
10
|
dtsOptions?: Parameters<typeof dts>[0];
|
|
11
|
-
}): [Plugin, Plugin, Plugin];
|
|
11
|
+
}): [Plugin, Plugin, Promise<Plugin>];
|
|
12
12
|
/**
|
|
13
13
|
* Options for externalizing dependencies.
|
|
14
14
|
*/
|
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.71",
|
|
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",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@actions/core": "^1.11.0",
|
|
25
26
|
"@commander-js/extra-typings": "^14.0.0",
|
|
26
27
|
"chalk": "^5.4.1",
|
|
27
28
|
"commander": "^14.0.0",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"semver": "^7.7.2",
|
|
34
35
|
"split2": "^4.2.0",
|
|
35
36
|
"tslib": "^2.8.1",
|
|
36
|
-
"vite": "^7.
|
|
37
|
+
"vite": "^7.2.2",
|
|
37
38
|
"vite-plugin-dts": "^4.5.4"
|
|
38
39
|
}
|
|
39
40
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|