Skip to content

Commit

Permalink
feat: use rspack for angular
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Jun 7, 2023
1 parent f3493f5 commit 04285fd
Show file tree
Hide file tree
Showing 344 changed files with 27,276 additions and 192 deletions.
2 changes: 1 addition & 1 deletion apps/products/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"prefix": "nx-example",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"executor": "@angular-devkit/build-angular:browser-rspack",
"options": {
"aot": true,
"outputPath": "dist/apps/products",
Expand Down
21 changes: 21 additions & 0 deletions artifacts/build-angular/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2017 Google, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions artifacts/build-angular/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# @angular-devkit/build-angular

This package contains [Architect builders](/packages/angular_devkit/architect/README.md) used to build and test Angular applications and libraries.

## Builders

| Name | Description |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| app-shell | Build an Angular [App shell](https://angular.io/guide/app-shell). |
| browser | Build an Angular application targeting a browser environment. |
| dev-server | A development server that provides live reloading. |
| extract-i18n | Extract i18n messages from an Angular application. |
| karma | Execute unit tests using [Karma](https://github.com/karma-runner/karma) test runner. |
| ng-packagr | Build and package an Angular library in [Angular Package Format (APF)](https://angular.io/guide/angular-package-format) format using [ng-packagr](https://github.com/ng-packagr/ng-packagr). |
| server | Build an Angular application targeting a [Node.js](https://nodejs.org) environment. |
| protractor | **Deprecated** - Run end-to-end tests using [Protractor](https://www.protractortest.org/) framework. |

## Disclaimer

While the builders when executed via the Angular CLI and their associated options are considered stable, the programmatic APIs are not considered officially supported and are not subject to the breaking change guarantees of SemVer.
60 changes: 60 additions & 0 deletions artifacts/build-angular/builders.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "../architect/src/builders-schema.json",
"builders": {
"app-shell": {
"implementation": "./src/builders/app-shell",
"schema": "./src/builders/app-shell/schema.json",
"description": "Build a server application and a browser application, then render the index.html and use it for the browser output."
},
"browser": {
"implementation": "./src/builders/browser",
"schema": "./src/builders/browser/schema.json",
"description": "Build a browser application."
},
"browser-rspack": {
"implementation": "./src/builders/browser-rspack",
"schema": "./src/builders/browser-rspack/schema.json",
"description": "Build a browser application."
},
"browser-esbuild": {
"implementation": "./src/builders/browser-esbuild",
"schema": "./src/builders/browser-esbuild/schema.json",
"description": "Build a browser application."
},
"dev-server": {
"implementation": "./src/builders/dev-server",
"schema": "./src/builders/dev-server/schema.json",
"description": "Serve a browser application."
},
"extract-i18n": {
"implementation": "./src/builders/extract-i18n",
"schema": "./src/builders/extract-i18n/schema.json",
"description": "Extract i18n strings from a browser application."
},
"jest": {
"implementation": "./src/builders/jest",
"schema": "./src/builders/jest/schema.json",
"description": "Run unit tests using Jest."
},
"karma": {
"implementation": "./src/builders/karma",
"schema": "./src/builders/karma/schema.json",
"description": "Run Karma unit tests."
},
"protractor": {
"implementation": "./src/builders/protractor",
"schema": "./src/builders/protractor/schema.json",
"description": "Run protractor over a dev server."
},
"server": {
"implementation": "./src/builders/server",
"schema": "./src/builders/server/schema.json",
"description": "Build a server Angular application."
},
"ng-packagr": {
"implementation": "./src/builders/ng-packagr",
"schema": "./src/builders/ng-packagr/schema.json",
"description": "Build a library with ng-packagr."
}
}
}
142 changes: 142 additions & 0 deletions artifacts/build-angular/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"name": "@angular-devkit/build-angular",
"version": "16.0.0-next.0",
"description": "Angular Webpack Build Facade",
"main": "src/index.js",
"typings": "src/index.d.ts",
"builders": "builders.json",
"dependencies": {
"@ampproject/remapping": "2.2.1",
"@angular-devkit/architect": "0.1600.0-next.0",
"@angular-devkit/build-webpack": "0.1600.0-next.0",
"@angular-devkit/core": "16.0.0-next.0",
"@babel/core": "7.21.8",
"@babel/generator": "7.21.5",
"@babel/helper-annotate-as-pure": "7.18.6",
"@babel/helper-split-export-declaration": "7.18.6",
"@babel/plugin-proposal-async-generator-functions": "7.20.7",
"@babel/plugin-transform-async-to-generator": "7.20.7",
"@babel/plugin-transform-runtime": "7.21.4",
"@babel/preset-env": "7.21.5",
"@babel/runtime": "7.21.5",
"@babel/template": "7.20.7",
"@discoveryjs/json-ext": "0.5.7",
"@ngtools/webpack": "16.0.0-next.0",
"@vitejs/plugin-basic-ssl": "1.0.1",
"ansi-colors": "4.1.3",
"autoprefixer": "10.4.14",
"babel-loader": "9.1.2",
"babel-plugin-istanbul": "6.1.1",
"browserslist": "4.21.5",
"cacache": "17.1.0",
"chokidar": "3.5.3",
"copy-webpack-plugin": "11.0.0",
"critters": "0.0.16",
"css-loader": "6.7.3",
"esbuild-wasm": "0.17.18",
"glob": "8.1.0",
"https-proxy-agent": "5.0.1",
"inquirer": "8.2.4",
"jsonc-parser": "3.2.0",
"karma-source-map-support": "1.4.0",
"less": "4.1.3",
"less-loader": "11.1.0",
"license-webpack-plugin": "4.0.2",
"loader-utils": "3.2.1",
"magic-string": "0.30.0",
"mini-css-extract-plugin": "2.7.5",
"mrmime": "1.0.1",
"open": "8.4.2",
"ora": "5.4.1",
"parse5-html-rewriting-stream": "7.0.0",
"piscina": "3.2.0",
"postcss": "8.4.23",
"postcss-loader": "7.3.0",
"resolve-url-loader": "5.0.0",
"rxjs": "7.8.1",
"sass": "1.62.1",
"sass-loader": "13.2.2",
"semver": "7.5.0",
"source-map-loader": "4.0.1",
"source-map-support": "0.5.21",
"terser": "5.17.1",
"text-table": "0.2.0",
"tree-kill": "1.2.2",
"tslib": "2.5.0",
"vite": "4.3.4",
"webpack": "5.82.0",
"webpack-dev-middleware": "6.1.0",
"webpack-dev-server": "4.13.3",
"webpack-merge": "5.8.0",
"webpack-subresource-integrity": "5.1.0",
"@rspack/cli": "^0.1.10",
"@rspack/core": "^0.1.10"
},
"optionalDependencies": {
"esbuild": "0.17.18"
},
"peerDependencies": {
"@angular/compiler-cli": "^16.0.0 || ^16.1.0-next.0",
"@angular/localize": "^16.0.0 || ^16.1.0-next.0",
"@angular/platform-server": "^16.0.0 || ^16.1.0-next.0",
"@angular/service-worker": "^16.0.0 || ^16.1.0-next.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"karma": "^6.3.0",
"ng-packagr": "^16.0.0 || ^16.1.0-next.0",
"protractor": "^7.0.0",
"tailwindcss": "^2.0.0 || ^3.0.0",
"typescript": ">=4.9.3 <5.1"
},
"peerDependenciesMeta": {
"@angular/localize": {
"optional": true
},
"@angular/platform-server": {
"optional": true
},
"@angular/service-worker": {
"optional": true
},
"jest": {
"optional": true
},
"jest-environment-jsdom": {
"optional": true
},
"karma": {
"optional": true
},
"ng-packagr": {
"optional": true
},
"protractor": {
"optional": true
},
"tailwindcss": {
"optional": true
}
},
"keywords": [
"Angular CLI",
"Angular DevKit",
"angular",
"devkit",
"sdk"
],
"repository": {
"type": "git",
"url": "https://github.com/angular/angular-cli.git"
},
"engines": {
"node": "^16.14.0 || >=18.10.0",
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
"yarn": ">= 1.13.0"
},
"author": "Angular Authors",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular-cli/issues"
},
"homepage": "https://github.com/angular/angular-cli"
}
7 changes: 7 additions & 0 deletions artifacts/build-angular/plugins/karma.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @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.io/license
*/
10 changes: 10 additions & 0 deletions artifacts/build-angular/plugins/karma.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions artifacts/build-angular/src/babel-bazel.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @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.io/license
*/

/* eslint-disable import/no-extraneous-dependencies */
// Workaround for https://github.com/bazelbuild/rules_nodejs/issues/1033
// Alternative approach instead of https://github.com/angular/angular/pull/33226
declare module '@babel/core' {
export * from '@types/babel__core';
}
declare module '@babel/generator' {
export { default } from '@types/babel__generator';
}
declare module '@babel/traverse' {
export { default } from '@types/babel__traverse';
}
declare module '@babel/template' {
export { default } from '@types/babel__template';
}
34 changes: 34 additions & 0 deletions artifacts/build-angular/src/babel/babel-loader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @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.io/license
*/

declare module 'babel-loader' {
type BabelLoaderCustomizer<T> = (babel: typeof import('@babel/core')) => {
customOptions?(
this: import('webpack').loader.LoaderContext,
loaderOptions: Record<string, unknown>,
loaderArguments: { source: string; map?: unknown },
): Promise<{ custom?: T; loader: Record<string, unknown> }>;
config?(
this: import('webpack').loader.LoaderContext,
configuration: import('@babel/core').PartialConfig,
loaderArguments: { source: string; map?: unknown; customOptions: T },
): import('@babel/core').TransformOptions;
result?(
this: import('webpack').loader.LoaderContext,
result: import('@babel/core').BabelFileResult,
context: {
source: string;
map?: unknown;
customOptions: T;
configuration: import('@babel/core').PartialConfig;
options: import('@babel/core').TransformOptions;
},
): import('@babel/core').BabelFileResult;
};
function custom<T>(customizer: BabelLoaderCustomizer<T>): import('webpack').loader.Loader;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @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.io/license
*/
import { PluginObj } from '@babel/core';
/**
* Provides one or more keywords that if found within the content of a source file indicate
* that this plugin should be used with a source file.
*
* @returns An a string iterable containing one or more keywords.
*/
export declare function getKeywords(): Iterable<string>;
/**
* A babel plugin factory function for adjusting classes; primarily with Angular metadata.
* The adjustments include wrapping classes with known safe or no side effects with pure
* annotations to support dead code removal of unused classes. Angular compiler generated
* metadata static fields not required in AOT mode are also elided to better support bundler-
* level treeshaking.
*
* @returns A babel plugin object instance.
*/
export default function (): PluginObj;

0 comments on commit 04285fd

Please sign in to comment.