@arcgis/components-build-utils 5.0.0-next.9 → 5.0.0-next.91

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.
@@ -1,10 +1,10 @@
1
1
  import { Command } from 'commander';
2
2
  /**
3
3
  * !important
4
- * The class makes a TLS request to qawebgis
5
- * You need to make sure node trusts the certificate authority that signed the certificate used by qawebgis.esri.com
4
+ * The class makes a TLS request to webgis
5
+ * You need to make sure node trusts the certificate authority that signed the certificate used by webgis.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://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
9
9
  */
10
10
  export declare const registerCommand: (command: Command) => undefined;
@@ -1,10 +1,10 @@
1
1
  import { Command } from 'commander';
2
2
  /**
3
3
  * !important
4
- * The class makes a TLS request to qawebgis
5
- * You need to make sure node trusts the certificate authority that signed the certificate used by qawebgis.esri.com
4
+ * The class makes a TLS request to webgis
5
+ * You need to make sure node trusts the certificate authority that signed the certificate used by webgis.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://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
9
9
  */
10
10
  export declare const registerCommand: (command: Command) => undefined;
@@ -0,0 +1,8 @@
1
+ export declare const markdownLog: string[];
2
+ export declare function addKeyValueToOutput(key: string, value: string[] | string): void;
3
+ export declare function addMarkdownToOutput(key?: string): void;
4
+ export declare function addHeadingToSummary(text: string, level?: 1 | 2 | 3): void;
5
+ export declare function addLineToSummary(text: string): void;
6
+ export declare function addListToSummary(items: string[], ordered?: boolean): void;
7
+ export declare function addNewlineToSummary(): void;
8
+ export declare function writeSummary(): void;
@@ -0,0 +1,8 @@
1
+ export declare const markdownLog: string[];
2
+ export declare function addKeyValueToOutput(key: string, value: string[] | string): void;
3
+ export declare function addMarkdownToOutput(key?: string): void;
4
+ export declare function addHeadingToSummary(text: string, level?: 1 | 2 | 3): void;
5
+ export declare function addLineToSummary(text: string): void;
6
+ export declare function addListToSummary(items: string[], ordered?: boolean): void;
7
+ export declare function addNewlineToSummary(): void;
8
+ export declare function writeSummary(): void;
@@ -7,10 +7,10 @@ export interface Issue {
7
7
  };
8
8
  }
9
9
  declare class Devtopia {
10
- readonly owner: string;
11
- readonly name: string;
12
10
  private issuesPerPage;
13
11
  constructor(owner: string, name: string);
12
+ readonly owner: string;
13
+ readonly name: string;
14
14
  /**
15
15
  * Requests to github graphql server
16
16
  */
@@ -7,10 +7,10 @@ export interface Issue {
7
7
  };
8
8
  }
9
9
  declare class Devtopia {
10
- readonly owner: string;
11
- readonly name: string;
12
10
  private issuesPerPage;
13
11
  constructor(owner: string, name: string);
12
+ readonly owner: string;
13
+ readonly name: string;
14
14
  /**
15
15
  * Requests to github graphql server
16
16
  */
@@ -1,4 +1,4 @@
1
- import { Issue } from './devtopia';
1
+ import { Issue } from './devtopia.ts';
2
2
  export type IssueWithZenhub = {
3
3
  gitHubId: string;
4
4
  zenhubId: string;
@@ -30,17 +30,17 @@ 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://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
34
34
  */
35
35
  declare class Zentopia {
36
- readonly repoId: number;
37
- readonly workspaceId: string;
38
- readonly token?: string | undefined;
39
36
  private _issueIdCache;
40
37
  private _pipelinesCache?;
41
38
  private _sprintsCache?;
42
39
  private _releasesCache?;
43
- constructor(repoId: number, workspaceId: string, token?: string | undefined);
40
+ constructor(repoId: number, workspaceId: string, token?: string);
41
+ readonly repoId: number;
42
+ readonly workspaceId: string;
43
+ readonly token?: string;
44
44
  /**
45
45
  * Requests to graphql server
46
46
  */
@@ -1,4 +1,4 @@
1
- import { Issue } from './devtopia';
1
+ import { Issue } from './devtopia.ts';
2
2
  export type IssueWithZenhub = {
3
3
  gitHubId: string;
4
4
  zenhubId: string;
@@ -30,17 +30,17 @@ 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://webgis.esri.com/webgis/components/devops/troubleshoot/troubleshoot#certificate-verification-failure
34
34
  */
35
35
  declare class Zentopia {
36
- readonly repoId: number;
37
- readonly workspaceId: string;
38
- readonly token?: string | undefined;
39
36
  private _issueIdCache;
40
37
  private _pipelinesCache?;
41
38
  private _sprintsCache?;
42
39
  private _releasesCache?;
43
- constructor(repoId: number, workspaceId: string, token?: string | undefined);
40
+ constructor(repoId: number, workspaceId: string, token?: string);
41
+ readonly repoId: number;
42
+ readonly workspaceId: string;
43
+ readonly token?: string;
44
44
  /**
45
45
  * Requests to graphql server
46
46
  */
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@commander-js/extra-typings';
2
- import { PackageWalkerItem } from './utils';
2
+ import { PackageWalkerItem } from './utils.ts';
3
3
  export declare const registerCommand: (command: Command) => undefined;
4
4
  export declare function scanDist({ blocklistedNames }: {
5
5
  blocklistedNames?: string[];
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@commander-js/extra-typings';
2
- import { PackageWalkerItem } from './utils';
2
+ import { PackageWalkerItem } from './utils.ts';
3
3
  export declare const registerCommand: (command: Command) => undefined;
4
4
  export declare function scanDist({ blocklistedNames }: {
5
5
  blocklistedNames?: string[];
@@ -1,5 +1,5 @@
1
1
  import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
2
- import { MiniPackageJson } from '../packageJson';
2
+ import { MiniPackageJson } from '../packageJson.ts';
3
3
  /**
4
4
  * Sets the exit code to 1 and prints the error message to stderr.
5
5
  * This is used to indicate an error condition in the script.
@@ -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>): string;
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,9 @@ 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 getModifiedFiles(options?: Partial<ExecSyncOptionsWithStringEncoding>): string[];
69
+ export declare function commitStagedFiles(messages: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
70
+ export declare function pushCommits(options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
66
71
  export {};
@@ -1,5 +1,5 @@
1
1
  import { ExecSyncOptionsWithStringEncoding } from 'node:child_process';
2
- import { MiniPackageJson } from '../packageJson';
2
+ import { MiniPackageJson } from '../packageJson.ts';
3
3
  /**
4
4
  * Sets the exit code to 1 and prints the error message to stderr.
5
5
  * This is used to indicate an error condition in the script.
@@ -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>): string;
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,9 @@ 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 getModifiedFiles(options?: Partial<ExecSyncOptionsWithStringEncoding>): string[];
69
+ export declare function commitStagedFiles(messages: string, options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
70
+ export declare function pushCommits(options?: Partial<ExecSyncOptionsWithStringEncoding>): void;
66
71
  export {};
package/dist/index.cjs CHANGED
@@ -43,7 +43,7 @@ async function createFileIfNotExists(filePath, content) {
43
43
  function findPath(target, startDirectory = process.cwd()) {
44
44
  const resolvedStartDirectory = startDirectory.startsWith("file:///") ? path$1.dirname(node_url.fileURLToPath(startDirectory)) : path$1.resolve(startDirectory);
45
45
  const parentPath = resolvedStartDirectory.split(path$1.sep);
46
- while (parentPath.length > 2) {
46
+ while (parentPath.length > searchStopIndex) {
47
47
  const fullPath = path$1.join(
48
48
  ...path$1.sep === "/" ? ["/"] : [],
49
49
  ...parentPath,
@@ -56,10 +56,11 @@ function findPath(target, startDirectory = process.cwd()) {
56
56
  }
57
57
  return void 0;
58
58
  }
59
+ const searchStopIndex = 0;
59
60
  async function asyncFindPath(target, startDirectory = process.cwd()) {
60
61
  const resolvedStartDirectory = startDirectory.startsWith("file:///") ? path$1.dirname(node_url.fileURLToPath(startDirectory)) : path$1.resolve(startDirectory);
61
62
  const parentPath = resolvedStartDirectory.split(path$1.sep);
62
- while (parentPath.length > 2) {
63
+ while (parentPath.length > searchStopIndex) {
63
64
  const fullPath = path$1.join(
64
65
  ...path$1.sep === "/" ? ["/"] : [],
65
66
  ...parentPath,
@@ -132,13 +133,16 @@ const path = isPosix ? path$1.posix : {
132
133
  const cachedPackageJson = {};
133
134
  const cachedPackageJsonPromises = {};
134
135
  let rootPackageJsonLocation;
135
- function retrievePackageJson(location) {
136
+ function retrievePackageJson(location, cache = true) {
136
137
  const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
137
- cachedPackageJson[packageJsonPath] ??= JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
138
- return cachedPackageJson[packageJsonPath];
138
+ if (cache) {
139
+ cachedPackageJson[packageJsonPath] ??= JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
140
+ return cachedPackageJson[packageJsonPath];
141
+ }
142
+ return JSON.parse(node_fs.readFileSync(packageJsonPath, "utf-8"));
139
143
  }
140
- async function asyncRetrievePackageJson(location = getCwd()) {
141
- const packageJsonPath = path.resolve(location, "package.json");
144
+ async function asyncRetrievePackageJson(location) {
145
+ const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
142
146
  if (packageJsonPath in cachedPackageJson) {
143
147
  return cachedPackageJson[packageJsonPath];
144
148
  }
@@ -212,7 +216,7 @@ function vitePresetPlugin({
212
216
  build: {
213
217
  // REFACTOR: get this from tsconfig
214
218
  // It's a best practice to let the final bundler down-level as needed.
215
- target: target ?? "es2022"
219
+ target: target ?? "es2024"
216
220
  },
217
221
  define: env.mode === "test" ? {
218
222
  "process.env.ESRI_INTERNAL": true
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
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
- export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
1
+ export { existsAsync, sh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
2
+ export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob.ts';
3
+ export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path.ts';
4
+ export { type MiniPackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson.ts';
5
+ export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite.ts';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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
- export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite';
1
+ export { existsAsync, sh, createFileIfNotExists, findPath, asyncFindPath } from './file.ts';
2
+ export { gitIgnoreFileToGlobs, gitIgnoreToGlob } from './glob.ts';
3
+ export { isPosix, toPosixPathSeparators, normalizePath, toSystemPathSeparators, getCwd, path } from './path.ts';
4
+ export { type MiniPackageJson, retrievePackageJson, asyncRetrievePackageJson, fetchPackageLocation, detectPackageManager, } from './packageJson.ts';
5
+ export { vitePresetPlugin, type DependencyManagementOptions, externalizeDependencies } from './vite.ts';
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ async function createFileIfNotExists(filePath, content) {
19
19
  function findPath(target, startDirectory = process.cwd()) {
20
20
  const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory);
21
21
  const parentPath = resolvedStartDirectory.split(sep);
22
- while (parentPath.length > 2) {
22
+ while (parentPath.length > searchStopIndex) {
23
23
  const fullPath = join(
24
24
  ...sep === "/" ? ["/"] : [],
25
25
  ...parentPath,
@@ -32,10 +32,11 @@ function findPath(target, startDirectory = process.cwd()) {
32
32
  }
33
33
  return void 0;
34
34
  }
35
+ const searchStopIndex = 0;
35
36
  async function asyncFindPath(target, startDirectory = process.cwd()) {
36
37
  const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory);
37
38
  const parentPath = resolvedStartDirectory.split(sep);
38
- while (parentPath.length > 2) {
39
+ while (parentPath.length > searchStopIndex) {
39
40
  const fullPath = join(
40
41
  ...sep === "/" ? ["/"] : [],
41
42
  ...parentPath,
@@ -108,13 +109,16 @@ const path = isPosix ? posix : {
108
109
  const cachedPackageJson = {};
109
110
  const cachedPackageJsonPromises = {};
110
111
  let rootPackageJsonLocation;
111
- function retrievePackageJson(location) {
112
+ function retrievePackageJson(location, cache = true) {
112
113
  const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
113
- cachedPackageJson[packageJsonPath] ??= JSON.parse(readFileSync(packageJsonPath, "utf-8"));
114
- return cachedPackageJson[packageJsonPath];
114
+ if (cache) {
115
+ cachedPackageJson[packageJsonPath] ??= JSON.parse(readFileSync(packageJsonPath, "utf-8"));
116
+ return cachedPackageJson[packageJsonPath];
117
+ }
118
+ return JSON.parse(readFileSync(packageJsonPath, "utf-8"));
115
119
  }
116
- async function asyncRetrievePackageJson(location = getCwd()) {
117
- const packageJsonPath = path.resolve(location, "package.json");
120
+ async function asyncRetrievePackageJson(location) {
121
+ const packageJsonPath = location ? path.resolve(location, "package.json") : rootPackageJsonLocation ??= findPath("package.json");
118
122
  if (packageJsonPath in cachedPackageJson) {
119
123
  return cachedPackageJson[packageJsonPath];
120
124
  }
@@ -188,7 +192,7 @@ function vitePresetPlugin({
188
192
  build: {
189
193
  // REFACTOR: get this from tsconfig
190
194
  // It's a best practice to let the final bundler down-level as needed.
191
- target: target ?? "es2022"
195
+ target: target ?? "es2024"
192
196
  },
193
197
  define: env.mode === "test" ? {
194
198
  "process.env.ESRI_INTERNAL": true
@@ -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.
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/components-build-utils",
3
- "version": "5.0.0-next.9",
3
+ "version": "5.0.0-next.91",
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",
@@ -22,6 +22,7 @@
22
22
  },
23
23
  "license": "SEE LICENSE IN LICENSE.md",
24
24
  "dependencies": {
25
+ "@actions/core": "^1.11.0",
25
26
  "@commander-js/extra-typings": "^14.0.0",
26
27
  "chalk": "^5.4.1",
27
28
  "commander": "^14.0.0",
@@ -33,7 +34,7 @@
33
34
  "semver": "^7.7.2",
34
35
  "split2": "^4.2.0",
35
36
  "tslib": "^2.8.1",
36
- "vite": "^7.0.0",
37
+ "vite": "^7.2.2",
37
38
  "vite-plugin-dts": "^4.5.4"
38
39
  }
39
40
  }