Skip to content

Commit 7d736d1

Browse files
Brooooooklynclaude
andcommitted
Initial commit: oxc Angular compiler
Standalone Angular compiler built on oxc crates from crates.io v0.110.0 Includes: - crates/oxc_angular_compiler: Core Angular template compiler - napi/angular-compiler: Node.js bindings (@oxc/vite-plugin-angular) - tasks/angular_conformance: Conformance test runner Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 parents  commit 7d736d1

File tree

655 files changed

+295221
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

655 files changed

+295221
-0
lines changed

.cargo/config.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[alias]
2+
# Do not append `--` or it will break IDEs
3+
ck = "check --all-features --all-targets --locked"
4+
lint = "clippy --all-targets --all-features"
5+
# Skip `tasks/website` due to linker errors with `oxlint`
6+
codecov = "llvm-cov --workspace --ignore-filename-regex tasks --exclude website"
7+
coverage = "run -p oxc_coverage --profile coverage --"
8+
benchmark = "bench -p oxc_benchmark"
9+
minsize = "run -p oxc_minsize --profile coverage --"
10+
allocs = "run -p oxc_track_memory_allocations --profile coverage --"
11+
rule = "run -p rulegen"
12+
lintgen = "run -p oxc_linter_codegen"
13+
14+
[target.x86_64-pc-windows-msvc]
15+
rustflags = ["-C", "target-feature=+crt-static"]
16+
17+
[target.i686-pc-windows-msvc]
18+
rustflags = ["-C", "target-feature=+crt-static"]
19+
20+
[target.aarch64-pc-windows-msvc]
21+
rustflags = ["-C", "target-feature=+crt-static"]
22+
23+
[target.'cfg(target_os = "windows")']
24+
rustflags = [
25+
# Disables linking against the default Universal C Runtime (libucrt.lib). This prevents conflicts if another CRT library is linked manually.
26+
"-C",
27+
"link-args=/NODEFAULTLIB:libucrt.lib",
28+
# Manually adds ucrt.lib (the Universal CRT) as a default library to link against, replacing the one you just excluded above.
29+
# This ensures consistent linking when multiple CRTs might be available.
30+
"-C",
31+
"link-args=/DEFAULTLIB:ucrt.lib",
32+
]
33+
34+
# LLD linker is currently broken for us, opt out.
35+
# https://blog.rust-lang.org/2025/09/18/Rust-1.90.0/#what-s-in-1-90-0-stable
36+
[target.x86_64-unknown-linux-gnu]
37+
rustflags = ["-C", "linker-features=-lld"]

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# https://EditorConfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
12+
[*.rs]
13+
indent_size = 4

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
crates/oxc_formatter/tests/fixtures/** text=auto eol=lf
2+
crates/oxc_formatter/tests/fixtures/js/crlf text=auto eol=crlf
3+
apps/oxfmt/test/**/fixtures/** text=auto eol=lf
4+
apps/oxlint/test/fixtures/** text=auto eol=lf

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test:
17+
name: Test
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
with:
22+
submodules: recursive
23+
24+
- name: Install Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
27+
- name: Cache Rust
28+
uses: Swatinem/rust-cache@v2
29+
30+
- name: Check
31+
run: cargo check --all-features
32+
33+
- name: Test
34+
run: cargo test
35+
36+
- name: Conformance
37+
run: |
38+
cargo run -p oxc_angular_conformance
39+
git diff --exit-code
40+
41+
- name: Format
42+
run: cargo fmt --all -- --check
43+
44+
napi:
45+
name: NAPI Build
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v6
49+
with:
50+
submodules: recursive
51+
52+
- name: Install Rust
53+
uses: dtolnay/rust-toolchain@stable
54+
55+
- name: Cache Rust
56+
uses: Swatinem/rust-cache@v2
57+
58+
- name: Install pnpm
59+
uses: pnpm/action-setup@v4
60+
61+
- name: Install Node.js
62+
uses: actions/setup-node@v6
63+
with:
64+
node-version: 24
65+
cache: pnpm
66+
67+
- name: Install dependencies
68+
run: pnpm install
69+
70+
- name: Build NAPI
71+
run: pnpm build-dev
72+
73+
- name: Test NAPI
74+
run: pnpm test

.github/workflows/release.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
name: Build - ${{ matrix.target }}
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- target: x86_64-unknown-linux-gnu
25+
os: ubuntu-latest
26+
- target: aarch64-unknown-linux-gnu
27+
os: ubuntu-latest
28+
- target: x86_64-apple-darwin
29+
os: macos-latest
30+
- target: aarch64-apple-darwin
31+
os: macos-latest
32+
- target: x86_64-pc-windows-msvc
33+
os: windows-latest
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
submodules: recursive
39+
40+
- name: Install Rust
41+
uses: dtolnay/rust-toolchain@stable
42+
with:
43+
targets: ${{ matrix.target }}
44+
45+
- name: Cache Rust
46+
uses: Swatinem/rust-cache@v2
47+
48+
- name: Install pnpm
49+
uses: pnpm/action-setup@v4
50+
51+
- name: Install Node.js
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 24
55+
cache: pnpm
56+
57+
- name: Install dependencies
58+
run: pnpm install
59+
60+
- name: Build NAPI
61+
working-directory: napi/angular-compiler
62+
run: pnpm build -- --target ${{ matrix.target }}
63+
64+
- name: Upload artifact
65+
uses: actions/upload-artifact@v6
66+
with:
67+
name: bindings-${{ matrix.target }}
68+
path: napi/angular-compiler/*.node
69+
if-no-files-found: error
70+
71+
publish:
72+
name: Publish
73+
runs-on: ubuntu-latest
74+
needs: build
75+
steps:
76+
- uses: actions/checkout@v4
77+
78+
- name: Install pnpm
79+
uses: pnpm/action-setup@v4
80+
81+
- name: Install Node.js
82+
uses: actions/setup-node@v6
83+
with:
84+
node-version: 24
85+
cache: pnpm
86+
registry-url: https://registry.npmjs.org
87+
88+
- name: Install dependencies
89+
run: pnpm install
90+
91+
- name: Download artifacts
92+
uses: actions/download-artifact@v7
93+
with:
94+
path: napi/angular-compiler
95+
96+
- name: Move artifacts
97+
run: |
98+
cd napi/angular-compiler
99+
for dir in bindings-*; do
100+
mv "$dir"/*.node . || true
101+
done
102+
rm -rf bindings-*
103+
104+
- name: Publish to npm
105+
working-directory: napi/angular-compiler
106+
run: npm publish --provenance --access public
107+
env:
108+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Rust
2+
target/
3+
**/*.rs.bk
4+
5+
# Wasm
6+
**/*.wasm
7+
8+
# node_modules
9+
/node_modules/
10+
/napi/*/node_modules/
11+
/napi/*/npm-dir
12+
13+
# Ignore accidental files from the root
14+
/*.js
15+
/*.jsx
16+
/*.ts
17+
/*.tsx
18+
/*.ast.txt
19+
/*.cfg.txt
20+
/*.dot
21+
*.node
22+
23+
# Claude Code
24+
.claude
25+
26+
# NOTE: For non-project files such as `.vscode` or `.idea`, please add them to your `.gitignore_global`.
27+
# In `.gitconfig`, add `[core] excludesfile = ~/.gitignore_global`

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "crates/oxc_angular_compiler/angular"]
2+
path = crates/oxc_angular_compiler/angular
3+
url = https://github.com/angular/angular.git

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24.12.0

.oxfmtrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": ["/crates/oxc_angular_compiler/angular"],
4+
"singleQuote": true,
5+
"experimentalSortPackageJson": true,
6+
"experimentalSortImports": {
7+
"order": "asc",
8+
"newlinesBetween": true,
9+
"groups": [
10+
["type-import"],
11+
["type-builtin", "value-builtin"],
12+
["type-external", "value-external", "type-internal", "value-internal"],
13+
["type-parent", "type-sibling", "type-index", "value-parent", "value-sibling", "value-index"],
14+
["ts-equals-import"],
15+
["unknown"]
16+
]
17+
},
18+
"trailingComma": "all",
19+
"semi": false
20+
}

.rustfmt.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
style_edition = "2024"
2+
# Make Rust more readable given most people have wide screens nowadays.
3+
# This is also the setting used by [rustc](https://github.com/rust-lang/rust/blob/master/rustfmt.toml)
4+
use_small_heuristics = "Max"
5+
6+
# Use field initialize shorthand if possible
7+
use_field_init_shorthand = true
8+
9+
reorder_modules = true
10+
11+
# All unstable features that we wish for
12+
# unstable_features = true
13+
# Provide a cleaner impl order
14+
# reorder_impl_items = true
15+
# Provide a cleaner import sort order
16+
# group_imports = "StdExternalCrate"
17+
# Group "use" statements by crate
18+
# imports_granularity = "Crate"

0 commit comments

Comments
 (0)