@arcgis/components-build-utils 4.33.0-next.13 → 4.33.0-next.133
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/copy-folder.d.cts +2 -0
- package/dist/commands/copy-folder.d.ts +2 -0
- package/dist/commands/create-mock-doc.d.cts +2 -0
- package/dist/commands/create-mock-doc.d.ts +2 -0
- package/dist/commands/detect-broken-links.d.cts +2 -0
- package/dist/commands/detect-broken-links.d.ts +2 -0
- package/dist/commands/detect-large-files.d.cts +3 -0
- package/dist/commands/detect-large-files.d.ts +3 -0
- package/dist/commands/ensure-working-tree-clean.d.cts +5 -0
- package/dist/commands/ensure-working-tree-clean.d.ts +5 -0
- package/dist/commands/generate-t9n-manifest.d.cts +2 -0
- package/dist/commands/generate-t9n-manifest.d.ts +2 -0
- package/dist/commands/git-copy/dumpSizes.d.cts +1 -0
- package/dist/commands/git-copy/dumpSizes.d.ts +1 -0
- package/dist/commands/git-copy/getFileNames.d.cts +4 -0
- package/dist/commands/git-copy/getFileNames.d.ts +4 -0
- package/dist/commands/git-copy/helpers.d.cts +4 -0
- package/dist/commands/git-copy/helpers.d.ts +4 -0
- package/dist/commands/git-copy/index.d.cts +15 -0
- package/dist/commands/git-copy/index.d.ts +15 -0
- package/dist/commands/git-copy/updateReferences.d.cts +4 -0
- package/dist/commands/git-copy/updateReferences.d.ts +4 -0
- package/dist/commands/git-copy/utils.d.cts +9 -0
- package/dist/commands/git-copy/utils.d.ts +9 -0
- package/dist/commands/git-copy.d.cts +2 -0
- package/dist/commands/git-copy.d.ts +2 -0
- package/dist/commands/migrate-repo-issues/devtopia.d.cts +44 -0
- package/dist/commands/migrate-repo-issues/devtopia.d.ts +44 -0
- package/dist/commands/migrate-repo-issues/zentopia.d.cts +89 -0
- package/dist/commands/migrate-repo-issues/zentopia.d.ts +89 -0
- package/dist/commands/migrate-repo-issues.d.cts +2 -0
- package/dist/commands/migrate-repo-issues.d.ts +2 -0
- package/dist/commands/run-lint-test.d.cts +3 -0
- package/dist/commands/run-lint-test.d.ts +3 -0
- package/dist/commands/run.d.cts +1 -0
- package/dist/commands/run.d.ts +1 -0
- package/dist/commands/scan-dist.d.cts +2 -0
- package/dist/commands/scan-dist.d.ts +2 -0
- package/dist/commands/utils.d.cts +1 -0
- package/dist/commands/utils.d.ts +1 -0
- package/dist/file.d.cts +14 -0
- package/dist/file.d.ts +14 -0
- package/dist/glob.d.cts +1 -0
- package/dist/glob.d.ts +1 -0
- package/dist/index.cjs +173 -107
- package/dist/index.d.cts +5 -71
- package/dist/index.d.ts +5 -71
- package/dist/index.js +133 -36
- package/dist/packageJson.d.cts +39 -0
- package/dist/packageJson.d.ts +39 -0
- package/dist/path.d.cts +22 -0
- package/dist/path.d.ts +22 -0
- package/dist/vite.d.cts +24 -0
- package/dist/vite.d.ts +24 -0
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { access, constants, mkdir, writeFile } from "node:fs/promises";
|
|
1
|
+
import { access, existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { constants, mkdir, writeFile, readFile } from "node:fs/promises";
|
|
4
3
|
import { execSync } from "node:child_process";
|
|
5
|
-
import { dirname,
|
|
4
|
+
import { dirname, resolve, sep, join } from "node:path";
|
|
6
5
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import posix from "node:path/posix";
|
|
7
|
+
import win32 from "node:path/win32";
|
|
8
|
+
import dts from "vite-plugin-dts";
|
|
9
|
+
const existsAsync = async (file) => (
|
|
10
|
+
// Using un-promisified version because promises version creates exceptions
|
|
11
|
+
// which interferes with debugging when "Pause on caught exceptions" is enabled
|
|
12
|
+
await new Promise((resolve2) => access(file, constants.F_OK, (error) => resolve2(!error)))
|
|
13
|
+
);
|
|
14
|
+
const sh = (command, cwd) => execSync(command.trim(), { encoding: "utf8", cwd }).trim();
|
|
9
15
|
async function createFileIfNotExists(filePath, content) {
|
|
10
16
|
await mkdir(dirname(filePath), { recursive: true });
|
|
11
17
|
if (!await existsAsync(filePath)) {
|
|
@@ -44,9 +50,7 @@ async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
|
44
50
|
}
|
|
45
51
|
return void 0;
|
|
46
52
|
}
|
|
47
|
-
|
|
48
|
-
// src/glob.ts
|
|
49
|
-
var gitIgnoreToGlob = (pattern) => fixAbsoluteSyntax(fixMatchFilesSyntax(pattern));
|
|
53
|
+
const gitIgnoreToGlob = (pattern) => fixAbsoluteSyntax(fixMatchFilesSyntax(pattern));
|
|
50
54
|
function fixAbsoluteSyntax(pattern) {
|
|
51
55
|
if (pattern.startsWith("/")) {
|
|
52
56
|
return pattern.slice(1);
|
|
@@ -66,18 +70,13 @@ function fixMatchFilesSyntax(pattern) {
|
|
|
66
70
|
}
|
|
67
71
|
return pattern.endsWith("/*") ? `${pattern}*` : pattern.endsWith("/") ? `${pattern}**` : `${pattern}/**`;
|
|
68
72
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var normalizePath = isPosix ? (path2) => path2 : toPosixPathSeparators;
|
|
77
|
-
var toWin32PathSeparators = (relativePath) => relativePath.includes(posix.sep) ? relativePath.replaceAll(posix.sep, win32.sep) : relativePath;
|
|
78
|
-
var toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators;
|
|
79
|
-
var getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd());
|
|
80
|
-
var path = isPosix ? posix : {
|
|
73
|
+
const isPosix = sep === posix.sep;
|
|
74
|
+
const toPosixPathSeparators = (relativePath) => relativePath.includes(win32.sep) ? relativePath.replaceAll(win32.sep, posix.sep) : relativePath;
|
|
75
|
+
const normalizePath = isPosix ? (path2) => path2 : toPosixPathSeparators;
|
|
76
|
+
const toWin32PathSeparators = (relativePath) => relativePath.includes(posix.sep) ? relativePath.replaceAll(posix.sep, win32.sep) : relativePath;
|
|
77
|
+
const toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators;
|
|
78
|
+
const getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd());
|
|
79
|
+
const path = isPosix ? posix : {
|
|
81
80
|
...win32,
|
|
82
81
|
sep: posix.sep,
|
|
83
82
|
join(...paths) {
|
|
@@ -105,14 +104,10 @@ var path = isPosix ? posix : {
|
|
|
105
104
|
return toPosixPathSeparators(result);
|
|
106
105
|
}
|
|
107
106
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
import { existsSync as existsSync2, readFileSync } from "node:fs";
|
|
113
|
-
var cachedPackageJson = {};
|
|
114
|
-
var cachedPackageJsonPromises = {};
|
|
115
|
-
var rootPackageJsonLocation;
|
|
107
|
+
const exportsForTests = { toWin32PathSeparators };
|
|
108
|
+
const cachedPackageJson = {};
|
|
109
|
+
const cachedPackageJsonPromises = {};
|
|
110
|
+
let rootPackageJsonLocation;
|
|
116
111
|
function retrievePackageJson(location) {
|
|
117
112
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
118
113
|
cachedPackageJson[packageJsonPath] ??= JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
@@ -128,9 +123,9 @@ async function asyncRetrievePackageJson(location = getCwd()) {
|
|
|
128
123
|
cachedPackageJson[packageJsonPath] ??= result;
|
|
129
124
|
return result;
|
|
130
125
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
const asyncReadPackageJson = async (location) => JSON.parse(await readFile(location, "utf-8"));
|
|
127
|
+
const cachedPackageLocation = {};
|
|
128
|
+
const cachedPackageLocationPromises = {};
|
|
134
129
|
async function fetchPackageLocation(packageName, cwd) {
|
|
135
130
|
if (packageName in cachedPackageLocation) {
|
|
136
131
|
return cachedPackageLocation[packageName];
|
|
@@ -140,8 +135,8 @@ async function fetchPackageLocation(packageName, cwd) {
|
|
|
140
135
|
cwd
|
|
141
136
|
).then((packageJsonLocation) => {
|
|
142
137
|
if (packageJsonLocation === void 0) {
|
|
143
|
-
throw
|
|
144
|
-
`@arcgis/
|
|
138
|
+
throw Error(
|
|
139
|
+
`@arcgis/components-build-utils: Unable to resolve package.json location for "${packageName}" package. Current working directory: ${process.cwd()}`
|
|
145
140
|
);
|
|
146
141
|
}
|
|
147
142
|
return path.dirname(packageJsonLocation);
|
|
@@ -157,7 +152,7 @@ function detectPackageManager(cwd = process.cwd()) {
|
|
|
157
152
|
while (pathParts.length > 1) {
|
|
158
153
|
const packageJson = path.join(pathParts.join(path.sep), "package.json");
|
|
159
154
|
pathParts.pop();
|
|
160
|
-
if (!
|
|
155
|
+
if (!existsSync(packageJson)) {
|
|
161
156
|
continue;
|
|
162
157
|
}
|
|
163
158
|
const contents = JSON.parse(readFileSync(packageJson, "utf8"));
|
|
@@ -172,6 +167,106 @@ function detectPackageManager(cwd = process.cwd()) {
|
|
|
172
167
|
packageManager ??= "npm";
|
|
173
168
|
return packageManager;
|
|
174
169
|
}
|
|
170
|
+
function vitePresetPlugin({
|
|
171
|
+
externalize = [],
|
|
172
|
+
dtsOptions = {}
|
|
173
|
+
} = {
|
|
174
|
+
externalize: [],
|
|
175
|
+
dtsOptions: {}
|
|
176
|
+
}) {
|
|
177
|
+
const dist = `${path.resolve("dist")}/`;
|
|
178
|
+
const distSrc = `${dist}src/`;
|
|
179
|
+
let userConfig = void 0;
|
|
180
|
+
let command = void 0;
|
|
181
|
+
return [
|
|
182
|
+
{
|
|
183
|
+
name: "vite-preset-config",
|
|
184
|
+
config({ build: { target } = {} }, env) {
|
|
185
|
+
command = env.command;
|
|
186
|
+
return {
|
|
187
|
+
build: {
|
|
188
|
+
// REFACTOR: get this from tsconfig
|
|
189
|
+
// It's a best practice to let the final bundler down-level as needed.
|
|
190
|
+
target: target ?? "es2022"
|
|
191
|
+
},
|
|
192
|
+
define: env.mode === "test" ? {
|
|
193
|
+
"process.env.ESRI_INTERNAL": true
|
|
194
|
+
} : void 0
|
|
195
|
+
};
|
|
196
|
+
},
|
|
197
|
+
configResolved(config) {
|
|
198
|
+
userConfig = config;
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* We use a dynamic import here because of how Rollup processes and transforms imports.
|
|
203
|
+
* This dependency (rollup-plugin-node-externals) will not be bundled into the output,
|
|
204
|
+
* as specified in vite.config.ts.
|
|
205
|
+
*
|
|
206
|
+
* rollup-plugin-node-externals is an ES module, and Stencil throws an error when it encounters
|
|
207
|
+
* a require() statement for an ES module.
|
|
208
|
+
*
|
|
209
|
+
* If we used a static import, Rollup's cjs build would transform it into a require() statement,
|
|
210
|
+
* causing Stencil to throw an error. Using a dynamic import prevents this issue.
|
|
211
|
+
*/
|
|
212
|
+
import("rollup-plugin-node-externals").then(
|
|
213
|
+
({ nodeExternals }) => nodeExternals({
|
|
214
|
+
include: externalize.map(stringToStartsWithGlob)
|
|
215
|
+
})
|
|
216
|
+
),
|
|
217
|
+
dts({
|
|
218
|
+
logLevel: "warn",
|
|
219
|
+
// Copies .d.ts files to d.cjs file for CommonJS.
|
|
220
|
+
// Adds a performance hit as it occurs after the build
|
|
221
|
+
async afterBuild(emitted) {
|
|
222
|
+
if (userConfig?.build?.lib && userConfig.build.lib.formats?.includes("cjs")) {
|
|
223
|
+
await Promise.all(
|
|
224
|
+
emitted.entries().map(async ([filePath, content]) => {
|
|
225
|
+
if (filePath.endsWith(".d.ts")) {
|
|
226
|
+
await writeFile(filePath.replace(".d.ts", ".d.cts"), content);
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
...dtsOptions,
|
|
233
|
+
compilerOptions: {
|
|
234
|
+
// For details, see comment above excludeOutsideFiles in
|
|
235
|
+
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
236
|
+
rootDir: ".",
|
|
237
|
+
...dtsOptions.compilerOptions
|
|
238
|
+
},
|
|
239
|
+
/**
|
|
240
|
+
* Do not emit any .d.ts files for files outside the dist directory
|
|
241
|
+
* (i.e vite.config.ts, storybook stories and etc)
|
|
242
|
+
* This also applies for references to node_modules/.../components.d.ts files in
|
|
243
|
+
* tsconfig.json - these must be included in TypeScript program to provide
|
|
244
|
+
* types, but should not be re-emitted during build.
|
|
245
|
+
*/
|
|
246
|
+
beforeWriteFile: async (filePath, content) => {
|
|
247
|
+
if (filePath.startsWith(distSrc) && !shouldSkip(filePath)) {
|
|
248
|
+
const baseBeforeWriteFile = dtsOptions?.beforeWriteFile ?? ((filePath2, content2) => ({ filePath: filePath2, content: content2 }));
|
|
249
|
+
return await baseBeforeWriteFile(`${dist}${filePath.slice(distSrc.length)}`, content);
|
|
250
|
+
} else {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
afterDiagnostic(diagnostics) {
|
|
255
|
+
const hasErrors = diagnostics.length > 0;
|
|
256
|
+
const isBuilding = command === "build";
|
|
257
|
+
const stopBuild = hasErrors && isBuilding;
|
|
258
|
+
if (stopBuild) {
|
|
259
|
+
throw new Error("TypeScript errors reported. See error messages above");
|
|
260
|
+
}
|
|
261
|
+
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
function shouldSkip(id) {
|
|
267
|
+
return id.includes("__test") || id.includes(".e2e.") || id.includes(".spec.") || id.includes(".test.") || id.includes(".stories.");
|
|
268
|
+
}
|
|
269
|
+
const stringToStartsWithGlob = (option) => option ? typeof option === "string" ? new RegExp(`^${option.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}`, "u") : option : void 0;
|
|
175
270
|
export {
|
|
176
271
|
asyncFindPath,
|
|
177
272
|
asyncRetrievePackageJson,
|
|
@@ -188,6 +283,8 @@ export {
|
|
|
188
283
|
path,
|
|
189
284
|
retrievePackageJson,
|
|
190
285
|
sh,
|
|
286
|
+
stringToStartsWithGlob,
|
|
191
287
|
toPosixPathSeparators,
|
|
192
|
-
toSystemPathSeparators
|
|
288
|
+
toSystemPathSeparators,
|
|
289
|
+
vitePresetPlugin
|
|
193
290
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A subset of the package.json typing that is interesting to Lumina.
|
|
3
|
+
*
|
|
4
|
+
* The full package.json type is insanely large (20k lines):
|
|
5
|
+
* https://github.com/ffflorian/schemastore-updater/blob/main/schemas/package/index.d.ts#L20067
|
|
6
|
+
*/
|
|
7
|
+
export type MiniPackageJson = {
|
|
8
|
+
"name": string;
|
|
9
|
+
"version": string;
|
|
10
|
+
"private"?: boolean;
|
|
11
|
+
"type"?: "commonjs" | "module";
|
|
12
|
+
"publishConfig"?: {
|
|
13
|
+
access?: string;
|
|
14
|
+
registry?: string;
|
|
15
|
+
};
|
|
16
|
+
"files"?: string[];
|
|
17
|
+
"dependencies"?: Record<string, string | undefined>;
|
|
18
|
+
"devDependencies"?: Record<string, string | undefined>;
|
|
19
|
+
"peerDependencies"?: Record<string, string | undefined>;
|
|
20
|
+
"peerDependenciesMeta"?: Record<string, {
|
|
21
|
+
optional?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
"css.customData"?: string[];
|
|
24
|
+
"customElements"?: string;
|
|
25
|
+
"html.customData"?: string[];
|
|
26
|
+
"web-types"?: string;
|
|
27
|
+
"exports"?: Record<string, Record<string, string> | string>;
|
|
28
|
+
};
|
|
29
|
+
export declare function retrievePackageJson(location?: string): MiniPackageJson;
|
|
30
|
+
export declare function asyncRetrievePackageJson(location?: string): Promise<MiniPackageJson>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns an absolute path to the root of a package in node_modules, without
|
|
33
|
+
* trailing slash.
|
|
34
|
+
*/
|
|
35
|
+
export declare function fetchPackageLocation(packageName: string, cwd?: string): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Detect if current repository/monorepo uses npm, yarn or pnpm
|
|
38
|
+
*/
|
|
39
|
+
export declare function detectPackageManager(cwd?: string): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A subset of the package.json typing that is interesting to Lumina.
|
|
3
|
+
*
|
|
4
|
+
* The full package.json type is insanely large (20k lines):
|
|
5
|
+
* https://github.com/ffflorian/schemastore-updater/blob/main/schemas/package/index.d.ts#L20067
|
|
6
|
+
*/
|
|
7
|
+
export type MiniPackageJson = {
|
|
8
|
+
"name": string;
|
|
9
|
+
"version": string;
|
|
10
|
+
"private"?: boolean;
|
|
11
|
+
"type"?: "commonjs" | "module";
|
|
12
|
+
"publishConfig"?: {
|
|
13
|
+
access?: string;
|
|
14
|
+
registry?: string;
|
|
15
|
+
};
|
|
16
|
+
"files"?: string[];
|
|
17
|
+
"dependencies"?: Record<string, string | undefined>;
|
|
18
|
+
"devDependencies"?: Record<string, string | undefined>;
|
|
19
|
+
"peerDependencies"?: Record<string, string | undefined>;
|
|
20
|
+
"peerDependenciesMeta"?: Record<string, {
|
|
21
|
+
optional?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
"css.customData"?: string[];
|
|
24
|
+
"customElements"?: string;
|
|
25
|
+
"html.customData"?: string[];
|
|
26
|
+
"web-types"?: string;
|
|
27
|
+
"exports"?: Record<string, Record<string, string> | string>;
|
|
28
|
+
};
|
|
29
|
+
export declare function retrievePackageJson(location?: string): MiniPackageJson;
|
|
30
|
+
export declare function asyncRetrievePackageJson(location?: string): Promise<MiniPackageJson>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns an absolute path to the root of a package in node_modules, without
|
|
33
|
+
* trailing slash.
|
|
34
|
+
*/
|
|
35
|
+
export declare function fetchPackageLocation(packageName: string, cwd?: string): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Detect if current repository/monorepo uses npm, yarn or pnpm
|
|
38
|
+
*/
|
|
39
|
+
export declare function detectPackageManager(cwd?: string): string;
|
package/dist/path.d.cts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as posix } from 'path/posix';
|
|
2
|
+
/**
|
|
3
|
+
* This is called "isPosix" rather than "isNotWindows" because even if we are
|
|
4
|
+
* on Windows, we could be running in a POSIX environment (e.g. WSL2)
|
|
5
|
+
*/
|
|
6
|
+
export declare const isPosix: boolean;
|
|
7
|
+
export declare const toPosixPathSeparators: (relativePath: string) => string;
|
|
8
|
+
export declare const normalizePath: (relativePath: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* On Windows, replace all `/` in the path back with `\\`. Do this only if you
|
|
11
|
+
* wish to output the path in the console or error message.
|
|
12
|
+
* On POSIX system (macOS, Linux, ...), this does not change the path (because
|
|
13
|
+
* inside the compiler we use `/` everywhere).
|
|
14
|
+
*/
|
|
15
|
+
export declare const toSystemPathSeparators: (relativePath: string) => string;
|
|
16
|
+
export declare const getCwd: () => string;
|
|
17
|
+
export declare const path: typeof posix & {
|
|
18
|
+
sep: "/";
|
|
19
|
+
};
|
|
20
|
+
export declare const exportsForTests: {
|
|
21
|
+
toWin32PathSeparators: (relativePath: string) => string;
|
|
22
|
+
};
|
package/dist/path.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as posix } from 'path/posix';
|
|
2
|
+
/**
|
|
3
|
+
* This is called "isPosix" rather than "isNotWindows" because even if we are
|
|
4
|
+
* on Windows, we could be running in a POSIX environment (e.g. WSL2)
|
|
5
|
+
*/
|
|
6
|
+
export declare const isPosix: boolean;
|
|
7
|
+
export declare const toPosixPathSeparators: (relativePath: string) => string;
|
|
8
|
+
export declare const normalizePath: (relativePath: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* On Windows, replace all `/` in the path back with `\\`. Do this only if you
|
|
11
|
+
* wish to output the path in the console or error message.
|
|
12
|
+
* On POSIX system (macOS, Linux, ...), this does not change the path (because
|
|
13
|
+
* inside the compiler we use `/` everywhere).
|
|
14
|
+
*/
|
|
15
|
+
export declare const toSystemPathSeparators: (relativePath: string) => string;
|
|
16
|
+
export declare const getCwd: () => string;
|
|
17
|
+
export declare const path: typeof posix & {
|
|
18
|
+
sep: "/";
|
|
19
|
+
};
|
|
20
|
+
export declare const exportsForTests: {
|
|
21
|
+
toWin32PathSeparators: (relativePath: string) => string;
|
|
22
|
+
};
|
package/dist/vite.d.cts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { default as dts } from 'vite-plugin-dts';
|
|
3
|
+
/**
|
|
4
|
+
* Vite preset for all our support packages:
|
|
5
|
+
* - externalizes all devDependencies (using `rollup-plugin-node-externals`)
|
|
6
|
+
* - generates type declarations (using `vite-plugin-dts`)
|
|
7
|
+
*/
|
|
8
|
+
export declare function vitePresetPlugin({ externalize, dtsOptions, }?: {
|
|
9
|
+
/** The list of dependencies to externalize besides devDependencies */
|
|
10
|
+
externalize?: string[];
|
|
11
|
+
/** Additional options for `vite-plugin-dts` */
|
|
12
|
+
dtsOptions?: Parameters<typeof dts>[0];
|
|
13
|
+
}): [Plugin, Promise<Plugin>, Plugin];
|
|
14
|
+
/**
|
|
15
|
+
* By default this plugin converts string values to RegExp that only matches if
|
|
16
|
+
* path is "equal" not "starts with", which is not intuitive.
|
|
17
|
+
*
|
|
18
|
+
* I.e, this would only exclude "monaco-editor", not any
|
|
19
|
+
* "monaco-editor/sub-path" by default:
|
|
20
|
+
* "bundleIn": ["monaco-editor"]
|
|
21
|
+
*
|
|
22
|
+
* We fix it to match using "starts with" instead
|
|
23
|
+
*/
|
|
24
|
+
export declare const stringToStartsWithGlob: (option: RegExp | string | false | null | undefined) => RegExp | undefined;
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { default as dts } from 'vite-plugin-dts';
|
|
3
|
+
/**
|
|
4
|
+
* Vite preset for all our support packages:
|
|
5
|
+
* - externalizes all devDependencies (using `rollup-plugin-node-externals`)
|
|
6
|
+
* - generates type declarations (using `vite-plugin-dts`)
|
|
7
|
+
*/
|
|
8
|
+
export declare function vitePresetPlugin({ externalize, dtsOptions, }?: {
|
|
9
|
+
/** The list of dependencies to externalize besides devDependencies */
|
|
10
|
+
externalize?: string[];
|
|
11
|
+
/** Additional options for `vite-plugin-dts` */
|
|
12
|
+
dtsOptions?: Parameters<typeof dts>[0];
|
|
13
|
+
}): [Plugin, Promise<Plugin>, Plugin];
|
|
14
|
+
/**
|
|
15
|
+
* By default this plugin converts string values to RegExp that only matches if
|
|
16
|
+
* path is "equal" not "starts with", which is not intuitive.
|
|
17
|
+
*
|
|
18
|
+
* I.e, this would only exclude "monaco-editor", not any
|
|
19
|
+
* "monaco-editor/sub-path" by default:
|
|
20
|
+
* "bundleIn": ["monaco-editor"]
|
|
21
|
+
*
|
|
22
|
+
* We fix it to match using "starts with" instead
|
|
23
|
+
*/
|
|
24
|
+
export declare const stringToStartsWithGlob: (option: RegExp | string | false | null | undefined) => RegExp | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/components-build-utils",
|
|
3
|
-
"version": "4.33.0-next.
|
|
3
|
+
"version": "4.33.0-next.133",
|
|
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",
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
"chalk": "^5.3.0",
|
|
27
27
|
"commander": "^11.1.0",
|
|
28
28
|
"glob": "^11.0.0",
|
|
29
|
+
"rollup-plugin-node-externals": "^8.0.0",
|
|
29
30
|
"split2": "^4.2.0",
|
|
30
|
-
"tslib": "^2.
|
|
31
|
+
"tslib": "^2.8.1",
|
|
32
|
+
"vite": "^6.3.4",
|
|
33
|
+
"vite-plugin-dts": "^4.5.3"
|
|
31
34
|
}
|
|
32
35
|
}
|