Updated the project.

This commit is contained in:
Batuhan Berk Başoğlu 2024-06-03 15:44:25 -04:00
parent 5dfe9f128d
commit 7919556077
1550 changed files with 17063 additions and 40183 deletions

View file

@ -53,7 +53,8 @@
"npm",
"cnpm",
"yarn",
"pnpm"
"pnpm",
"bun"
]
},
"warnings": {
@ -119,7 +120,8 @@
"npm",
"cnpm",
"yarn",
"pnpm"
"pnpm",
"bun"
]
},
"warnings": {
@ -1574,7 +1576,8 @@
"npm",
"yarn",
"pnpm",
"cnpm"
"cnpm",
"bun"
]
},
"standalone": {
@ -1747,6 +1750,10 @@
"type": "string",
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
},
"deployUrl": {
"type": "string",
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
},
"scripts": {
"description": "Global scripts to be included in the build.",
"type": "array",
@ -1850,6 +1857,11 @@
},
"default": []
},
"clearScreen": {
"type": "boolean",
"default": false,
"description": "Automatically clear the terminal screen during rebuilds."
},
"optimization": {
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
"default": true,
@ -1934,6 +1946,13 @@
}
}
},
"define": {
"description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"fileReplacements": {
"description": "Replace compilation source files with other compilation source files in the build.",
"type": "array",
@ -2295,11 +2314,11 @@
"properties": {
"replace": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
},
"with": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
}
},
"additionalProperties": false
@ -2664,8 +2683,7 @@
},
"deployUrl": {
"type": "string",
"description": "URL where files will be deployed.",
"deprecated": true
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
},
"verbose": {
"type": "boolean",
@ -2881,11 +2899,11 @@
"properties": {
"src": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
},
"replaceWith": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
}
},
"additionalProperties": false
@ -2895,11 +2913,11 @@
"properties": {
"replace": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
},
"with": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
}
},
"additionalProperties": false
@ -3238,8 +3256,7 @@
},
"deployUrl": {
"type": "string",
"description": "URL where files will be deployed.",
"deprecated": true
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
},
"verbose": {
"type": "boolean",
@ -3458,11 +3475,11 @@
"properties": {
"replace": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
},
"with": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
}
},
"additionalProperties": false
@ -3534,7 +3551,7 @@
"buildTarget": {
"type": "string",
"description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
"pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
},
"port": {
"type": "number",
@ -3590,11 +3607,11 @@
},
"publicHost": {
"type": "string",
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies. This option has no effect when using the 'application' or other esbuild-based builders."
},
"allowedHosts": {
"type": "array",
"description": "List of hosts that are allowed to access the dev server.",
"description": "List of hosts that are allowed to access the dev server. This option has no effect when using the 'application' or other esbuild-based builders.",
"default": [],
"items": {
"type": "string"
@ -3606,7 +3623,7 @@
},
"disableHostCheck": {
"type": "boolean",
"description": "Don't verify connected clients are part of allowed hosts.",
"description": "Don't verify connected clients are part of allowed hosts. This option has no effect when using the 'application' or other esbuild-based builders.",
"default": false
},
"hmr": {
@ -3627,6 +3644,27 @@
"type": "boolean",
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system.",
"default": false
},
"prebundle": {
"description": "Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled. This option has no effect when using the 'browser' or other Webpack-based builders.",
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"exclude": {
"description": "List of package imports that should not be prebundled by the development server. The packages will be bundled into the application code itself.",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
]
}
},
"additionalProperties": false,
@ -3649,7 +3687,7 @@
"buildTarget": {
"type": "string",
"description": "A builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
"pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
},
"format": {
"type": "string",
@ -4623,8 +4661,7 @@
},
"deployUrl": {
"type": "string",
"description": "URL where files will be deployed.",
"deprecated": true
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
},
"vendorChunk": {
"type": "boolean",
@ -4783,11 +4820,11 @@
"properties": {
"src": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
},
"replaceWith": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
}
},
"additionalProperties": false
@ -4797,11 +4834,11 @@
"properties": {
"replace": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
},
"with": {
"type": "string",
"pattern": "\\.(([cm]?j|t)sx?|json)$"
"pattern": "\\.(([cm]?[jt])sx?|json)$"
}
},
"additionalProperties": false

View file

@ -66,6 +66,7 @@ export declare enum Environment {
* The package manager used to install dependencies.
*/
export declare enum PackageManager {
Bun = "bun",
Cnpm = "cnpm",
Npm = "npm",
Pnpm = "pnpm",

View file

@ -19,6 +19,7 @@ var Environment;
*/
var PackageManager;
(function (PackageManager) {
PackageManager["Bun"] = "bun";
PackageManager["Cnpm"] = "cnpm";
PackageManager["Npm"] = "npm";
PackageManager["Pnpm"] = "pnpm";

View file

@ -1,6 +1,6 @@
{
"name": "@angular/cli",
"version": "17.1.3",
"version": "17.3.8",
"description": "CLI tool for Angular",
"main": "lib/cli/index.js",
"bin": {
@ -25,35 +25,35 @@
},
"homepage": "https://github.com/angular/angular-cli",
"dependencies": {
"@angular-devkit/architect": "0.1701.3",
"@angular-devkit/core": "17.1.3",
"@angular-devkit/schematics": "17.1.3",
"@schematics/angular": "17.1.3",
"@angular-devkit/architect": "0.1703.8",
"@angular-devkit/core": "17.3.8",
"@angular-devkit/schematics": "17.3.8",
"@schematics/angular": "17.3.8",
"@yarnpkg/lockfile": "1.1.0",
"ansi-colors": "4.1.3",
"ini": "4.1.1",
"inquirer": "9.2.12",
"jsonc-parser": "3.2.0",
"ini": "4.1.2",
"inquirer": "9.2.15",
"jsonc-parser": "3.2.1",
"npm-package-arg": "11.0.1",
"npm-pick-manifest": "9.0.0",
"open": "8.4.2",
"ora": "5.4.1",
"pacote": "17.0.5",
"pacote": "17.0.6",
"resolve": "1.22.8",
"semver": "7.5.4",
"semver": "7.6.0",
"symbol-observable": "4.0.0",
"yargs": "17.7.2"
},
"ng-update": {
"migrations": "@schematics/angular/migrations/migration-collection.json",
"packageGroup": {
"@angular/cli": "17.1.3",
"@angular/ssr": "17.1.3",
"@angular-devkit/architect": "0.1701.3",
"@angular-devkit/build-angular": "17.1.3",
"@angular-devkit/build-webpack": "0.1701.3",
"@angular-devkit/core": "17.1.3",
"@angular-devkit/schematics": "17.1.3"
"@angular/cli": "17.3.8",
"@angular/ssr": "17.3.8",
"@angular-devkit/architect": "0.1703.8",
"@angular-devkit/build-angular": "17.3.8",
"@angular-devkit/build-webpack": "0.1703.8",
"@angular-devkit/core": "17.3.8",
"@angular-devkit/schematics": "17.3.8"
}
},
"engines": {

View file

@ -36,7 +36,7 @@ class ArchitectCommandModule extends architect_base_command_module_1.ArchitectBa
describe: `One or more named builder configurations as a comma-separated ` +
`list as specified in the "configurations" section in angular.json.\n` +
`The builder uses the named configurations to run the given target.\n` +
`For more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.`,
`For more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations.`,
alias: 'c',
type: 'string',
// Show only in when using --help and auto completion because otherwise comma seperated configuration values will be invalid.

View file

@ -98,7 +98,7 @@ async function runCommand(args, logger) {
'deprecated: %s': color_1.colors.yellow('deprecated:') + ' %s',
'Did you mean %s?': 'Unknown command. Did you mean %s?',
})
.epilogue('For more information, see https://angular.io/cli/.\n')
.epilogue('For more information, see https://angular.dev/cli/.\n')
.demandCommand(1, command_1.demandCommandFailureMessage)
.recommendCommands()
.middleware(normalize_options_middleware_1.normalizeOptionsMiddleware)

View file

@ -15,4 +15,4 @@ either by direct editing or with the `ng config` command.
These include `assets`, `styles`, and `scripts` objects that provide runtime-global resources to include in the project.
Resources in CSS, such as images and fonts, are automatically written and fingerprinted at the root of the output folder.
For further details, see [Workspace Configuration](guide/workspace-config).
For further details, see [Workspace Configuration](reference/configs/workspace-config).

View file

@ -2,7 +2,7 @@ Angular CLI saves a number of cachable operations on disk by default.
When you re-run the same build, the build system restores the state of the previous build and re-uses previously performed operations, which decreases the time taken to build and test your applications and libraries.
To amend the default cache settings, add the `cli.cache` object to your [Workspace Configuration](guide/workspace-config).
To amend the default cache settings, add the `cli.cache` object to your [Workspace Configuration](reference/configs/workspace-config).
The object goes under `cli.cache` at the top level of the file, outside the `projects` sections.
```jsonc
@ -12,13 +12,13 @@ The object goes under `cli.cache` at the top level of the file, outside the `pro
"cli": {
"cache": {
// ...
}
},
},
"projects": {}
"projects": {},
}
```
For more information, see [cache options](guide/workspace-config#cache-options).
For more information, see [cache options](reference/configs/workspace-config#cache-options).
### Cache environments
@ -34,7 +34,7 @@ To change the environment setting to `all`, run the following command:
ng config cli.cache.environment all
```
For more information, see `environment` in [cache options](guide/workspace-config#cache-options).
For more information, see `environment` in [cache options](reference/configs/workspace-config#cache-options).
<div class="alert is-helpful">

View file

@ -44,7 +44,7 @@ Appended \`source <(ng completion script)\` to \`${rcFile}\`. Restart your termi
' Angular CLI. For autocompletion to work, the CLI will need to be on your `$PATH`, which' +
' is typically done with the `-g` flag in `npm install -g @angular/cli`.' +
'\n\n' +
'For more information, see https://angular.io/cli/completion#global-install');
'For more information, see https://angular.dev/cli/completion#global-install');
}
return 0;
}

View file

@ -8,6 +8,6 @@ The configurable property names match command option names,
except that in the configuration file, all names must use camelCase,
while on the command line options can be given dash-case.
For further details, see [Workspace Configuration](guide/workspace-config).
For further details, see [Workspace Configuration](reference/configs/workspace-config).
For configuration of CLI usage analytics, see [ng analytics](cli/analytics).

View file

@ -3,7 +3,7 @@ When a project name is not supplied, executes the `deploy` builder for the defau
To use the `ng deploy` command, use `ng add` to add a package that implements deployment capabilities to your favorite platform.
Adding the package automatically updates your workspace configuration, adding a deployment
[CLI builder](guide/cli-builder).
[CLI builder](tools/cli/cli-builder).
For example:
```json

View file

@ -1,7 +1,7 @@
The command takes an optional project name, as specified in the `projects` section of the `angular.json` workspace configuration file.
When a project name is not supplied, executes the `lint` builder for all projects.
To use the `ng lint` command, use `ng add` to add a package that implements linting capabilities. Adding the package automatically updates your workspace configuration, adding a lint [CLI builder](guide/cli-builder).
To use the `ng lint` command, use `ng add` to add a package that implements linting capabilities. Adding the package automatically updates your workspace configuration, adding a lint [CLI builder](tools/cli/cli-builder).
For example:
```json

View file

@ -785,6 +785,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
const { logger } = this.context;
const numberOfMigrations = optionalMigrations.length;
logger.info(`This package has ${numberOfMigrations} optional migration${numberOfMigrations > 1 ? 's' : ''} that can be executed.`);
logger.info('Optional migrations may be skipped and executed after the update process if preferred.');
logger.info(''); // Extra trailing newline.
if (!(0, tty_1.isTTY)()) {
for (const migration of optionalMigrations) {

View file

@ -35,7 +35,6 @@ const core_1 = require("@angular-devkit/core");
const schematics_1 = require("@angular-devkit/schematics");
const npa = __importStar(require("npm-package-arg"));
const semver = __importStar(require("semver"));
const error_1 = require("../../../utilities/error");
const package_metadata_1 = require("../../../utilities/package-metadata");
// Angular guarantees that a major is compatible with its following major (so packages that depend
// on Angular 5 are also compatible with Angular 6). This is, in code, represented by verifying
@ -196,14 +195,7 @@ function _performUpdate(tree, context, infoMap, logger, migrateOnly) {
if (!packageJsonContent) {
throw new schematics_1.SchematicsException('Could not find a package.json. Are you in a Node project?');
}
let packageJson;
try {
packageJson = JSON.parse(packageJsonContent.toString());
}
catch (e) {
(0, error_1.assertIsError)(e);
throw new schematics_1.SchematicsException('package.json could not be parsed: ' + e.message);
}
const packageJson = tree.readJson('/package.json');
const updateDependency = (deps, name, newVersion) => {
const oldVersion = deps[name];
// We only respect caret and tilde ranges on update.
@ -423,11 +415,12 @@ function _buildPackageInfo(tree, packages, allDependencies, npmPackageJson, logg
}
// Find out the currently installed version. Either from the package.json or the node_modules/
// TODO: figure out a way to read package-lock.json and/or yarn.lock.
const pkgJsonPath = `/node_modules/${name}/package.json`;
const pkgJsonExists = tree.exists(pkgJsonPath);
let installedVersion;
const packageContent = tree.read(`/node_modules/${name}/package.json`);
if (packageContent) {
const content = JSON.parse(packageContent.toString());
installedVersion = content.version;
if (pkgJsonExists) {
const { version } = tree.readJson(pkgJsonPath);
installedVersion = version;
}
const packageVersionsNonDeprecated = [];
const packageVersionsDeprecated = [];
@ -449,7 +442,7 @@ function _buildPackageInfo(tree, packages, allDependencies, npmPackageJson, logg
if (!installedVersion) {
throw new schematics_1.SchematicsException(`An unexpected error happened; could not determine version for package ${name}.`);
}
const installedPackageJson = npmPackageJson.versions[installedVersion] || packageContent;
const installedPackageJson = npmPackageJson.versions[installedVersion] || pkgJsonExists;
if (!installedPackageJson) {
throw new schematics_1.SchematicsException(`An unexpected error happened; package ${name} has no version ${installedVersion}.`);
}
@ -593,22 +586,11 @@ function _addPeerDependencies(tree, packages, allDependencies, npmPackageJson, n
}
}
function _getAllDependencies(tree) {
const packageJsonContent = tree.read('/package.json');
if (!packageJsonContent) {
throw new schematics_1.SchematicsException('Could not find a package.json. Are you in a Node project?');
}
let packageJson;
try {
packageJson = JSON.parse(packageJsonContent.toString());
}
catch (e) {
(0, error_1.assertIsError)(e);
throw new schematics_1.SchematicsException('package.json could not be parsed: ' + e.message);
}
const { dependencies, devDependencies, peerDependencies } = tree.readJson('/package.json');
return [
...Object.entries(packageJson.peerDependencies || {}),
...Object.entries(packageJson.devDependencies || {}),
...Object.entries(packageJson.dependencies || {}),
...Object.entries(peerDependencies || {}),
...Object.entries(devDependencies || {}),
...Object.entries(dependencies || {}),
];
}
function _formatVersion(version) {

View file

@ -44,6 +44,7 @@ export interface Schema {
* The preferred package manager configuration files to use for registry settings.
*/
export declare enum PackageManager {
Bun = "bun",
Cnpm = "cnpm",
Npm = "npm",
Pnpm = "pnpm",

View file

@ -8,6 +8,7 @@ exports.PackageManager = void 0;
*/
var PackageManager;
(function (PackageManager) {
PackageManager["Bun"] = "bun";
PackageManager["Cnpm"] = "cnpm";
PackageManager["Npm"] = "npm";
PackageManager["Pnpm"] = "pnpm";

View file

@ -57,7 +57,7 @@
"description": "The preferred package manager configuration files to use for registry settings.",
"type": "string",
"default": "npm",
"enum": ["npm", "yarn", "cnpm", "pnpm"]
"enum": ["npm", "yarn", "cnpm", "pnpm", "bun"]
}
},
"required": []

View file

@ -89,7 +89,7 @@ Appended \`source <(ng completion script)\` to \`${rcFile}\`. Restart your termi
' Angular CLI. For autocompletion to work, the CLI will need to be on your `$PATH`, which' +
' is typically done with the `-g` flag in `npm install -g @angular/cli`.' +
'\n\n' +
'For more information, see https://angular.io/cli/completion#global-install');
'For more information, see https://angular.dev/cli/completion#global-install');
}
// Save configuration to remember that the user was prompted.
await setCompletionConfig({ ...completionConfig, prompted: true });

View file

@ -113,6 +113,14 @@ class PackageManagerUtils {
prefix: '--prefix',
noLockfile: '--no-lockfile',
};
case workspace_schema_1.PackageManager.Bun:
return {
saveDev: '--development',
install: 'add',
installAll: 'install',
prefix: '--cwd',
noLockfile: '',
};
default:
return {
saveDev: '--save-dev',
@ -175,12 +183,13 @@ class PackageManagerUtils {
const hasNpmLock = this.hasLockfile(workspace_schema_1.PackageManager.Npm);
const hasYarnLock = this.hasLockfile(workspace_schema_1.PackageManager.Yarn);
const hasPnpmLock = this.hasLockfile(workspace_schema_1.PackageManager.Pnpm);
const hasBunLock = this.hasLockfile(workspace_schema_1.PackageManager.Bun);
// PERF NOTE: `this.getVersion` spawns the package a the child_process which can take around ~300ms at times.
// Therefore, we should only call this method when needed. IE: don't call `this.getVersion(PackageManager.Pnpm)` unless truly needed.
// The result of this method is not stored in a variable because it's memoized.
if (hasNpmLock) {
// Has NPM lock file.
if (!hasYarnLock && !hasPnpmLock && this.getVersion(workspace_schema_1.PackageManager.Npm)) {
if (!hasYarnLock && !hasPnpmLock && !hasBunLock && this.getVersion(workspace_schema_1.PackageManager.Npm)) {
// Only NPM lock file and NPM binary is available.
return workspace_schema_1.PackageManager.Npm;
}
@ -195,17 +204,25 @@ class PackageManagerUtils {
// PNPM lock file and PNPM binary is available.
return workspace_schema_1.PackageManager.Pnpm;
}
else if (hasBunLock && this.getVersion(workspace_schema_1.PackageManager.Bun)) {
// Bun lock file and Bun binary is available.
return workspace_schema_1.PackageManager.Bun;
}
}
if (!this.getVersion(workspace_schema_1.PackageManager.Npm)) {
// Doesn't have NPM installed.
const hasYarn = !!this.getVersion(workspace_schema_1.PackageManager.Yarn);
const hasPnpm = !!this.getVersion(workspace_schema_1.PackageManager.Pnpm);
if (hasYarn && !hasPnpm) {
const hasBun = !!this.getVersion(workspace_schema_1.PackageManager.Bun);
if (hasYarn && !hasPnpm && !hasBun) {
return workspace_schema_1.PackageManager.Yarn;
}
else if (!hasYarn && hasPnpm) {
else if (hasPnpm && !hasYarn && !hasBun) {
return workspace_schema_1.PackageManager.Pnpm;
}
else if (hasBun && !hasYarn && !hasPnpm) {
return workspace_schema_1.PackageManager.Bun;
}
}
// TODO: This should eventually inform the user of ambiguous package manager usage.
// Potentially with a prompt to choose and optionally set as the default.
@ -220,6 +237,9 @@ class PackageManagerUtils {
case workspace_schema_1.PackageManager.Pnpm:
lockfileName = 'pnpm-lock.yaml';
break;
case workspace_schema_1.PackageManager.Bun:
lockfileName = 'bun.lockb';
break;
case workspace_schema_1.PackageManager.Npm:
default:
lockfileName = 'package-lock.json';

View file

@ -25,5 +25,5 @@ class Version {
}
}
// TODO(bazel): Convert this to use build-time version stamping after flipping the build script to use bazel
// export const VERSION = new Version('17.1.3');
// export const VERSION = new Version('17.3.8');
exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);