@arcgis/components-build-utils 4.33.0-next.16 → 4.33.0-next.160
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-builddate.d.cts +12 -0
- package/dist/commands/generate-builddate.d.ts +12 -0
- package/dist/commands/generate-info-html.d.cts +2 -0
- package/dist/commands/generate-info-html.d.ts +2 -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 +2 -0
- package/dist/commands/run-lint-test.d.ts +2 -0
- package/dist/commands/run.d.cts +1 -0
- package/dist/commands/run.d.ts +1 -0
- package/dist/commands/scan-dist.d.cts +5 -0
- package/dist/commands/scan-dist.d.ts +5 -0
- package/dist/commands/utils.d.cts +2 -0
- package/dist/commands/utils.d.ts +2 -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.cjs
CHANGED
|
@@ -5,10 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
8
|
var __copyProps = (to, from, except, desc) => {
|
|
13
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,55 +21,37 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
22
|
mod
|
|
27
23
|
));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
isPosix: () => isPosix,
|
|
44
|
-
normalizePath: () => normalizePath,
|
|
45
|
-
path: () => path,
|
|
46
|
-
retrievePackageJson: () => retrievePackageJson,
|
|
47
|
-
sh: () => sh,
|
|
48
|
-
toPosixPathSeparators: () => toPosixPathSeparators,
|
|
49
|
-
toSystemPathSeparators: () => toSystemPathSeparators
|
|
50
|
-
});
|
|
51
|
-
module.exports = __toCommonJS(src_exports);
|
|
52
|
-
|
|
53
|
-
// src/file.ts
|
|
54
|
-
var import_node_fs = require("fs");
|
|
55
|
-
var import_promises = require("fs/promises");
|
|
56
|
-
var import_node_child_process = require("child_process");
|
|
57
|
-
var import_path = require("path");
|
|
58
|
-
var import_node_url = require("url");
|
|
59
|
-
var existsAsync = async (file) => await (0, import_promises.access)(file, import_promises.constants.F_OK).then(() => true).catch(() => false);
|
|
60
|
-
var sh = (command, cwd) => (0, import_node_child_process.execSync)(command.trim(), { encoding: "utf8", cwd }).trim();
|
|
24
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
+
const node_fs = require("node:fs");
|
|
26
|
+
const promises = require("node:fs/promises");
|
|
27
|
+
const node_child_process = require("node:child_process");
|
|
28
|
+
const node_path = require("node:path");
|
|
29
|
+
const node_url = require("node:url");
|
|
30
|
+
const posix = require("node:path/posix");
|
|
31
|
+
const win32 = require("node:path/win32");
|
|
32
|
+
const dts = require("vite-plugin-dts");
|
|
33
|
+
const existsAsync = async (file) => (
|
|
34
|
+
// Using un-promisified version because promises version creates exceptions
|
|
35
|
+
// which interferes with debugging when "Pause on caught exceptions" is enabled
|
|
36
|
+
await new Promise((resolve2) => node_fs.access(file, promises.constants.F_OK, (error) => resolve2(!error)))
|
|
37
|
+
);
|
|
38
|
+
const sh = (command, cwd) => node_child_process.execSync(command.trim(), { encoding: "utf8", cwd }).trim();
|
|
61
39
|
async function createFileIfNotExists(filePath, content) {
|
|
62
|
-
await
|
|
40
|
+
await promises.mkdir(node_path.dirname(filePath), { recursive: true });
|
|
63
41
|
if (!await existsAsync(filePath)) {
|
|
64
|
-
await
|
|
42
|
+
await promises.writeFile(filePath, content, { encoding: "utf8" });
|
|
65
43
|
}
|
|
66
44
|
}
|
|
67
45
|
function findPath(target, startDirectory = process.cwd()) {
|
|
68
|
-
const resolvedStartDirectory = startDirectory.startsWith("file:///") ?
|
|
69
|
-
const parentPath = resolvedStartDirectory.split(
|
|
46
|
+
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? node_path.dirname(node_url.fileURLToPath(startDirectory)) : node_path.resolve(startDirectory);
|
|
47
|
+
const parentPath = resolvedStartDirectory.split(node_path.sep);
|
|
70
48
|
while (parentPath.length > 2) {
|
|
71
|
-
const fullPath =
|
|
72
|
-
...
|
|
49
|
+
const fullPath = node_path.join(
|
|
50
|
+
...node_path.sep === "/" ? ["/"] : [],
|
|
73
51
|
...parentPath,
|
|
74
52
|
target
|
|
75
53
|
);
|
|
76
|
-
if (
|
|
54
|
+
if (node_fs.existsSync(fullPath)) {
|
|
77
55
|
return fullPath;
|
|
78
56
|
}
|
|
79
57
|
parentPath.pop();
|
|
@@ -81,11 +59,11 @@ function findPath(target, startDirectory = process.cwd()) {
|
|
|
81
59
|
return void 0;
|
|
82
60
|
}
|
|
83
61
|
async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
84
|
-
const resolvedStartDirectory = startDirectory.startsWith("file:///") ?
|
|
85
|
-
const parentPath = resolvedStartDirectory.split(
|
|
62
|
+
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? node_path.dirname(node_url.fileURLToPath(startDirectory)) : node_path.resolve(startDirectory);
|
|
63
|
+
const parentPath = resolvedStartDirectory.split(node_path.sep);
|
|
86
64
|
while (parentPath.length > 2) {
|
|
87
|
-
const fullPath =
|
|
88
|
-
...
|
|
65
|
+
const fullPath = node_path.join(
|
|
66
|
+
...node_path.sep === "/" ? ["/"] : [],
|
|
89
67
|
...parentPath,
|
|
90
68
|
target
|
|
91
69
|
);
|
|
@@ -96,9 +74,7 @@ async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
|
96
74
|
}
|
|
97
75
|
return void 0;
|
|
98
76
|
}
|
|
99
|
-
|
|
100
|
-
// src/glob.ts
|
|
101
|
-
var gitIgnoreToGlob = (pattern) => fixAbsoluteSyntax(fixMatchFilesSyntax(pattern));
|
|
77
|
+
const gitIgnoreToGlob = (pattern) => fixAbsoluteSyntax(fixMatchFilesSyntax(pattern));
|
|
102
78
|
function fixAbsoluteSyntax(pattern) {
|
|
103
79
|
if (pattern.startsWith("/")) {
|
|
104
80
|
return pattern.slice(1);
|
|
@@ -118,56 +94,47 @@ function fixMatchFilesSyntax(pattern) {
|
|
|
118
94
|
}
|
|
119
95
|
return pattern.endsWith("/*") ? `${pattern}*` : pattern.endsWith("/") ? `${pattern}**` : `${pattern}/**`;
|
|
120
96
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
var toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators;
|
|
131
|
-
var getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd());
|
|
132
|
-
var path = isPosix ? import_posix.default : {
|
|
133
|
-
...import_win32.default,
|
|
134
|
-
sep: import_posix.default.sep,
|
|
97
|
+
const isPosix = node_path.sep === posix.sep;
|
|
98
|
+
const toPosixPathSeparators = (relativePath) => relativePath.includes(win32.sep) ? relativePath.replaceAll(win32.sep, posix.sep) : relativePath;
|
|
99
|
+
const normalizePath = isPosix ? (path2) => path2 : toPosixPathSeparators;
|
|
100
|
+
const toWin32PathSeparators = (relativePath) => relativePath.includes(posix.sep) ? relativePath.replaceAll(posix.sep, win32.sep) : relativePath;
|
|
101
|
+
const toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators;
|
|
102
|
+
const getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd());
|
|
103
|
+
const path = isPosix ? posix : {
|
|
104
|
+
...win32,
|
|
105
|
+
sep: posix.sep,
|
|
135
106
|
join(...paths) {
|
|
136
|
-
const result =
|
|
107
|
+
const result = win32.join(...paths);
|
|
137
108
|
return toPosixPathSeparators(result);
|
|
138
109
|
},
|
|
139
110
|
normalize(path2) {
|
|
140
|
-
const result =
|
|
111
|
+
const result = win32.normalize(path2);
|
|
141
112
|
return toPosixPathSeparators(result);
|
|
142
113
|
},
|
|
143
114
|
relative(from, to) {
|
|
144
|
-
const result =
|
|
115
|
+
const result = win32.relative(from, to);
|
|
145
116
|
return toPosixPathSeparators(result);
|
|
146
117
|
},
|
|
147
118
|
dirname(path2) {
|
|
148
|
-
const result =
|
|
119
|
+
const result = win32.dirname(path2);
|
|
149
120
|
return toPosixPathSeparators(result);
|
|
150
121
|
},
|
|
151
122
|
resolve(...paths) {
|
|
152
|
-
const result =
|
|
123
|
+
const result = win32.resolve(...paths);
|
|
153
124
|
return toPosixPathSeparators(result);
|
|
154
125
|
},
|
|
155
126
|
toNamespacedPath(path2) {
|
|
156
|
-
const result =
|
|
127
|
+
const result = win32.toNamespacedPath(path2);
|
|
157
128
|
return toPosixPathSeparators(result);
|
|
158
129
|
}
|
|
159
130
|
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var import_node_fs2 = require("fs");
|
|
165
|
-
var cachedPackageJson = {};
|
|
166
|
-
var cachedPackageJsonPromises = {};
|
|
167
|
-
var rootPackageJsonLocation;
|
|
131
|
+
const exportsForTests = { toWin32PathSeparators };
|
|
132
|
+
const cachedPackageJson = {};
|
|
133
|
+
const cachedPackageJsonPromises = {};
|
|
134
|
+
let rootPackageJsonLocation;
|
|
168
135
|
function retrievePackageJson(location) {
|
|
169
136
|
const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
|
|
170
|
-
cachedPackageJson[packageJsonPath] ??= JSON.parse(
|
|
137
|
+
cachedPackageJson[packageJsonPath] ??= JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
|
|
171
138
|
return cachedPackageJson[packageJsonPath];
|
|
172
139
|
}
|
|
173
140
|
async function asyncRetrievePackageJson(location = getCwd()) {
|
|
@@ -180,9 +147,9 @@ async function asyncRetrievePackageJson(location = getCwd()) {
|
|
|
180
147
|
cachedPackageJson[packageJsonPath] ??= result;
|
|
181
148
|
return result;
|
|
182
149
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
150
|
+
const asyncReadPackageJson = async (location) => JSON.parse(await promises.readFile(location, "utf-8"));
|
|
151
|
+
const cachedPackageLocation = {};
|
|
152
|
+
const cachedPackageLocationPromises = {};
|
|
186
153
|
async function fetchPackageLocation(packageName, cwd) {
|
|
187
154
|
if (packageName in cachedPackageLocation) {
|
|
188
155
|
return cachedPackageLocation[packageName];
|
|
@@ -192,8 +159,8 @@ async function fetchPackageLocation(packageName, cwd) {
|
|
|
192
159
|
cwd
|
|
193
160
|
).then((packageJsonLocation) => {
|
|
194
161
|
if (packageJsonLocation === void 0) {
|
|
195
|
-
throw
|
|
196
|
-
`@arcgis/
|
|
162
|
+
throw Error(
|
|
163
|
+
`@arcgis/components-build-utils: Unable to resolve package.json location for "${packageName}" package. Current working directory: ${process.cwd()}`
|
|
197
164
|
);
|
|
198
165
|
}
|
|
199
166
|
return path.dirname(packageJsonLocation);
|
|
@@ -209,10 +176,10 @@ function detectPackageManager(cwd = process.cwd()) {
|
|
|
209
176
|
while (pathParts.length > 1) {
|
|
210
177
|
const packageJson = path.join(pathParts.join(path.sep), "package.json");
|
|
211
178
|
pathParts.pop();
|
|
212
|
-
if (!
|
|
179
|
+
if (!node_fs.existsSync(packageJson)) {
|
|
213
180
|
continue;
|
|
214
181
|
}
|
|
215
|
-
const contents = JSON.parse(
|
|
182
|
+
const contents = JSON.parse(node_fs.readFileSync(packageJson, "utf8"));
|
|
216
183
|
if (typeof contents !== "object" || Array.isArray(contents)) {
|
|
217
184
|
continue;
|
|
218
185
|
}
|
|
@@ -224,23 +191,122 @@ function detectPackageManager(cwd = process.cwd()) {
|
|
|
224
191
|
packageManager ??= "npm";
|
|
225
192
|
return packageManager;
|
|
226
193
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
194
|
+
function vitePresetPlugin({
|
|
195
|
+
externalize = [],
|
|
196
|
+
dtsOptions = {}
|
|
197
|
+
} = {
|
|
198
|
+
externalize: [],
|
|
199
|
+
dtsOptions: {}
|
|
200
|
+
}) {
|
|
201
|
+
const dist = `${path.resolve("dist")}/`;
|
|
202
|
+
const distSrc = `${dist}src/`;
|
|
203
|
+
let userConfig = void 0;
|
|
204
|
+
let command = void 0;
|
|
205
|
+
return [
|
|
206
|
+
{
|
|
207
|
+
name: "vite-preset-config",
|
|
208
|
+
config({ build: { target } = {} }, env) {
|
|
209
|
+
command = env.command;
|
|
210
|
+
return {
|
|
211
|
+
build: {
|
|
212
|
+
// REFACTOR: get this from tsconfig
|
|
213
|
+
// It's a best practice to let the final bundler down-level as needed.
|
|
214
|
+
target: target ?? "es2022"
|
|
215
|
+
},
|
|
216
|
+
define: env.mode === "test" ? {
|
|
217
|
+
"process.env.ESRI_INTERNAL": true
|
|
218
|
+
} : void 0
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
configResolved(config) {
|
|
222
|
+
userConfig = config;
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* We use a dynamic import here because of how Rollup processes and transforms imports.
|
|
227
|
+
* This dependency (rollup-plugin-node-externals) will not be bundled into the output,
|
|
228
|
+
* as specified in vite.config.ts.
|
|
229
|
+
*
|
|
230
|
+
* rollup-plugin-node-externals is an ES module, and Stencil throws an error when it encounters
|
|
231
|
+
* a require() statement for an ES module.
|
|
232
|
+
*
|
|
233
|
+
* If we used a static import, Rollup's cjs build would transform it into a require() statement,
|
|
234
|
+
* causing Stencil to throw an error. Using a dynamic import prevents this issue.
|
|
235
|
+
*/
|
|
236
|
+
import("rollup-plugin-node-externals").then(
|
|
237
|
+
({ nodeExternals }) => nodeExternals({
|
|
238
|
+
include: externalize.map(stringToStartsWithGlob)
|
|
239
|
+
})
|
|
240
|
+
),
|
|
241
|
+
dts({
|
|
242
|
+
logLevel: "warn",
|
|
243
|
+
// Copies .d.ts files to d.cjs file for CommonJS.
|
|
244
|
+
// Adds a performance hit as it occurs after the build
|
|
245
|
+
async afterBuild(emitted) {
|
|
246
|
+
if (userConfig?.build?.lib && userConfig.build.lib.formats?.includes("cjs")) {
|
|
247
|
+
await Promise.all(
|
|
248
|
+
emitted.entries().map(async ([filePath, content]) => {
|
|
249
|
+
if (filePath.endsWith(".d.ts")) {
|
|
250
|
+
await promises.writeFile(filePath.replace(".d.ts", ".d.cts"), content);
|
|
251
|
+
}
|
|
252
|
+
})
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
...dtsOptions,
|
|
257
|
+
compilerOptions: {
|
|
258
|
+
// For details, see comment above excludeOutsideFiles in
|
|
259
|
+
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
260
|
+
rootDir: ".",
|
|
261
|
+
...dtsOptions.compilerOptions
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* Do not emit any .d.ts files for files outside the dist directory
|
|
265
|
+
* (i.e vite.config.ts, storybook stories and etc)
|
|
266
|
+
* This also applies for references to node_modules/.../components.d.ts files in
|
|
267
|
+
* tsconfig.json - these must be included in TypeScript program to provide
|
|
268
|
+
* types, but should not be re-emitted during build.
|
|
269
|
+
*/
|
|
270
|
+
beforeWriteFile: async (filePath, content) => {
|
|
271
|
+
if (filePath.startsWith(distSrc) && !shouldSkip(filePath)) {
|
|
272
|
+
const baseBeforeWriteFile = dtsOptions?.beforeWriteFile ?? ((filePath2, content2) => ({ filePath: filePath2, content: content2 }));
|
|
273
|
+
return await baseBeforeWriteFile(`${dist}${filePath.slice(distSrc.length)}`, content);
|
|
274
|
+
} else {
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
afterDiagnostic(diagnostics) {
|
|
279
|
+
const hasErrors = diagnostics.length > 0;
|
|
280
|
+
const isBuilding = command === "build";
|
|
281
|
+
const stopBuild = hasErrors && isBuilding;
|
|
282
|
+
if (stopBuild) {
|
|
283
|
+
throw new Error("TypeScript errors reported. See error messages above");
|
|
284
|
+
}
|
|
285
|
+
return dtsOptions?.afterDiagnostic?.(diagnostics);
|
|
286
|
+
}
|
|
287
|
+
})
|
|
288
|
+
];
|
|
289
|
+
}
|
|
290
|
+
function shouldSkip(id) {
|
|
291
|
+
return id.includes("__test") || id.includes(".e2e.") || id.includes(".spec.") || id.includes(".test.") || id.includes(".stories.");
|
|
292
|
+
}
|
|
293
|
+
const stringToStartsWithGlob = (option) => option ? typeof option === "string" ? new RegExp(`^${option.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}`, "u") : option : void 0;
|
|
294
|
+
exports.asyncFindPath = asyncFindPath;
|
|
295
|
+
exports.asyncRetrievePackageJson = asyncRetrievePackageJson;
|
|
296
|
+
exports.createFileIfNotExists = createFileIfNotExists;
|
|
297
|
+
exports.detectPackageManager = detectPackageManager;
|
|
298
|
+
exports.existsAsync = existsAsync;
|
|
299
|
+
exports.exportsForTests = exportsForTests;
|
|
300
|
+
exports.fetchPackageLocation = fetchPackageLocation;
|
|
301
|
+
exports.findPath = findPath;
|
|
302
|
+
exports.getCwd = getCwd;
|
|
303
|
+
exports.gitIgnoreToGlob = gitIgnoreToGlob;
|
|
304
|
+
exports.isPosix = isPosix;
|
|
305
|
+
exports.normalizePath = normalizePath;
|
|
306
|
+
exports.path = path;
|
|
307
|
+
exports.retrievePackageJson = retrievePackageJson;
|
|
308
|
+
exports.sh = sh;
|
|
309
|
+
exports.stringToStartsWithGlob = stringToStartsWithGlob;
|
|
310
|
+
exports.toPosixPathSeparators = toPosixPathSeparators;
|
|
311
|
+
exports.toSystemPathSeparators = toSystemPathSeparators;
|
|
312
|
+
exports.vitePresetPlugin = vitePresetPlugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,71 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare function createFileIfNotExists(filePath: string, content: string): Promise<void>;
|
|
7
|
-
/**
|
|
8
|
-
* Climb the directory tree upward, until found a directory that contains the
|
|
9
|
-
* target file, and return resulting full path
|
|
10
|
-
*/
|
|
11
|
-
declare function findPath(target: string, startDirectory?: string): string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Climb the directory tree upward, until found a directory that contains the
|
|
14
|
-
* target file, and return resulting full path
|
|
15
|
-
*/
|
|
16
|
-
declare function asyncFindPath(target: string, startDirectory?: string): Promise<string | undefined>;
|
|
17
|
-
|
|
18
|
-
declare const gitIgnoreToGlob: (pattern: string) => string;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This is called "isPosix" rather than "isNotWindows" because even if we are
|
|
22
|
-
* on Windows, we could be running in a POSIX environment (e.g. WSL2)
|
|
23
|
-
*/
|
|
24
|
-
declare const isPosix: boolean;
|
|
25
|
-
declare const toPosixPathSeparators: (relativePath: string) => string;
|
|
26
|
-
declare const normalizePath: (relativePath: string) => string;
|
|
27
|
-
/**
|
|
28
|
-
* On Windows, replace all `/` in the path back with `\\`. Do this only if you
|
|
29
|
-
* wish to output the path in the console or error message.
|
|
30
|
-
* On POSIX system (macOS, Linux, ...), this does not change the path (because
|
|
31
|
-
* inside the compiler we use `/` everywhere).
|
|
32
|
-
*/
|
|
33
|
-
declare const toSystemPathSeparators: (relativePath: string) => string;
|
|
34
|
-
declare const getCwd: () => string;
|
|
35
|
-
declare const path: typeof posix & {
|
|
36
|
-
sep: "/";
|
|
37
|
-
};
|
|
38
|
-
declare const exportsForTests: {
|
|
39
|
-
toWin32PathSeparators: (relativePath: string) => string;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* A subset of the package.json typing that is interesting to Lumina.
|
|
44
|
-
*
|
|
45
|
-
* The full package.json type is insanely large (20k lines):
|
|
46
|
-
* https://github.com/ffflorian/schemastore-updater/blob/main/schemas/package/index.d.ts#L20067
|
|
47
|
-
*/
|
|
48
|
-
type MiniPackageJson = {
|
|
49
|
-
"name": string;
|
|
50
|
-
"version": string;
|
|
51
|
-
"dependencies"?: Record<string, string | undefined>;
|
|
52
|
-
"devDependencies"?: Record<string, string | undefined>;
|
|
53
|
-
"peerDependencies"?: Record<string, string | undefined>;
|
|
54
|
-
"css.customData"?: string[];
|
|
55
|
-
"customElements"?: string;
|
|
56
|
-
"html.customData"?: string[];
|
|
57
|
-
"web-types"?: string;
|
|
58
|
-
};
|
|
59
|
-
declare function retrievePackageJson(location?: string): MiniPackageJson;
|
|
60
|
-
declare function asyncRetrievePackageJson(location?: string): Promise<MiniPackageJson>;
|
|
61
|
-
/**
|
|
62
|
-
* Returns an absolute path to the root of a package in node_modules, without
|
|
63
|
-
* trailing slash.
|
|
64
|
-
*/
|
|
65
|
-
declare function fetchPackageLocation(packageName: string, cwd?: string): Promise<string>;
|
|
66
|
-
/**
|
|
67
|
-
* Detect if current repository/monorepo uses npm, yarn or pnpm
|
|
68
|
-
*/
|
|
69
|
-
declare function detectPackageManager(cwd?: string): string;
|
|
70
|
-
|
|
71
|
-
export { type MiniPackageJson, asyncFindPath, asyncRetrievePackageJson, createFileIfNotExists, detectPackageManager, existsAsync, exportsForTests, fetchPackageLocation, findPath, getCwd, gitIgnoreToGlob, isPosix, normalizePath, path, retrievePackageJson, sh, toPosixPathSeparators, toSystemPathSeparators };
|
|
1
|
+
export * from './file';
|
|
2
|
+
export * from './glob';
|
|
3
|
+
export * from './path';
|
|
4
|
+
export * from './packageJson';
|
|
5
|
+
export * from './vite';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,71 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare function createFileIfNotExists(filePath: string, content: string): Promise<void>;
|
|
7
|
-
/**
|
|
8
|
-
* Climb the directory tree upward, until found a directory that contains the
|
|
9
|
-
* target file, and return resulting full path
|
|
10
|
-
*/
|
|
11
|
-
declare function findPath(target: string, startDirectory?: string): string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Climb the directory tree upward, until found a directory that contains the
|
|
14
|
-
* target file, and return resulting full path
|
|
15
|
-
*/
|
|
16
|
-
declare function asyncFindPath(target: string, startDirectory?: string): Promise<string | undefined>;
|
|
17
|
-
|
|
18
|
-
declare const gitIgnoreToGlob: (pattern: string) => string;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This is called "isPosix" rather than "isNotWindows" because even if we are
|
|
22
|
-
* on Windows, we could be running in a POSIX environment (e.g. WSL2)
|
|
23
|
-
*/
|
|
24
|
-
declare const isPosix: boolean;
|
|
25
|
-
declare const toPosixPathSeparators: (relativePath: string) => string;
|
|
26
|
-
declare const normalizePath: (relativePath: string) => string;
|
|
27
|
-
/**
|
|
28
|
-
* On Windows, replace all `/` in the path back with `\\`. Do this only if you
|
|
29
|
-
* wish to output the path in the console or error message.
|
|
30
|
-
* On POSIX system (macOS, Linux, ...), this does not change the path (because
|
|
31
|
-
* inside the compiler we use `/` everywhere).
|
|
32
|
-
*/
|
|
33
|
-
declare const toSystemPathSeparators: (relativePath: string) => string;
|
|
34
|
-
declare const getCwd: () => string;
|
|
35
|
-
declare const path: typeof posix & {
|
|
36
|
-
sep: "/";
|
|
37
|
-
};
|
|
38
|
-
declare const exportsForTests: {
|
|
39
|
-
toWin32PathSeparators: (relativePath: string) => string;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* A subset of the package.json typing that is interesting to Lumina.
|
|
44
|
-
*
|
|
45
|
-
* The full package.json type is insanely large (20k lines):
|
|
46
|
-
* https://github.com/ffflorian/schemastore-updater/blob/main/schemas/package/index.d.ts#L20067
|
|
47
|
-
*/
|
|
48
|
-
type MiniPackageJson = {
|
|
49
|
-
"name": string;
|
|
50
|
-
"version": string;
|
|
51
|
-
"dependencies"?: Record<string, string | undefined>;
|
|
52
|
-
"devDependencies"?: Record<string, string | undefined>;
|
|
53
|
-
"peerDependencies"?: Record<string, string | undefined>;
|
|
54
|
-
"css.customData"?: string[];
|
|
55
|
-
"customElements"?: string;
|
|
56
|
-
"html.customData"?: string[];
|
|
57
|
-
"web-types"?: string;
|
|
58
|
-
};
|
|
59
|
-
declare function retrievePackageJson(location?: string): MiniPackageJson;
|
|
60
|
-
declare function asyncRetrievePackageJson(location?: string): Promise<MiniPackageJson>;
|
|
61
|
-
/**
|
|
62
|
-
* Returns an absolute path to the root of a package in node_modules, without
|
|
63
|
-
* trailing slash.
|
|
64
|
-
*/
|
|
65
|
-
declare function fetchPackageLocation(packageName: string, cwd?: string): Promise<string>;
|
|
66
|
-
/**
|
|
67
|
-
* Detect if current repository/monorepo uses npm, yarn or pnpm
|
|
68
|
-
*/
|
|
69
|
-
declare function detectPackageManager(cwd?: string): string;
|
|
70
|
-
|
|
71
|
-
export { type MiniPackageJson, asyncFindPath, asyncRetrievePackageJson, createFileIfNotExists, detectPackageManager, existsAsync, exportsForTests, fetchPackageLocation, findPath, getCwd, gitIgnoreToGlob, isPosix, normalizePath, path, retrievePackageJson, sh, toPosixPathSeparators, toSystemPathSeparators };
|
|
1
|
+
export * from './file';
|
|
2
|
+
export * from './glob';
|
|
3
|
+
export * from './path';
|
|
4
|
+
export * from './packageJson';
|
|
5
|
+
export * from './vite';
|