@angular/build 18.2.0-next.0 → 18.2.0-next.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/build",
3
- "version": "18.2.0-next.0",
3
+ "version": "18.2.0-next.1",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,30 +23,29 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.1802.0-next.0",
27
- "@babel/core": "7.24.7",
26
+ "@angular-devkit/architect": "0.1802.0-next.1",
27
+ "@babel/core": "7.24.9",
28
28
  "@babel/helper-annotate-as-pure": "7.24.7",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
30
30
  "@babel/plugin-syntax-import-attributes": "7.24.7",
31
- "@inquirer/confirm": "3.1.14",
31
+ "@inquirer/confirm": "3.1.15",
32
32
  "@vitejs/plugin-basic-ssl": "1.1.0",
33
- "ansi-colors": "4.1.3",
34
33
  "browserslist": "^4.23.0",
35
34
  "critters": "0.0.24",
36
35
  "esbuild": "0.23.0",
37
36
  "fast-glob": "3.3.2",
38
37
  "https-proxy-agent": "7.0.5",
38
+ "listr2": "8.2.3",
39
39
  "lmdb": "3.0.12",
40
40
  "magic-string": "0.30.10",
41
41
  "mrmime": "2.0.0",
42
- "ora": "5.4.1",
43
42
  "parse5-html-rewriting-stream": "7.0.0",
44
43
  "picomatch": "4.0.2",
45
44
  "piscina": "4.6.1",
46
45
  "rollup": "4.18.1",
47
- "sass": "1.77.7",
48
- "semver": "7.6.2",
49
- "vite": "5.3.3",
46
+ "sass": "1.77.8",
47
+ "semver": "7.6.3",
48
+ "vite": "5.3.4",
50
49
  "watchpack": "2.4.1"
51
50
  },
52
51
  "peerDependencies": {
@@ -242,7 +242,7 @@ async function normalizeOptions(context, projectName, options, extensions) {
242
242
  plugins: extensions?.codePlugins?.length ? extensions?.codePlugins : undefined,
243
243
  loaderExtensions,
244
244
  jsonLogs: environment_options_1.useJSONBuildLogs,
245
- colors: color_1.colors.enabled,
245
+ colors: (0, color_1.supportColor)(),
246
246
  clearScreen,
247
247
  define,
248
248
  };
@@ -42,6 +42,7 @@ const node_module_1 = require("node:module");
42
42
  const node_path_1 = require("node:path");
43
43
  const angular_memory_plugin_1 = require("../../tools/vite/angular-memory-plugin");
44
44
  const i18n_locale_plugin_1 = require("../../tools/vite/i18n-locale-plugin");
45
+ const id_prefix_plugin_1 = require("../../tools/vite/id-prefix-plugin");
45
46
  const utils_1 = require("../../utils");
46
47
  const load_esm_1 = require("../../utils/load-esm");
47
48
  const internal_1 = require("./internal");
@@ -441,6 +442,7 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
441
442
  extensionMiddleware,
442
443
  normalizePath,
443
444
  }),
445
+ (0, id_prefix_plugin_1.createRemoveIdPrefixPlugin)(externalMetadata.explicit),
444
446
  ],
445
447
  // Browser only optimizeDeps. (This does not run for SSR dependencies).
446
448
  optimizeDeps: getDepOptimizationConfig({
@@ -128,12 +128,13 @@ async function createSerializer(localizeToolsModule, format, sourceLocale, baseP
128
128
  case schema_1.Format.LegacyMigrate:
129
129
  return new LegacyMessageIdMigrationSerializer(diagnostics);
130
130
  case schema_1.Format.Arb:
131
- const fileSystem = {
131
+ return new ArbTranslationSerializer(sourceLocale,
132
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
+ basePath, {
132
134
  relative(from, to) {
133
135
  return node_path_1.default.relative(from, to);
134
136
  },
135
- };
136
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
- return new ArbTranslationSerializer(sourceLocale, basePath, fileSystem);
137
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
138
+ });
138
139
  }
139
140
  }
@@ -37,8 +37,8 @@ async function normalizeOptions(context, projectName, options) {
37
37
  // Normalize xliff format extensions
38
38
  let format = options.format;
39
39
  switch (format) {
40
- case undefined:
41
40
  // Default format is xliff1
41
+ case undefined:
42
42
  case schema_1.Format.Xlf:
43
43
  case schema_1.Format.Xlif:
44
44
  case schema_1.Format.Xliff:
@@ -98,9 +98,8 @@ function elideImports(sourceFile, removedNodes, getTypeChecker, compilerOptions)
98
98
  let symbol;
99
99
  switch (node.kind) {
100
100
  case typescript_1.default.SyntaxKind.Identifier:
101
- const parent = node.parent;
102
- if (parent && typescript_1.default.isShorthandPropertyAssignment(parent)) {
103
- const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(parent);
101
+ if (node.parent && typescript_1.default.isShorthandPropertyAssignment(node.parent)) {
102
+ const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(node.parent);
104
103
  if (shorthandSymbol) {
105
104
  symbol = shorthandSymbol;
106
105
  }
@@ -116,7 +116,7 @@ function visitComponentMetadata(nodeFactory, node, styleReplacements, resourceIm
116
116
  return undefined;
117
117
  }
118
118
  return node;
119
- case 'styleUrls':
119
+ case 'styleUrls': {
120
120
  if (!typescript_1.default.isArrayLiteralExpression(node.initializer)) {
121
121
  return node;
122
122
  }
@@ -132,6 +132,7 @@ function visitComponentMetadata(nodeFactory, node, styleReplacements, resourceIm
132
132
  styleReplacements.push(...externalStyles);
133
133
  // The external styles will be added afterwards in combination with any inline styles
134
134
  return undefined;
135
+ }
135
136
  default:
136
137
  // All other elements are passed through
137
138
  return node;
@@ -23,6 +23,7 @@ const compiler_plugin_1 = require("./angular/compiler-plugin");
23
23
  const compiler_plugin_options_1 = require("./compiler-plugin-options");
24
24
  const external_packages_plugin_1 = require("./external-packages-plugin");
25
25
  const i18n_locale_plugin_1 = require("./i18n-locale-plugin");
26
+ const loader_import_attribute_plugin_1 = require("./loader-import-attribute-plugin");
26
27
  const rxjs_esm_resolution_plugin_1 = require("./rxjs-esm-resolution-plugin");
27
28
  const sourcemap_ignorelist_plugin_1 = require("./sourcemap-ignorelist-plugin");
28
29
  const utils_1 = require("./utils");
@@ -45,6 +46,7 @@ function createBrowserCodeBundleOptions(options, target, sourceFileCache) {
45
46
  target,
46
47
  supported: (0, utils_1.getFeatureSupport)(target, zoneless),
47
48
  plugins: [
49
+ (0, loader_import_attribute_plugin_1.createLoaderImportAttributePlugin)(),
48
50
  (0, wasm_plugin_1.createWasmPlugin)({ allowAsync: zoneless, cache: sourceFileCache?.loadResultCache }),
49
51
  (0, sourcemap_ignorelist_plugin_1.createSourcemapIgnorelistPlugin)(),
50
52
  (0, compiler_plugin_1.createCompilerPlugin)(
@@ -146,6 +148,7 @@ function createServerCodeBundleOptions(options, target, sourceFileCache) {
146
148
  entryPoints,
147
149
  supported: (0, utils_1.getFeatureSupport)(target, zoneless),
148
150
  plugins: [
151
+ (0, loader_import_attribute_plugin_1.createLoaderImportAttributePlugin)(),
149
152
  (0, wasm_plugin_1.createWasmPlugin)({ allowAsync: zoneless, cache: sourceFileCache?.loadResultCache }),
150
153
  (0, sourcemap_ignorelist_plugin_1.createSourcemapIgnorelistPlugin)(),
151
154
  (0, compiler_plugin_1.createCompilerPlugin)(
@@ -45,7 +45,10 @@ function generateBudgetStats(metafile, outputFiles, initialFiles) {
45
45
  }
46
46
  // Add component styles from metafile
47
47
  // TODO: Provide this information directly from the AOT compiler
48
- for (const entry of Object.values(metafile.outputs)) {
48
+ for (const [file, entry] of Object.entries(metafile.outputs)) {
49
+ if (!file.endsWith('.css')) {
50
+ continue;
51
+ }
49
52
  // 'ng-component' is set by the angular plugin's component stylesheet bundler
50
53
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
54
  const componentStyle = entry['ng-component'];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import type { Plugin } from 'esbuild';
9
+ export declare function createLoaderImportAttributePlugin(): Plugin;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.createLoaderImportAttributePlugin = createLoaderImportAttributePlugin;
11
+ const promises_1 = require("node:fs/promises");
12
+ const SUPPORTED_LOADERS = ['binary', 'file', 'text'];
13
+ function createLoaderImportAttributePlugin() {
14
+ return {
15
+ name: 'angular-loader-import-attributes',
16
+ setup(build) {
17
+ build.onLoad({ filter: /./ }, async (args) => {
18
+ const loader = args.with['loader'];
19
+ if (!loader) {
20
+ return undefined;
21
+ }
22
+ if (!SUPPORTED_LOADERS.includes(loader)) {
23
+ return {
24
+ errors: [
25
+ {
26
+ text: 'Unsupported loader import attribute',
27
+ notes: [
28
+ { text: 'Attribute value must be one of: ' + SUPPORTED_LOADERS.join(', ') },
29
+ ],
30
+ },
31
+ ],
32
+ };
33
+ }
34
+ return {
35
+ contents: await (0, promises_1.readFile)(args.path),
36
+ loader,
37
+ };
38
+ });
39
+ },
40
+ };
41
+ }
@@ -27,6 +27,7 @@ exports.logMessages = logMessages;
27
27
  exports.isZonelessApp = isZonelessApp;
28
28
  exports.getEntryPointName = getEntryPointName;
29
29
  const esbuild_1 = require("esbuild");
30
+ const listr2_1 = require("listr2");
30
31
  const node_crypto_1 = require("node:crypto");
31
32
  const node_fs_1 = require("node:fs");
32
33
  const promises_1 = __importDefault(require("node:fs/promises"));
@@ -34,7 +35,6 @@ const node_path_1 = require("node:path");
34
35
  const node_url_1 = require("node:url");
35
36
  const node_zlib_1 = require("node:zlib");
36
37
  const semver_1 = require("semver");
37
- const spinner_1 = require("../../utils/spinner");
38
38
  const stats_table_1 = require("../../utils/stats-table");
39
39
  const bundler_context_1 = require("./bundler-context");
40
40
  function logBuildStats(metafile, outputFiles, initial, budgetFailures, colors, changedFiles, estimatedTransferSizes, ssrOutputEnabled, verbose) {
@@ -124,14 +124,17 @@ async function calculateEstimatedTransferSizes(outputFiles) {
124
124
  });
125
125
  }
126
126
  async function withSpinner(text, action) {
127
- const spinner = new spinner_1.Spinner(text);
128
- spinner.start();
129
- try {
130
- return await action();
131
- }
132
- finally {
133
- spinner.stop();
134
- }
127
+ let result;
128
+ const taskList = new listr2_1.Listr([
129
+ {
130
+ title: text,
131
+ async task() {
132
+ result = await action();
133
+ },
134
+ },
135
+ ], { rendererOptions: { clearOutput: true } });
136
+ await taskList.run();
137
+ return result;
135
138
  }
136
139
  async function withNoProgress(text, action) {
137
140
  return action();
@@ -35,7 +35,7 @@ function createWasmPlugin(options) {
35
35
  return {
36
36
  name: 'angular-wasm',
37
37
  setup(build) {
38
- build.onResolve({ filter: /.wasm$/ }, async (args) => {
38
+ build.onResolve({ filter: /\.wasm$/ }, async (args) => {
39
39
  // Skip if already resolving the WASM file to avoid infinite resolution
40
40
  if (args.pluginData?.[WASM_RESOLVE_SYMBOL]) {
41
41
  return;
@@ -75,7 +75,7 @@ function createWasmPlugin(options) {
75
75
  namespace: WASM_INIT_NAMESPACE,
76
76
  };
77
77
  });
78
- build.onLoad({ filter: /.wasm$/, namespace: WASM_INIT_NAMESPACE }, (0, load_result_cache_1.createCachedLoad)(cache, async (args) => {
78
+ build.onLoad({ filter: /\.wasm$/, namespace: WASM_INIT_NAMESPACE }, (0, load_result_cache_1.createCachedLoad)(cache, async (args) => {
79
79
  // Ensure async mode is supported
80
80
  if (!allowAsync) {
81
81
  return {
@@ -155,7 +155,7 @@ function createWasmPlugin(options) {
155
155
  watchFiles: [args.path],
156
156
  };
157
157
  }));
158
- build.onLoad({ filter: /.wasm$/, namespace: WASM_CONTENTS_NAMESPACE }, async (args) => {
158
+ build.onLoad({ filter: /\.wasm$/, namespace: WASM_CONTENTS_NAMESPACE }, async (args) => {
159
159
  const contents = args.pluginData.wasmContents ?? (await (0, promises_1.readFile)(args.path));
160
160
  let loader = 'file';
161
161
  if (args.with.loader) {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import type { Plugin } from 'vite';
9
+ export declare function createRemoveIdPrefixPlugin(externals: string[]): Plugin;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.createRemoveIdPrefixPlugin = createRemoveIdPrefixPlugin;
11
+ // NOTE: the implementation for this Vite plugin is roughly based on:
12
+ // https://github.com/MilanKovacic/vite-plugin-externalize-dependencies
13
+ const VITE_ID_PREFIX = '/@id/';
14
+ const escapeRegexSpecialChars = (inputString) => {
15
+ return inputString.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
16
+ };
17
+ function createRemoveIdPrefixPlugin(externals) {
18
+ return {
19
+ name: 'angular-plugin-remove-id-prefix',
20
+ apply: 'serve',
21
+ configResolved: (resolvedConfig) => {
22
+ // don't do anything when the list of externals is empty
23
+ if (externals.length === 0) {
24
+ return;
25
+ }
26
+ const escapedExternals = externals.map(escapeRegexSpecialChars);
27
+ const prefixedExternalRegex = new RegExp(`${VITE_ID_PREFIX}(${escapedExternals.join('|')})`, 'g');
28
+ // @ts-expect-error: Property 'push' does not exist on type 'readonly Plugin<any>[]'
29
+ // Reasoning:
30
+ // since the /@id/ prefix is added by Vite's import-analysis plugin,
31
+ // we must add our actual plugin dynamically, to ensure that it will run
32
+ // AFTER the import-analysis.
33
+ resolvedConfig.plugins.push({
34
+ name: 'angular-plugin-remove-id-prefix-transform',
35
+ transform: (code) => {
36
+ // don't do anything when code does not contain the Vite prefix
37
+ if (!code.includes(VITE_ID_PREFIX)) {
38
+ return code;
39
+ }
40
+ return code.replace(prefixedExternalRegex, (_, externalName) => externalName);
41
+ },
42
+ });
43
+ },
44
+ };
45
+ }
@@ -5,6 +5,5 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import * as ansiColors from 'ansi-colors';
9
- declare const colors: typeof ansiColors;
10
- export { colors };
8
+ export { color as colors, figures } from 'listr2';
9
+ export declare function supportColor(stream?: NodeJS.WritableStream): boolean;
@@ -6,58 +6,22 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
9
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.colors = void 0;
34
- const ansiColors = __importStar(require("ansi-colors"));
10
+ exports.figures = exports.colors = void 0;
11
+ exports.supportColor = supportColor;
35
12
  const node_tty_1 = require("node:tty");
36
- function supportColor() {
37
- if (process.env.FORCE_COLOR !== undefined) {
38
- // 2 colors: FORCE_COLOR = 0 (Disables colors), depth 1
39
- // 16 colors: FORCE_COLOR = 1, depth 4
40
- // 256 colors: FORCE_COLOR = 2, depth 8
41
- // 16,777,216 colors: FORCE_COLOR = 3, depth 16
42
- // See: https://nodejs.org/dist/latest-v12.x/docs/api/tty.html#tty_writestream_getcolordepth_env
43
- // and https://github.com/nodejs/node/blob/b9f36062d7b5c5039498e98d2f2c180dca2a7065/lib/internal/tty.js#L106;
44
- switch (process.env.FORCE_COLOR) {
45
- case '':
46
- case 'true':
47
- case '1':
48
- case '2':
49
- case '3':
50
- return true;
51
- default:
52
- return false;
53
- }
13
+ var listr2_1 = require("listr2");
14
+ Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return listr2_1.color; } });
15
+ Object.defineProperty(exports, "figures", { enumerable: true, get: function () { return listr2_1.figures; } });
16
+ function supportColor(stream = process.stdout) {
17
+ if (stream instanceof node_tty_1.WriteStream) {
18
+ return stream.hasColors();
19
+ }
20
+ try {
21
+ // The hasColors function does not rely on any instance state and should ideally be static
22
+ return node_tty_1.WriteStream.prototype.hasColors();
54
23
  }
55
- if (process.stdout instanceof node_tty_1.WriteStream) {
56
- return process.stdout.hasColors();
24
+ catch {
25
+ return process.env['FORCE_COLOR'] !== undefined && process.env['FORCE_COLOR'] !== '0';
57
26
  }
58
- return false;
59
27
  }
60
- // Create a separate instance to prevent unintended global changes to the color configuration
61
- const colors = ansiColors.create();
62
- exports.colors = colors;
63
- colors.enabled = supportColor();
@@ -137,7 +137,7 @@ class InlineFontsProcessor {
137
137
  rewriter.emitRaw(`<link rel="preconnect" href="${url}" crossorigin>`);
138
138
  }
139
139
  break;
140
- case 'link':
140
+ case 'link': {
141
141
  const hrefAttr = attrs.some(({ name, value }) => name === 'rel' && value === 'stylesheet') &&
142
142
  attrs.find(({ name, value }) => name === 'href' && hrefsContent.has(value));
143
143
  if (hrefAttr) {
@@ -149,6 +149,7 @@ class InlineFontsProcessor {
149
149
  rewriter.emitStartTag(tag);
150
150
  }
151
151
  break;
152
+ }
152
153
  default:
153
154
  rewriter.emitStartTag(tag);
154
155
  break;
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.normalizeCacheOptions = normalizeCacheOptions;
11
11
  const node_path_1 = require("node:path");
12
12
  /** Version placeholder is replaced during the build process with actual package version */
13
- const VERSION = '18.2.0-next.0';
13
+ const VERSION = '18.2.0-next.1';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&
@@ -1,20 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- export declare class Spinner {
9
- #private;
10
- private readonly spinner;
11
- /** When false, only fail messages will be displayed. */
12
- enabled: boolean;
13
- constructor(text?: string);
14
- set text(text: string);
15
- get isSpinning(): boolean;
16
- succeed(text?: string): void;
17
- fail(text?: string): void;
18
- stop(): void;
19
- start(text?: string): void;
20
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.dev/license
8
- */
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Spinner = void 0;
14
- const ora_1 = __importDefault(require("ora"));
15
- const color_1 = require("./color");
16
- const tty_1 = require("./tty");
17
- class Spinner {
18
- spinner;
19
- /** When false, only fail messages will be displayed. */
20
- enabled = true;
21
- #isTTY = (0, tty_1.isTTY)();
22
- constructor(text) {
23
- this.spinner = (0, ora_1.default)({
24
- text: text === undefined ? undefined : text + '\n',
25
- // The below 2 options are needed because otherwise CTRL+C will be delayed
26
- // when the underlying process is sync.
27
- hideCursor: false,
28
- discardStdin: false,
29
- isEnabled: this.#isTTY,
30
- });
31
- }
32
- set text(text) {
33
- this.spinner.text = text;
34
- }
35
- get isSpinning() {
36
- return this.spinner.isSpinning || !this.#isTTY;
37
- }
38
- succeed(text) {
39
- if (this.enabled) {
40
- this.spinner.succeed(text);
41
- }
42
- }
43
- fail(text) {
44
- this.spinner.fail(text && color_1.colors.redBright(text));
45
- }
46
- stop() {
47
- this.spinner.stop();
48
- }
49
- start(text) {
50
- if (this.enabled) {
51
- this.spinner.start(text);
52
- }
53
- }
54
- }
55
- exports.Spinner = Spinner;