Primeiro commit do projeto Angular

This commit is contained in:
2026-03-14 20:41:55 +00:00
parent 9bebe1de72
commit 94f4f46395
22413 changed files with 3221690 additions and 0 deletions
@@ -0,0 +1,9 @@
/**
* @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
*/
import { Rule } from '@angular-devkit/schematics';
export default function (): Rule;
@@ -0,0 +1,53 @@
"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.default = default_1;
const json_file_1 = require("../../utility/json-file");
const workspace_1 = require("../../utility/workspace");
function default_1() {
return async (host) => {
const uniqueTsConfigs = new Set();
if (host.exists('tsconfig.json')) {
// Workspace level tsconfig
uniqueTsConfigs.add('tsconfig.json');
}
const workspace = await (0, workspace_1.getWorkspace)(host);
for (const [, target] of (0, workspace_1.allWorkspaceTargets)(workspace)) {
for (const [, opt] of (0, workspace_1.allTargetOptions)(target)) {
if (typeof opt?.tsConfig === 'string') {
uniqueTsConfigs.add(opt.tsConfig);
}
}
}
for (const tsConfig of uniqueTsConfigs) {
if (host.exists(tsConfig)) {
updateModuleResolution(host, tsConfig);
}
}
};
}
function updateModuleResolution(host, tsConfigPath) {
const json = new json_file_1.JSONFile(host, tsConfigPath);
const jsonPath = ['compilerOptions'];
const compilerOptions = json.get(jsonPath);
if (compilerOptions && typeof compilerOptions === 'object') {
const { moduleResolution, module } = compilerOptions;
if (typeof moduleResolution !== 'string' || moduleResolution.toLowerCase() === 'bundler') {
return;
}
if (typeof module === 'string' && module.toLowerCase() === 'preserve') {
return;
}
json.modify(jsonPath, {
...compilerOptions,
'moduleResolution': 'bundler',
});
}
}
//# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
{"version":3,"file":"migration.js","sourceRoot":"","sources":["migration.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAO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