@arcgis/components-build-utils 4.34.0-next.127 → 4.34.0-next.128
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/glob.d.cts +23 -0
- package/dist/glob.d.ts +23 -0
- package/dist/index.cjs +4 -2
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -2
- package/dist/path.d.cts +8 -0
- package/dist/path.d.ts +8 -0
- package/package.json +1 -1
package/dist/glob.d.cts
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read `.gitignore` files and convert it to globs that are accepted by ESLint
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* // eslint.config.js
|
|
7
|
+
* import { gitIgnoreFileToGlobs } from "@arcgis/components-build-utils";
|
|
8
|
+
* import { globalIgnores } from "eslint/config";
|
|
9
|
+
*
|
|
10
|
+
* export default [
|
|
11
|
+
* globalIgnores([
|
|
12
|
+
* ...gitIgnoreFileToGlobs(import.meta.dirname + "/.gitignore"),
|
|
13
|
+
* ...gitIgnoreFileToGlobs(import.meta.dirname + "/.prettierignore"),
|
|
14
|
+
* ]),
|
|
15
|
+
* // ...
|
|
16
|
+
* ];
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function gitIgnoreFileToGlobs(filePath: string): string[];
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use gitIgnoreFileToGlobs from "@arcgis/components-build-utils"
|
|
22
|
+
* instead
|
|
23
|
+
*/
|
|
1
24
|
export declare const gitIgnoreToGlob: (pattern: string) => string;
|
package/dist/glob.d.ts
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read `.gitignore` files and convert it to globs that are accepted by ESLint
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* // eslint.config.js
|
|
7
|
+
* import { gitIgnoreFileToGlobs } from "@arcgis/components-build-utils";
|
|
8
|
+
* import { globalIgnores } from "eslint/config";
|
|
9
|
+
*
|
|
10
|
+
* export default [
|
|
11
|
+
* globalIgnores([
|
|
12
|
+
* ...gitIgnoreFileToGlobs(import.meta.dirname + "/.gitignore"),
|
|
13
|
+
* ...gitIgnoreFileToGlobs(import.meta.dirname + "/.prettierignore"),
|
|
14
|
+
* ]),
|
|
15
|
+
* // ...
|
|
16
|
+
* ];
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function gitIgnoreFileToGlobs(filePath: string): string[];
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use gitIgnoreFileToGlobs from "@arcgis/components-build-utils"
|
|
22
|
+
* instead
|
|
23
|
+
*/
|
|
1
24
|
export declare const gitIgnoreToGlob: (pattern: string) => string;
|
package/dist/index.cjs
CHANGED
|
@@ -53,6 +53,9 @@ async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
|
53
53
|
}
|
|
54
54
|
return void 0;
|
|
55
55
|
}
|
|
56
|
+
function gitIgnoreFileToGlobs(filePath) {
|
|
57
|
+
return node_fs.readFileSync(filePath, "utf8").split("\n").filter((line) => line.trim().length > 0 && !line.trim().startsWith("#")).map(gitIgnoreToGlob);
|
|
58
|
+
}
|
|
56
59
|
const gitIgnoreToGlob = (pattern) => fixAbsoluteSyntax(fixMatchFilesSyntax(pattern));
|
|
57
60
|
function fixAbsoluteSyntax(pattern) {
|
|
58
61
|
if (pattern.startsWith("/")) {
|
|
@@ -107,7 +110,6 @@ const path = isPosix ? posix : {
|
|
|
107
110
|
return toPosixPathSeparators(result);
|
|
108
111
|
}
|
|
109
112
|
};
|
|
110
|
-
const exportsForTests = { toWin32PathSeparators };
|
|
111
113
|
const cachedPackageJson = {};
|
|
112
114
|
const cachedPackageJsonPromises = {};
|
|
113
115
|
let rootPackageJsonLocation;
|
|
@@ -304,11 +306,11 @@ exports.asyncRetrievePackageJson = asyncRetrievePackageJson;
|
|
|
304
306
|
exports.createFileIfNotExists = createFileIfNotExists;
|
|
305
307
|
exports.detectPackageManager = detectPackageManager;
|
|
306
308
|
exports.existsAsync = existsAsync;
|
|
307
|
-
exports.exportsForTests = exportsForTests;
|
|
308
309
|
exports.externalizeDependencies = externalizeDependencies;
|
|
309
310
|
exports.fetchPackageLocation = fetchPackageLocation;
|
|
310
311
|
exports.findPath = findPath;
|
|
311
312
|
exports.getCwd = getCwd;
|
|
313
|
+
exports.gitIgnoreFileToGlobs = gitIgnoreFileToGlobs;
|
|
312
314
|
exports.gitIgnoreToGlob = gitIgnoreToGlob;
|
|
313
315
|
exports.isPosix = isPosix;
|
|
314
316
|
exports.normalizePath = normalizePath;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
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
5
|
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
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
5
|
export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
|
package/dist/index.js
CHANGED
|
@@ -51,6 +51,9 @@ async function asyncFindPath(target, startDirectory = process.cwd()) {
|
|
|
51
51
|
}
|
|
52
52
|
return void 0;
|
|
53
53
|
}
|
|
54
|
+
function gitIgnoreFileToGlobs(filePath) {
|
|
55
|
+
return readFileSync(filePath, "utf8").split("\n").filter((line) => line.trim().length > 0 && !line.trim().startsWith("#")).map(gitIgnoreToGlob);
|
|
56
|
+
}
|
|
54
57
|
const gitIgnoreToGlob = (pattern) => fixAbsoluteSyntax(fixMatchFilesSyntax(pattern));
|
|
55
58
|
function fixAbsoluteSyntax(pattern) {
|
|
56
59
|
if (pattern.startsWith("/")) {
|
|
@@ -105,7 +108,6 @@ const path = isPosix ? posix : {
|
|
|
105
108
|
return toPosixPathSeparators(result);
|
|
106
109
|
}
|
|
107
110
|
};
|
|
108
|
-
const exportsForTests = { toWin32PathSeparators };
|
|
109
111
|
const cachedPackageJson = {};
|
|
110
112
|
const cachedPackageJsonPromises = {};
|
|
111
113
|
let rootPackageJsonLocation;
|
|
@@ -303,11 +305,11 @@ export {
|
|
|
303
305
|
createFileIfNotExists,
|
|
304
306
|
detectPackageManager,
|
|
305
307
|
existsAsync,
|
|
306
|
-
exportsForTests,
|
|
307
308
|
externalizeDependencies,
|
|
308
309
|
fetchPackageLocation,
|
|
309
310
|
findPath,
|
|
310
311
|
getCwd,
|
|
312
|
+
gitIgnoreFileToGlobs,
|
|
311
313
|
gitIgnoreToGlob,
|
|
312
314
|
isPosix,
|
|
313
315
|
normalizePath,
|
package/dist/path.d.cts
CHANGED
|
@@ -13,7 +13,15 @@ export declare const normalizePath: (relativePath: string) => string;
|
|
|
13
13
|
* inside the compiler we use `/` everywhere).
|
|
14
14
|
*/
|
|
15
15
|
export declare const toSystemPathSeparators: (relativePath: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Like `process.cwd()`, but always returns a POSIX-style path
|
|
18
|
+
* (with `/` as separator).
|
|
19
|
+
*/
|
|
16
20
|
export declare const getCwd: () => string;
|
|
21
|
+
/**
|
|
22
|
+
* A wrapper for Node.js's `path` module that always uses POSIX-style paths
|
|
23
|
+
* (with `/` as separator).
|
|
24
|
+
*/
|
|
17
25
|
export declare const path: typeof posix & {
|
|
18
26
|
sep: "/";
|
|
19
27
|
};
|
package/dist/path.d.ts
CHANGED
|
@@ -13,7 +13,15 @@ export declare const normalizePath: (relativePath: string) => string;
|
|
|
13
13
|
* inside the compiler we use `/` everywhere).
|
|
14
14
|
*/
|
|
15
15
|
export declare const toSystemPathSeparators: (relativePath: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Like `process.cwd()`, but always returns a POSIX-style path
|
|
18
|
+
* (with `/` as separator).
|
|
19
|
+
*/
|
|
16
20
|
export declare const getCwd: () => string;
|
|
21
|
+
/**
|
|
22
|
+
* A wrapper for Node.js's `path` module that always uses POSIX-style paths
|
|
23
|
+
* (with `/` as separator).
|
|
24
|
+
*/
|
|
17
25
|
export declare const path: typeof posix & {
|
|
18
26
|
sep: "/";
|
|
19
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/components-build-utils",
|
|
3
|
-
"version": "4.34.0-next.
|
|
3
|
+
"version": "4.34.0-next.128",
|
|
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",
|