Primeiro commit do projeto Angular
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
export { VERSION } from '../../src/utilities/version';
|
||||
export default function (options: {
|
||||
cliArgs: string[];
|
||||
}): Promise<number>;
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.VERSION = void 0;
|
||||
exports.default = default_1;
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const node_util_1 = require("node:util");
|
||||
const command_module_1 = require("../../src/command-builder/command-module");
|
||||
const command_runner_1 = require("../../src/command-builder/command-runner");
|
||||
const color_1 = require("../../src/utilities/color");
|
||||
const environment_options_1 = require("../../src/utilities/environment-options");
|
||||
const log_file_1 = require("../../src/utilities/log-file");
|
||||
var version_1 = require("../../src/utilities/version");
|
||||
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
||||
const MIN_NODEJS_VERSION = [20, 19];
|
||||
/* eslint-disable no-console */
|
||||
async function default_1(options) {
|
||||
// This node version check ensures that the requirements of the project instance of the CLI are met
|
||||
const [major, minor] = process.versions.node.split('.').map((part) => Number(part));
|
||||
if (major < MIN_NODEJS_VERSION[0] ||
|
||||
(major === MIN_NODEJS_VERSION[0] && minor < MIN_NODEJS_VERSION[1])) {
|
||||
process.stderr.write(`Node.js version ${process.version} detected.\n` +
|
||||
`The Angular CLI requires a minimum of v${MIN_NODEJS_VERSION[0]}.${MIN_NODEJS_VERSION[1]}.\n\n` +
|
||||
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n');
|
||||
return 3;
|
||||
}
|
||||
const colorLevels = {
|
||||
info: (s) => s,
|
||||
debug: (s) => s,
|
||||
warn: (s) => color_1.colors.bold(color_1.colors.yellow(s)),
|
||||
error: (s) => color_1.colors.bold(color_1.colors.red(s)),
|
||||
fatal: (s) => color_1.colors.bold(color_1.colors.red(s)),
|
||||
};
|
||||
const logger = new core_1.logging.IndentLogger('cli-main-logger');
|
||||
const logInfo = console.log;
|
||||
const logError = console.error;
|
||||
const useColor = (0, color_1.supportColor)();
|
||||
const loggerFinished = logger.forEach((entry) => {
|
||||
if (!environment_options_1.ngDebug && entry.level === 'debug') {
|
||||
return;
|
||||
}
|
||||
const color = useColor ? colorLevels[entry.level] : node_util_1.stripVTControlCharacters;
|
||||
const message = color(entry.message);
|
||||
switch (entry.level) {
|
||||
case 'warn':
|
||||
case 'fatal':
|
||||
case 'error':
|
||||
logError(message);
|
||||
break;
|
||||
default:
|
||||
logInfo(message);
|
||||
break;
|
||||
}
|
||||
});
|
||||
// Redirect console to logger
|
||||
console.info = console.log = function (...args) {
|
||||
logger.info((0, node_util_1.format)(...args));
|
||||
};
|
||||
console.warn = function (...args) {
|
||||
logger.warn((0, node_util_1.format)(...args));
|
||||
};
|
||||
console.error = function (...args) {
|
||||
logger.error((0, node_util_1.format)(...args));
|
||||
};
|
||||
try {
|
||||
return await (0, command_runner_1.runCommand)(options.cliArgs, logger);
|
||||
}
|
||||
catch (err) {
|
||||
if (err instanceof command_module_1.CommandModuleError) {
|
||||
logger.fatal(`Error: ${err.message}`);
|
||||
}
|
||||
else if (err instanceof Error) {
|
||||
try {
|
||||
const logPath = (0, log_file_1.writeErrorToLogFile)(err);
|
||||
logger.fatal(`An unhandled exception occurred: ${err.message}\n` +
|
||||
`See "${logPath}" for further details.`);
|
||||
}
|
||||
catch (e) {
|
||||
logger.fatal(`An unhandled exception occurred: ${err.message}\n` +
|
||||
`Fatal error writing debug log file: ${e}`);
|
||||
if (err.stack) {
|
||||
logger.fatal(err.stack);
|
||||
}
|
||||
}
|
||||
return 127;
|
||||
}
|
||||
else if (typeof err === 'string') {
|
||||
logger.fatal(err);
|
||||
}
|
||||
else if (typeof err === 'number') {
|
||||
// Log nothing.
|
||||
}
|
||||
else {
|
||||
logger.fatal(`An unexpected error occurred: ${err}`);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
finally {
|
||||
logger.complete();
|
||||
await loggerFinished;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,4BA+FC;AA5GD,+CAA+C;AAC/C,yCAA6D;AAC7D,6EAA8E;AAC9E,6EAAsE;AACtE,qDAAiE;AACjE,iFAAkE;AAClE,2DAAmE;AAEnE,uDAAsD;AAA7C,kGAAA,OAAO,OAAA;AAEhB,MAAM,kBAAkB,GAAG,CAAC,EAAE,EAAE,EAAE,CAAU,CAAC;AAE7C,+BAA+B;AAChB,KAAK,oBAAW,OAA8B;IAC3D,mGAAmG;IACnG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACpF,IACE,KAAK,GAAG,kBAAkB,CAAC,CAAC,CAAC;QAC7B,CAAC,KAAK,KAAK,kBAAkB,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,mBAAmB,OAAO,CAAC,OAAO,cAAc;YAC9C,0CAA0C,kBAAkB,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,OAAO;YAC/F,gGAAgG,CACnG,CAAC;QAE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BACF,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;oBACd,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;YAED,OAAO,GAAG,CAAC;QACb,CAAC;aAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;aAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YACnC,eAAe;QACjB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,CAAC,CAAC;IACX,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,cAAc,CAAC;IACvB,CAAC;AACH,CAAC"}
|
||||
BIN
Binary file not shown.
+6150
File diff suppressed because it is too large
Load Diff
+1025
File diff suppressed because it is too large
Load Diff
+133
@@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
||||
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AiConfig = exports.TypeSeparator = exports.Implement = exports.SchematicsAngularComponentStyle = exports.ChangeDetection = exports.ViewEncapsulation = exports.TestRunner = exports.SchematicsAngularApplicationStyle = exports.FileNameStyleGuide = exports.PackageManager = exports.Environment = void 0;
|
||||
/**
|
||||
* Configure in which environment disk cache is enabled.
|
||||
*/
|
||||
var Environment;
|
||||
(function (Environment) {
|
||||
Environment["All"] = "all";
|
||||
Environment["Ci"] = "ci";
|
||||
Environment["Local"] = "local";
|
||||
})(Environment || (exports.Environment = Environment = {}));
|
||||
/**
|
||||
* Specify which package manager tool to use.
|
||||
*
|
||||
* The package manager used to install dependencies.
|
||||
*/
|
||||
var PackageManager;
|
||||
(function (PackageManager) {
|
||||
PackageManager["Bun"] = "bun";
|
||||
PackageManager["Npm"] = "npm";
|
||||
PackageManager["Pnpm"] = "pnpm";
|
||||
PackageManager["Yarn"] = "yarn";
|
||||
})(PackageManager || (exports.PackageManager = PackageManager = {}));
|
||||
/**
|
||||
* The file naming convention to use for generated files. The '2025' style guide (default)
|
||||
* uses a concise format (e.g., `app.ts` for the root component), while the '2016' style
|
||||
* guide includes the type in the file name (e.g., `app.component.ts`). For more
|
||||
* information, see the Angular Style Guide (https://angular.dev/style-guide).
|
||||
*/
|
||||
var FileNameStyleGuide;
|
||||
(function (FileNameStyleGuide) {
|
||||
FileNameStyleGuide["The2016"] = "2016";
|
||||
FileNameStyleGuide["The2025"] = "2025";
|
||||
})(FileNameStyleGuide || (exports.FileNameStyleGuide = FileNameStyleGuide = {}));
|
||||
/**
|
||||
* The type of stylesheet files to be created for components in the application.
|
||||
*
|
||||
* The type of stylesheet files to be created for components in the initial project.
|
||||
*/
|
||||
var SchematicsAngularApplicationStyle;
|
||||
(function (SchematicsAngularApplicationStyle) {
|
||||
SchematicsAngularApplicationStyle["Css"] = "css";
|
||||
SchematicsAngularApplicationStyle["Less"] = "less";
|
||||
SchematicsAngularApplicationStyle["Sass"] = "sass";
|
||||
SchematicsAngularApplicationStyle["Scss"] = "scss";
|
||||
SchematicsAngularApplicationStyle["Tailwind"] = "tailwind";
|
||||
})(SchematicsAngularApplicationStyle || (exports.SchematicsAngularApplicationStyle = SchematicsAngularApplicationStyle = {}));
|
||||
/**
|
||||
* The unit testing runner to use.
|
||||
*/
|
||||
var TestRunner;
|
||||
(function (TestRunner) {
|
||||
TestRunner["Karma"] = "karma";
|
||||
TestRunner["Vitest"] = "vitest";
|
||||
})(TestRunner || (exports.TestRunner = TestRunner = {}));
|
||||
/**
|
||||
* Sets the view encapsulation mode for the application's components. This determines how
|
||||
* component styles are scoped and applied.
|
||||
*
|
||||
* Sets the view encapsulation mode for the component. This determines how the component's
|
||||
* styles are scoped and applied.
|
||||
*
|
||||
* Sets the view encapsulation mode for components in the initial project. This determines
|
||||
* how component styles are scoped and applied. Options include: `Emulated` (default, styles
|
||||
* are scoped to the component), `None` (styles are global), and `ShadowDom` (styles are
|
||||
* encapsulated using Shadow DOM).
|
||||
*/
|
||||
var ViewEncapsulation;
|
||||
(function (ViewEncapsulation) {
|
||||
ViewEncapsulation["Emulated"] = "Emulated";
|
||||
ViewEncapsulation["None"] = "None";
|
||||
ViewEncapsulation["ShadowDom"] = "ShadowDom";
|
||||
})(ViewEncapsulation || (exports.ViewEncapsulation = ViewEncapsulation = {}));
|
||||
/**
|
||||
* Configures the change detection strategy for the component.
|
||||
*/
|
||||
var ChangeDetection;
|
||||
(function (ChangeDetection) {
|
||||
ChangeDetection["Default"] = "Default";
|
||||
ChangeDetection["OnPush"] = "OnPush";
|
||||
})(ChangeDetection || (exports.ChangeDetection = ChangeDetection = {}));
|
||||
/**
|
||||
* Specify the type of stylesheet to be created for the component, or `none` to skip
|
||||
* creating a stylesheet.
|
||||
*/
|
||||
var SchematicsAngularComponentStyle;
|
||||
(function (SchematicsAngularComponentStyle) {
|
||||
SchematicsAngularComponentStyle["Css"] = "css";
|
||||
SchematicsAngularComponentStyle["Less"] = "less";
|
||||
SchematicsAngularComponentStyle["None"] = "none";
|
||||
SchematicsAngularComponentStyle["Sass"] = "sass";
|
||||
SchematicsAngularComponentStyle["Scss"] = "scss";
|
||||
})(SchematicsAngularComponentStyle || (exports.SchematicsAngularComponentStyle = SchematicsAngularComponentStyle = {}));
|
||||
var Implement;
|
||||
(function (Implement) {
|
||||
Implement["CanActivate"] = "CanActivate";
|
||||
Implement["CanActivateChild"] = "CanActivateChild";
|
||||
Implement["CanDeactivate"] = "CanDeactivate";
|
||||
Implement["CanMatch"] = "CanMatch";
|
||||
})(Implement || (exports.Implement = Implement = {}));
|
||||
/**
|
||||
* The separator character to use before the type within the generated file's name. For
|
||||
* example, if you set the option to `.`, the file will be named `example.guard.ts`.
|
||||
*
|
||||
* The separator character to use before the type within the generated file's name. For
|
||||
* example, if you set the option to `.`, the file will be named `example.interceptor.ts`.
|
||||
*
|
||||
* The separator character to use before the type within the generated file's name. For
|
||||
* example, if you set the option to `.`, the file will be named `example.pipe.ts`.
|
||||
*
|
||||
* The separator character to use before the type within the generated file's name. For
|
||||
* example, if you set the option to `.`, the file will be named `example.resolver.ts`.
|
||||
*/
|
||||
var TypeSeparator;
|
||||
(function (TypeSeparator) {
|
||||
TypeSeparator["Empty"] = "-";
|
||||
TypeSeparator["TypeSeparator"] = ".";
|
||||
})(TypeSeparator || (exports.TypeSeparator = TypeSeparator = {}));
|
||||
var AiConfig;
|
||||
(function (AiConfig) {
|
||||
AiConfig["Agents"] = "agents";
|
||||
AiConfig["Claude"] = "claude";
|
||||
AiConfig["Copilot"] = "copilot";
|
||||
AiConfig["Cursor"] = "cursor";
|
||||
AiConfig["Gemini"] = "gemini";
|
||||
AiConfig["Jetbrains"] = "jetbrains";
|
||||
AiConfig["None"] = "none";
|
||||
AiConfig["Windsurf"] = "windsurf";
|
||||
})(AiConfig || (exports.AiConfig = AiConfig = {}));
|
||||
//# sourceMappingURL=workspace-schema.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"workspace-schema.js","sourceRoot":"","sources":["workspace-schema.ts"],"names":[],"mappings":";AACA,mFAAmF;AACnF,oFAAoF;;;AA4DpF;;GAEG;AACH,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,0BAAW,CAAA;IACX,wBAAS,CAAA;IACT,8BAAe,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED;;;;GAIG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACtB,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,+BAAa,CAAA;IACb,+BAAa,CAAA;AACjB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAqID;;;;;GAKG;AACH,IAAY,kBA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AAa,QAGxB;AAyQD,IAAY,QASX;AATD,WAAY,QAAQ;IAChB,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;IACjB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;IACjB,mCAAuB,CAAA;IACvB,yBAAa,CAAA;IACb,iCAAqB,CAAA;AACzB,CAAC,EATW,QAAQ,wBAAR,QAAQ,QASnB"}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
export {};
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const promises_1 = require("node:fs/promises");
|
||||
const node_module_1 = require("node:module");
|
||||
const path = __importStar(require("node:path"));
|
||||
const semver_1 = require("semver");
|
||||
const color_1 = require("../src/utilities/color");
|
||||
const config_1 = require("../src/utilities/config");
|
||||
const environment_options_1 = require("../src/utilities/environment-options");
|
||||
const version_1 = require("../src/utilities/version");
|
||||
/**
|
||||
* Angular CLI versions prior to v14 may not exit correctly if not forcibly exited
|
||||
* via `process.exit()`. When bootstrapping, `forceExit` will be set to `true`
|
||||
* if the local CLI version is less than v14 to prevent the CLI from hanging on
|
||||
* exit in those cases.
|
||||
*/
|
||||
let forceExit = false;
|
||||
(async () => {
|
||||
/**
|
||||
* Disable Browserslist old data warning as otherwise with every release we'd need to update this dependency
|
||||
* which is cumbersome considering we pin versions and the warning is not user actionable.
|
||||
* `Browserslist: caniuse-lite is outdated. Please run next command `npm update`
|
||||
* See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
|
||||
*/
|
||||
process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
|
||||
const rawCommandName = process.argv[2];
|
||||
/**
|
||||
* Disable CLI version mismatch checks and forces usage of the invoked CLI
|
||||
* instead of invoking the local installed version.
|
||||
*
|
||||
* When running `ng new` always favor the global version. As in some
|
||||
* cases orphan `node_modules` would cause the non global CLI to be used.
|
||||
* @see: https://github.com/angular/angular-cli/issues/14603
|
||||
*/
|
||||
if (environment_options_1.disableVersionCheck || rawCommandName === 'new') {
|
||||
return (await Promise.resolve().then(() => __importStar(require('./cli')))).default;
|
||||
}
|
||||
let cli;
|
||||
try {
|
||||
// No error implies a projectLocalCli, which will load whatever
|
||||
// version of ng-cli you have installed in a local package.json
|
||||
const cwdRequire = (0, node_module_1.createRequire)(process.cwd() + '/');
|
||||
const projectLocalCli = cwdRequire.resolve('@angular/cli');
|
||||
cli = await Promise.resolve(`${projectLocalCli}`).then(s => __importStar(require(s)));
|
||||
const globalVersion = new semver_1.SemVer(version_1.VERSION.full);
|
||||
// Older versions might not have the VERSION export
|
||||
let localVersion = cli.VERSION?.full;
|
||||
if (!localVersion) {
|
||||
try {
|
||||
const localPackageJson = await (0, promises_1.readFile)(path.join(path.dirname(projectLocalCli), '../../package.json'), 'utf-8');
|
||||
localVersion = JSON.parse(localPackageJson).version;
|
||||
}
|
||||
catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Version mismatch check skipped. Unable to retrieve local version: ' + error);
|
||||
}
|
||||
}
|
||||
// Ensure older versions of the CLI fully exit
|
||||
const localMajorVersion = (0, semver_1.major)(localVersion);
|
||||
if (localMajorVersion > 0 && localMajorVersion < 14) {
|
||||
forceExit = true;
|
||||
// Versions prior to 14 didn't implement completion command.
|
||||
if (rawCommandName === 'completion') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
let isGlobalGreater = false;
|
||||
try {
|
||||
isGlobalGreater = localVersion > 0 && globalVersion.compare(localVersion) > 0;
|
||||
}
|
||||
catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Version mismatch check skipped. Unable to compare local version: ' + error);
|
||||
}
|
||||
// When using the completion command, don't show the warning as otherwise this will break completion.
|
||||
if (isGlobalGreater &&
|
||||
rawCommandName !== '--get-yargs-completions' &&
|
||||
rawCommandName !== 'completion') {
|
||||
// If using the update command and the global version is greater, use the newer update command
|
||||
// This allows improvements in update to be used in older versions that do not have bootstrapping
|
||||
if (rawCommandName === 'update' &&
|
||||
cli.VERSION &&
|
||||
cli.VERSION.major - globalVersion.major <= 1) {
|
||||
cli = await Promise.resolve().then(() => __importStar(require('./cli')));
|
||||
}
|
||||
else if (await (0, config_1.isWarningEnabled)('versionMismatch')) {
|
||||
// Otherwise, use local version and warn if global is newer than local
|
||||
const warning = `Your global Angular CLI version (${globalVersion}) is greater than your local ` +
|
||||
`version (${localVersion}). The local Angular CLI version is used.\n\n` +
|
||||
'To disable this warning use "ng config -g cli.warnings.versionMismatch false".';
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(color_1.colors.yellow(warning));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// If there is an error, resolve could not find the ng-cli
|
||||
// library from a package.json. Instead, include it from a relative
|
||||
// path to this script file (which is likely a globally installed
|
||||
// npm package). Most common cause for hitting this is `ng new`
|
||||
cli = await Promise.resolve().then(() => __importStar(require('./cli')));
|
||||
}
|
||||
if ('default' in cli) {
|
||||
cli = cli['default'];
|
||||
}
|
||||
return cli;
|
||||
})()
|
||||
.then((cli) => cli?.({
|
||||
cliArgs: process.argv.slice(2),
|
||||
}))
|
||||
.then((exitCode = 0) => {
|
||||
if (forceExit) {
|
||||
process.exit(exitCode);
|
||||
}
|
||||
process.exitCode = exitCode;
|
||||
})
|
||||
.catch((err) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Unknown error: ' + err.toString());
|
||||
process.exit(127);
|
||||
});
|
||||
//# sourceMappingURL=init.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["init.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAA4C;AAC5C,6CAA4C;AAC5C,gDAAkC;AAClC,mCAAuC;AACvC,kDAAgD;AAChD,oDAA2D;AAC3D,8EAA2E;AAC3E,sDAAmD;AAEnD;;;;;GAKG;AACH,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,CAAC,KAAK,IAAoD,EAAE;IAC1D;;;;;OAKG;IACH,OAAO,CAAC,G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