@arcgis/components-build-utils 5.1.0-next.9 → 5.1.0-next.90

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/file.d.cts CHANGED
@@ -1,7 +1,9 @@
1
- import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
1
+ import { ExecSyncOptionsWithStringEncoding, SpawnSyncOptionsWithStringEncoding } from 'node:child_process';
2
2
  export declare const existsAsync: (file: string) => Promise<boolean>;
3
3
  /** Wrapper for execSync to execute shell commands */
4
4
  export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): string;
5
+ /** Wrapper for spawnSync to execute commands without shell interpolation. */
6
+ export declare function sp(command: string, args: string[], options?: Partial<SpawnSyncOptionsWithStringEncoding>): string;
5
7
  export declare function asyncSh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): Promise<string>;
6
8
  export declare function createFileIfNotExists(filePath: string, content: string): Promise<void>;
7
9
  /**
package/dist/file.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
1
+ import { ExecSyncOptionsWithStringEncoding, SpawnSyncOptionsWithStringEncoding } from 'node:child_process';
2
2
  export declare const existsAsync: (file: string) => Promise<boolean>;
3
3
  /** Wrapper for execSync to execute shell commands */
4
4
  export declare function sh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): string;
5
+ /** Wrapper for spawnSync to execute commands without shell interpolation. */
6
+ export declare function sp(command: string, args: string[], options?: Partial<SpawnSyncOptionsWithStringEncoding>): string;
5
7
  export declare function asyncSh(command: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): Promise<string>;
6
8
  export declare function createFileIfNotExists(filePath: string, content: string): Promise<void>;
7
9
  /**
package/dist/index.cjs CHANGED
@@ -43,6 +43,15 @@ function sh(command, options = {}) {
43
43
  throw error;
44
44
  }
45
45
  }
46
+ function sp(command, args, options = {}) {
47
+ try {
48
+ const normalizedOptions = { encoding: "utf8", ...options };
49
+ const result = node_child_process.spawnSync(command, args, normalizedOptions);
50
+ return `${result.stdout ?? ""}${result.stderr ?? ""}`.trim();
51
+ } catch (error) {
52
+ throw error;
53
+ }
54
+ }
46
55
  async function asyncSh(command, options = {}) {
47
56
  const normalizedOptions = { encoding: "utf8", ...options };
48
57
  return await new Promise((resolve2, reject) => {
@@ -277,7 +286,7 @@ function vitePresetPlugin({
277
286
  // This dependency pulls in many others. Since components-build-utils has a
278
287
  // single entry point, we load a large module tree needlessly. To avoid,
279
288
  // load the plugin on demand.
280
- import("vite-plugin-dts").then(
289
+ dtsOptions === false ? void 0 : import("vite-plugin-dts").then(
281
290
  ({ default: dts }) => dts({
282
291
  logLevel: "warn",
283
292
  // Copies .d.ts files to d.cjs file for CommonJS.
@@ -387,6 +396,7 @@ exports.normalizePath = normalizePath;
387
396
  exports.path = path;
388
397
  exports.retrievePackageJson = retrievePackageJson;
389
398
  exports.sh = sh;
399
+ exports.sp = sp;
390
400
  exports.toPosixPathSeparators = toPosixPathSeparators;
391
401
  exports.toSystemPathSeparators = toSystemPathSeparators;
392
402
  exports.vitePresetPlugin = vitePresetPlugin;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { existsAsync, sh, asyncSh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
1
+ export { existsAsync, sh, sp, asyncSh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
2
2
  export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob.ts';
3
3
  export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path.ts';
4
4
  export { type PackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson.ts';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { existsAsync, sh, asyncSh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
1
+ export { existsAsync, sh, sp, asyncSh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
2
2
  export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob.ts';
3
3
  export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path.ts';
4
4
  export { type PackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson.ts';
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { access, existsSync, readFileSync } from "node:fs";
2
2
  import { constants, mkdir, writeFile, readFile } from "node:fs/promises";
3
3
  import { dirname, resolve, sep, join, posix, win32 } from "path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { execSync, exec } from "node:child_process";
5
+ import { execSync, spawnSync, exec } from "node:child_process";
6
6
  import { styleText } from "node:util";
7
7
  import { builtinModules } from "node:module";
8
8
  const existsAsync = async (file) => (
@@ -19,6 +19,15 @@ function sh(command, options = {}) {
19
19
  throw error;
20
20
  }
21
21
  }
22
+ function sp(command, args, options = {}) {
23
+ try {
24
+ const normalizedOptions = { encoding: "utf8", ...options };
25
+ const result = spawnSync(command, args, normalizedOptions);
26
+ return `${result.stdout ?? ""}${result.stderr ?? ""}`.trim();
27
+ } catch (error) {
28
+ throw error;
29
+ }
30
+ }
22
31
  async function asyncSh(command, options = {}) {
23
32
  const normalizedOptions = { encoding: "utf8", ...options };
24
33
  return await new Promise((resolve2, reject) => {
@@ -253,7 +262,7 @@ function vitePresetPlugin({
253
262
  // This dependency pulls in many others. Since components-build-utils has a
254
263
  // single entry point, we load a large module tree needlessly. To avoid,
255
264
  // load the plugin on demand.
256
- import("vite-plugin-dts").then(
265
+ dtsOptions === false ? void 0 : import("vite-plugin-dts").then(
257
266
  ({ default: dts }) => dts({
258
267
  logLevel: "warn",
259
268
  // Copies .d.ts files to d.cjs file for CommonJS.
@@ -364,6 +373,7 @@ export {
364
373
  path,
365
374
  retrievePackageJson,
366
375
  sh,
376
+ sp,
367
377
  toPosixPathSeparators,
368
378
  toSystemPathSeparators,
369
379
  vitePresetPlugin
@@ -12,11 +12,6 @@ export type PackageJson = {
12
12
  "main"?: string;
13
13
  "module"?: string;
14
14
  "types"?: string;
15
- "publishConfig"?: {
16
- access?: string;
17
- registry?: string;
18
- provenance?: boolean;
19
- };
20
15
  "files"?: string[];
21
16
  "dependencies"?: Record<string, string>;
22
17
  "devDependencies"?: Record<string, string>;
@@ -32,10 +27,6 @@ export type PackageJson = {
32
27
  "exports"?: Record<string, Record<string, string> | string>;
33
28
  "scripts"?: Record<string, string>;
34
29
  "packageManager"?: string;
35
- "webGISComponents"?: {
36
- deployBuilds?: Record<string, string>;
37
- artifactsDeployPath?: string;
38
- };
39
30
  };
40
31
  export declare function retrievePackageJson(location?: string, cache?: boolean): PackageJson;
41
32
  export declare function asyncRetrievePackageJson(location?: string): Promise<PackageJson>;
@@ -12,11 +12,6 @@ export type PackageJson = {
12
12
  "main"?: string;
13
13
  "module"?: string;
14
14
  "types"?: string;
15
- "publishConfig"?: {
16
- access?: string;
17
- registry?: string;
18
- provenance?: boolean;
19
- };
20
15
  "files"?: string[];
21
16
  "dependencies"?: Record<string, string>;
22
17
  "devDependencies"?: Record<string, string>;
@@ -32,10 +27,6 @@ export type PackageJson = {
32
27
  "exports"?: Record<string, Record<string, string> | string>;
33
28
  "scripts"?: Record<string, string>;
34
29
  "packageManager"?: string;
35
- "webGISComponents"?: {
36
- deployBuilds?: Record<string, string>;
37
- artifactsDeployPath?: string;
38
- };
39
30
  };
40
31
  export declare function retrievePackageJson(location?: string, cache?: boolean): PackageJson;
41
32
  export declare function asyncRetrievePackageJson(location?: string): Promise<PackageJson>;
package/dist/vite.d.cts CHANGED
@@ -7,8 +7,8 @@ import { default as dts } from 'vite-plugin-dts';
7
7
  */
8
8
  export declare function vitePresetPlugin({ dtsOptions, externalize, bundleIn, }?: DependencyManagementOptions & {
9
9
  /** Additional options for `vite-plugin-dts` */
10
- dtsOptions?: Parameters<typeof dts>[0];
11
- }): [Plugin, Plugin, Promise<Plugin>];
10
+ dtsOptions?: Parameters<typeof dts>[0] | false;
11
+ }): [Plugin, Plugin, Promise<Plugin> | undefined];
12
12
  /**
13
13
  * Options for externalizing dependencies.
14
14
  */
@@ -69,15 +69,6 @@ export type DependencyManagementOptions = {
69
69
  * be externalized (because all peerDependencies are externalized).
70
70
  */
71
71
  export declare function externalizeDependencies(options: DependencyManagementOptions): Plugin;
72
- /**
73
- * Convert a string value to a RegExp that matches any import specifier that
74
- * starts with the given string.
75
- *
76
- * @example
77
- * "monaco-editor" will create a regex that matches "monaco-editor" and
78
- * "monaco-editor/sub-path", but not "monaco-editor-beta".
79
- */
80
- export declare const stringToStartsWithGlob: (option: RegExp | string) => RegExp;
81
72
  export declare const exportsForTests: {
82
73
  stringToStartsWithGlob: (option: RegExp | string) => RegExp;
83
74
  };
package/dist/vite.d.ts CHANGED
@@ -7,8 +7,8 @@ import { default as dts } from 'vite-plugin-dts';
7
7
  */
8
8
  export declare function vitePresetPlugin({ dtsOptions, externalize, bundleIn, }?: DependencyManagementOptions & {
9
9
  /** Additional options for `vite-plugin-dts` */
10
- dtsOptions?: Parameters<typeof dts>[0];
11
- }): [Plugin, Plugin, Promise<Plugin>];
10
+ dtsOptions?: Parameters<typeof dts>[0] | false;
11
+ }): [Plugin, Plugin, Promise<Plugin> | undefined];
12
12
  /**
13
13
  * Options for externalizing dependencies.
14
14
  */
@@ -69,15 +69,6 @@ export type DependencyManagementOptions = {
69
69
  * be externalized (because all peerDependencies are externalized).
70
70
  */
71
71
  export declare function externalizeDependencies(options: DependencyManagementOptions): Plugin;
72
- /**
73
- * Convert a string value to a RegExp that matches any import specifier that
74
- * starts with the given string.
75
- *
76
- * @example
77
- * "monaco-editor" will create a regex that matches "monaco-editor" and
78
- * "monaco-editor/sub-path", but not "monaco-editor-beta".
79
- */
80
- export declare const stringToStartsWithGlob: (option: RegExp | string) => RegExp;
81
72
  export declare const exportsForTests: {
82
73
  stringToStartsWithGlob: (option: RegExp | string) => RegExp;
83
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/components-build-utils",
3
- "version": "5.1.0-next.9",
3
+ "version": "5.1.0-next.90",
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",
@@ -21,7 +21,7 @@
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "dependencies": {
23
23
  "tslib": "^2.8.1",
24
- "vite": "^7.2.2",
24
+ "vite": "^7.3.2",
25
25
  "vite-plugin-dts": "^4.5.4"
26
26
  }
27
27
  }