@arcgis/components-build-utils 5.0.0-next.6 → 5.0.0-next.60
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 +1 -1
- package/dist/commands/compare-rss.d.ts +1 -1
- package/dist/commands/migrate-repo-issues/zentopia.d.cts +1 -1
- package/dist/commands/migrate-repo-issues/zentopia.d.ts +1 -1
- package/dist/commands/update-core-dep.d.cts +2 -0
- package/dist/commands/update-core-dep.d.ts +2 -0
- package/dist/commands/utils.d.cts +5 -1
- package/dist/commands/utils.d.ts +5 -1
- package/dist/index.cjs +92 -65
- package/dist/index.js +59 -54
- 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 +2 -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
|
@@ -5,6 +5,6 @@ import { Command } from 'commander';
|
|
|
5
5
|
* You need to make sure node trusts the certificate authority that signed the certificate used by qawebgis.esri.com
|
|
6
6
|
*
|
|
7
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
|
|
8
|
+
* Reference: https://qawebgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
9
9
|
*/
|
|
10
10
|
export declare const registerCommand: (command: Command) => undefined;
|
|
@@ -5,6 +5,6 @@ import { Command } from 'commander';
|
|
|
5
5
|
* You need to make sure node trusts the certificate authority that signed the certificate used by qawebgis.esri.com
|
|
6
6
|
*
|
|
7
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
|
|
8
|
+
* Reference: https://qawebgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
9
9
|
*/
|
|
10
10
|
export declare const registerCommand: (command: Command) => undefined;
|
|
@@ -30,7 +30,7 @@ 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://qawebgis.esri.com/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
33
|
+
* Reference: https://qawebgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
34
34
|
*/
|
|
35
35
|
declare class Zentopia {
|
|
36
36
|
readonly repoId: number;
|
|
@@ -30,7 +30,7 @@ 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://qawebgis.esri.com/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
33
|
+
* Reference: https://qawebgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
|
|
34
34
|
*/
|
|
35
35
|
declare class Zentopia {
|
|
36
36
|
readonly repoId: number;
|
|
@@ -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,8 @@ 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 commitStagedFiles(messages: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
69
|
+
export declare function pushCommits(options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
66
70
|
export {};
|
package/dist/commands/utils.d.ts
CHANGED
|
@@ -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,8 @@ 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 commitStagedFiles(messages: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
69
|
+
export declare function pushCommits(options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
|
|
66
70
|
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
|
|
@@ -76,47 +95,50 @@ function fixMatchFilesSyntax(pattern) {
|
|
|
76
95
|
}
|
|
77
96
|
return pattern.endsWith("/*") ? `${pattern}*` : pattern.endsWith("/") ? `${pattern}**` : `${pattern}/**`;
|
|
78
97
|
}
|
|
79
|
-
const isPosix = path$1.sep === posix.sep;
|
|
80
|
-
const toPosixPathSeparators = (relativePath) => relativePath.includes(win32.sep) ? relativePath.replaceAll(win32.sep, posix.sep) : relativePath;
|
|
98
|
+
const isPosix = path$1.sep === path$1.posix.sep;
|
|
99
|
+
const toPosixPathSeparators = (relativePath) => relativePath.includes(path$1.win32.sep) ? relativePath.replaceAll(path$1.win32.sep, path$1.posix.sep) : relativePath;
|
|
81
100
|
const normalizePath = isPosix ? (path2) => path2 : toPosixPathSeparators;
|
|
82
|
-
const toWin32PathSeparators = (relativePath) => relativePath.includes(posix.sep) ? relativePath.replaceAll(posix.sep, win32.sep) : relativePath;
|
|
101
|
+
const toWin32PathSeparators = (relativePath) => relativePath.includes(path$1.posix.sep) ? relativePath.replaceAll(path$1.posix.sep, path$1.win32.sep) : relativePath;
|
|
83
102
|
const toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators;
|
|
84
103
|
const getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd());
|
|
85
|
-
const path = isPosix ? posix : {
|
|
86
|
-
...win32,
|
|
87
|
-
sep: posix.sep,
|
|
104
|
+
const path = isPosix ? path$1.posix : {
|
|
105
|
+
...path$1.win32,
|
|
106
|
+
sep: path$1.posix.sep,
|
|
88
107
|
join(...paths) {
|
|
89
|
-
const result = win32.join(...paths);
|
|
108
|
+
const result = path$1.win32.join(...paths);
|
|
90
109
|
return toPosixPathSeparators(result);
|
|
91
110
|
},
|
|
92
111
|
normalize(path2) {
|
|
93
|
-
const result = win32.normalize(path2);
|
|
112
|
+
const result = path$1.win32.normalize(path2);
|
|
94
113
|
return toPosixPathSeparators(result);
|
|
95
114
|
},
|
|
96
115
|
relative(from, to) {
|
|
97
|
-
const result = win32.relative(from, to);
|
|
116
|
+
const result = path$1.win32.relative(from, to);
|
|
98
117
|
return toPosixPathSeparators(result);
|
|
99
118
|
},
|
|
100
119
|
dirname(path2) {
|
|
101
|
-
const result = win32.dirname(path2);
|
|
120
|
+
const result = path$1.win32.dirname(path2);
|
|
102
121
|
return toPosixPathSeparators(result);
|
|
103
122
|
},
|
|
104
123
|
resolve(...paths) {
|
|
105
|
-
const result = win32.resolve(...paths);
|
|
124
|
+
const result = path$1.win32.resolve(...paths);
|
|
106
125
|
return toPosixPathSeparators(result);
|
|
107
126
|
},
|
|
108
127
|
toNamespacedPath(path2) {
|
|
109
|
-
const result = win32.toNamespacedPath(path2);
|
|
128
|
+
const result = path$1.win32.toNamespacedPath(path2);
|
|
110
129
|
return toPosixPathSeparators(result);
|
|
111
130
|
}
|
|
112
131
|
};
|
|
113
132
|
const cachedPackageJson = {};
|
|
114
133
|
const cachedPackageJsonPromises = {};
|
|
115
134
|
let rootPackageJsonLocation;
|
|
116
|
-
function retrievePackageJson(location) {
|
|
135
|
+
function retrievePackageJson(location, cache = true) {
|
|
117
136
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
118
|
-
|
|
119
|
-
|
|
137
|
+
if (cache) {
|
|
138
|
+
cachedPackageJson[packageJsonPath] ??= JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
|
|
139
|
+
return cachedPackageJson[packageJsonPath];
|
|
140
|
+
}
|
|
141
|
+
return JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
|
|
120
142
|
}
|
|
121
143
|
async function asyncRetrievePackageJson(location = getCwd()) {
|
|
122
144
|
const packageJsonPath = path.resolve(location, "package.json");
|
|
@@ -208,54 +230,59 @@ function vitePresetPlugin({
|
|
|
208
230
|
externalize,
|
|
209
231
|
bundleIn
|
|
210
232
|
}),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
233
|
+
// This dependency pulls in many others. Since components-build-utils has a
|
|
234
|
+
// single entry point, we load a large module tree needlessly. To avoid,
|
|
235
|
+
// load the plugin on demand.
|
|
236
|
+
import("vite-plugin-dts").then(
|
|
237
|
+
({ default: dts }) => dts({
|
|
238
|
+
logLevel: "warn",
|
|
239
|
+
// Copies .d.ts files to d.cjs file for CommonJS.
|
|
240
|
+
// Adds a performance hit as it occurs after the build
|
|
241
|
+
async afterBuild(emitted) {
|
|
242
|
+
if (userConfig?.build?.lib && userConfig.build.lib.formats?.includes("cjs")) {
|
|
243
|
+
await Promise.all(
|
|
244
|
+
emitted.entries().map(async ([filePath, content]) => {
|
|
245
|
+
if (filePath.endsWith(".d.ts")) {
|
|
246
|
+
await promises.writeFile(filePath.replace(".d.ts", ".d.cts"), content);
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
await dtsOptions?.afterBuild?.(emitted);
|
|
252
|
+
},
|
|
253
|
+
...dtsOptions,
|
|
254
|
+
compilerOptions: {
|
|
255
|
+
// For details, see comment above excludeOutsideFiles in
|
|
256
|
+
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
257
|
+
rootDir: ".",
|
|
258
|
+
...dtsOptions.compilerOptions
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* Do not emit any .d.ts files for files outside the dist directory
|
|
262
|
+
* (i.e vite.config.ts, storybook stories and etc)
|
|
263
|
+
* This also applies for references to node_modules/.../components.d.ts files in
|
|
264
|
+
* tsconfig.json - these must be included in TypeScript program to provide
|
|
265
|
+
* types, but should not be re-emitted during build.
|
|
266
|
+
*/
|
|
267
|
+
beforeWriteFile: async (filePath, content) => {
|
|
268
|
+
if (filePath.startsWith(distSrc) && !shouldSkip(filePath)) {
|
|
269
|
+
const baseBeforeWriteFile = dtsOptions?.beforeWriteFile ?? ((filePath2, content2) => ({ filePath: filePath2, content: content2 }));
|
|
270
|
+
return await baseBeforeWriteFile(`${dist}${filePath.slice(distSrc.length)}`, content);
|
|
271
|
+
} else {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
afterDiagnostic(diagnostics) {
|
|
276
|
+
const hasErrors = diagnostics.length > 0;
|
|
277
|
+
const isBuilding = command === "build";
|
|
278
|
+
const stopBuild = hasErrors && isBuilding;
|
|
279
|
+
if (stopBuild) {
|
|
280
|
+
throw new Error("TypeScript errors reported. See error messages above");
|
|
281
|
+
}
|
|
282
|
+
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
224
283
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
...dtsOptions,
|
|
228
|
-
compilerOptions: {
|
|
229
|
-
// For details, see comment above excludeOutsideFiles in
|
|
230
|
-
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
231
|
-
rootDir: ".",
|
|
232
|
-
...dtsOptions.compilerOptions
|
|
233
|
-
},
|
|
234
|
-
/**
|
|
235
|
-
* Do not emit any .d.ts files for files outside the dist directory
|
|
236
|
-
* (i.e vite.config.ts, storybook stories and etc)
|
|
237
|
-
* This also applies for references to node_modules/.../components.d.ts files in
|
|
238
|
-
* tsconfig.json - these must be included in TypeScript program to provide
|
|
239
|
-
* types, but should not be re-emitted during build.
|
|
240
|
-
*/
|
|
241
|
-
beforeWriteFile: async (filePath, content) => {
|
|
242
|
-
if (filePath.startsWith(distSrc) && !shouldSkip(filePath)) {
|
|
243
|
-
const baseBeforeWriteFile = dtsOptions?.beforeWriteFile ?? ((filePath2, content2) => ({ filePath: filePath2, content: content2 }));
|
|
244
|
-
return await baseBeforeWriteFile(`${dist}${filePath.slice(distSrc.length)}`, content);
|
|
245
|
-
} else {
|
|
246
|
-
return false;
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
afterDiagnostic(diagnostics) {
|
|
250
|
-
const hasErrors = diagnostics.length > 0;
|
|
251
|
-
const isBuilding = command === "build";
|
|
252
|
-
const stopBuild = hasErrors && isBuilding;
|
|
253
|
-
if (stopBuild) {
|
|
254
|
-
throw new Error("TypeScript errors reported. See error messages above");
|
|
255
|
-
}
|
|
256
|
-
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
257
|
-
}
|
|
258
|
-
})
|
|
284
|
+
})
|
|
285
|
+
)
|
|
259
286
|
];
|
|
260
287
|
}
|
|
261
288
|
function shouldSkip(id) {
|
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
|
|
@@ -111,10 +108,13 @@ const path = isPosix ? posix : {
|
|
|
111
108
|
const cachedPackageJson = {};
|
|
112
109
|
const cachedPackageJsonPromises = {};
|
|
113
110
|
let rootPackageJsonLocation;
|
|
114
|
-
function retrievePackageJson(location) {
|
|
111
|
+
function retrievePackageJson(location, cache = true) {
|
|
115
112
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
if (cache) {
|
|
114
|
+
cachedPackageJson[packageJsonPath] ??= JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
115
|
+
return cachedPackageJson[packageJsonPath];
|
|
116
|
+
}
|
|
117
|
+
return JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
118
118
|
}
|
|
119
119
|
async function asyncRetrievePackageJson(location = getCwd()) {
|
|
120
120
|
const packageJsonPath = path.resolve(location, "package.json");
|
|
@@ -206,54 +206,59 @@ function vitePresetPlugin({
|
|
|
206
206
|
externalize,
|
|
207
207
|
bundleIn
|
|
208
208
|
}),
|
|
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
|
-
|
|
209
|
+
// This dependency pulls in many others. Since components-build-utils has a
|
|
210
|
+
// single entry point, we load a large module tree needlessly. To avoid,
|
|
211
|
+
// load the plugin on demand.
|
|
212
|
+
import("vite-plugin-dts").then(
|
|
213
|
+
({ default: dts }) => dts({
|
|
214
|
+
logLevel: "warn",
|
|
215
|
+
// Copies .d.ts files to d.cjs file for CommonJS.
|
|
216
|
+
// Adds a performance hit as it occurs after the build
|
|
217
|
+
async afterBuild(emitted) {
|
|
218
|
+
if (userConfig?.build?.lib && userConfig.build.lib.formats?.includes("cjs")) {
|
|
219
|
+
await Promise.all(
|
|
220
|
+
emitted.entries().map(async ([filePath, content]) => {
|
|
221
|
+
if (filePath.endsWith(".d.ts")) {
|
|
222
|
+
await writeFile(filePath.replace(".d.ts", ".d.cts"), content);
|
|
223
|
+
}
|
|
224
|
+
})
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
await dtsOptions?.afterBuild?.(emitted);
|
|
228
|
+
},
|
|
229
|
+
...dtsOptions,
|
|
230
|
+
compilerOptions: {
|
|
231
|
+
// For details, see comment above excludeOutsideFiles in
|
|
232
|
+
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
233
|
+
rootDir: ".",
|
|
234
|
+
...dtsOptions.compilerOptions
|
|
235
|
+
},
|
|
236
|
+
/**
|
|
237
|
+
* Do not emit any .d.ts files for files outside the dist directory
|
|
238
|
+
* (i.e vite.config.ts, storybook stories and etc)
|
|
239
|
+
* This also applies for references to node_modules/.../components.d.ts files in
|
|
240
|
+
* tsconfig.json - these must be included in TypeScript program to provide
|
|
241
|
+
* types, but should not be re-emitted during build.
|
|
242
|
+
*/
|
|
243
|
+
beforeWriteFile: async (filePath, content) => {
|
|
244
|
+
if (filePath.startsWith(distSrc) && !shouldSkip(filePath)) {
|
|
245
|
+
const baseBeforeWriteFile = dtsOptions?.beforeWriteFile ?? ((filePath2, content2) => ({ filePath: filePath2, content: content2 }));
|
|
246
|
+
return await baseBeforeWriteFile(`${dist}${filePath.slice(distSrc.length)}`, content);
|
|
247
|
+
} else {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
afterDiagnostic(diagnostics) {
|
|
252
|
+
const hasErrors = diagnostics.length > 0;
|
|
253
|
+
const isBuilding = command === "build";
|
|
254
|
+
const stopBuild = hasErrors && isBuilding;
|
|
255
|
+
if (stopBuild) {
|
|
256
|
+
throw new Error("TypeScript errors reported. See error messages above");
|
|
257
|
+
}
|
|
258
|
+
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
245
259
|
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
const hasErrors = diagnostics.length > 0;
|
|
249
|
-
const isBuilding = command === "build";
|
|
250
|
-
const stopBuild = hasErrors && isBuilding;
|
|
251
|
-
if (stopBuild) {
|
|
252
|
-
throw new Error("TypeScript errors reported. See error messages above");
|
|
253
|
-
}
|
|
254
|
-
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
255
|
-
}
|
|
256
|
-
})
|
|
260
|
+
})
|
|
261
|
+
)
|
|
257
262
|
];
|
|
258
263
|
}
|
|
259
264
|
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.60",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"semver": "^7.7.2",
|
|
34
34
|
"split2": "^4.2.0",
|
|
35
35
|
"tslib": "^2.8.1",
|
|
36
|
-
"vite": "^7.
|
|
36
|
+
"vite": "^7.2.2",
|
|
37
37
|
"vite-plugin-dts": "^4.5.4"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
File without changes
|
|
File without changes
|