Skip to content

Commit 09a51bd

Browse files
authored
feat(swc-angular): ✨ rename swc-angular packages (#324)
1 parent 2a1bc62 commit 09a51bd

Some content is hidden

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

70 files changed

+235
-213
lines changed

.github/labeler.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ rx-computed:
3838
- any-glob-to-any-file:
3939
- 'packages/rx-computed/**/*'
4040

41-
swc-angular-preset:
41+
swc-angular:
4242
- changed-files:
4343
- any-glob-to-any-file:
44-
- 'packages/swc-angular-preset/**/*'
44+
- 'packages/swc-angular/**/*'
4545

46-
swc-plugin-angular:
46+
swc-angular-plugin:
4747
- changed-files:
4848
- any-glob-to-any-file:
49-
- 'packages/swc-plugin-angular/**/*'
49+
- 'packages/swc-angular-plugin/**/*'
5050

5151
test:
5252
- changed-files:

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
22
resolver = '2'
33
members = [
4-
'packages/swc-plugin-angular',
4+
'packages/swc-angular-plugin',
55
]

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ This is the home of the following tools which aim to:
88

99
⚡️ Optimize performance
1010

11-
| Package | Description | Version |
12-
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
13-
| [@jscutlery/cypress-harness](./packages/cypress-harness) | Cypress support for Angular Component Test Harnesses. | <img src="https://badgen.net/npm/v/@jscutlery/cypress-harness"> |
14-
| [@jscutlery/microwave](./packages/microwave) | Optimize Angular change detection effortlessly. | <img src="https://badgen.net/npm/v/@jscutlery/microwave"> |
15-
| [@jscutlery/operators](./packages/operators) | Set of operators for RxJS like `suspensify`. | <img src="https://badgen.net/npm/v/@jscutlery/operators"> |
16-
| [@jscutlery/playwright-ct-angular](./packages/playwright-ct-angular) | Playwright Component Testing support for Angular. | <img src="https://badgen.net/npm/v/@jscutlery/playwright-ct-angular"> |
17-
| [@jscutlery/rx-computed](./packages/rx-computed) | `rxComputed()`, the async RxJS-based version of signals' `computed()`. | <img src="https://badgen.net/npm/v/@jscutlery/rx-computed"> |
18-
| [@jscutlery/swc-angular-preset](./packages/swc-angular-preset) | SWC preset for testing Angular projects with Jest. | <img src="https://badgen.net/npm/v/@jscutlery/swc-angular-preset"> |
19-
| [@jscutlery/swc-plugin-angular](./packages/swc-plugin-angular) | SWC plugin internally used by `@jscutlery/swc-angular-preset` to compile Angular projects. | <img src="https://badgen.net/npm/v/@jscutlery/swc-plugin-angular"> |
11+
| Package | Description | Version |
12+
|----------------------------------------------------------------------|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
13+
| [@jscutlery/cypress-harness](./packages/cypress-harness) | Cypress support for Angular Component Test Harnesses. | <img src="https://badgen.net/npm/v/@jscutlery/cypress-harness"> |
14+
| [@jscutlery/microwave](./packages/microwave) | Optimize Angular change detection effortlessly. | <img src="https://badgen.net/npm/v/@jscutlery/microwave"> |
15+
| [@jscutlery/operators](./packages/operators) | Set of operators for RxJS like `suspensify`. | <img src="https://badgen.net/npm/v/@jscutlery/operators"> |
16+
| [@jscutlery/playwright-ct-angular](./packages/playwright-ct-angular) | Playwright Component Testing support for Angular. | <img src="https://badgen.net/npm/v/@jscutlery/playwright-ct-angular"> |
17+
| [@jscutlery/rx-computed](./packages/rx-computed) | `rxComputed()`, the async RxJS-based version of signals' `computed()`. | <img src="https://badgen.net/npm/v/@jscutlery/rx-computed"> |
18+
| [@jscutlery/swc-angular](./packages/swc-angular) | SWC preset for testing Angular projects with Jest. | <img src="https://badgen.net/npm/v/@jscutlery/swc-angular"> |
19+
| [@jscutlery/swc-angular-plugin](./packages/swc-angular-plugin) | SWC plugin internally used by `@jscutlery/swc-angular` to compile Angular projects. | <img src="https://badgen.net/npm/v/@jscutlery/swc-angular-plugin"> |
2020

2121
# License
2222

nx.json

+63-22
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,28 @@
2828
},
2929
"targetDefaults": {
3030
"build": {
31-
"dependsOn": ["^build"],
32-
"inputs": ["production", "^production"],
31+
"dependsOn": [
32+
"^build"
33+
],
34+
"inputs": [
35+
"production",
36+
"^production"
37+
],
3338
"cache": true
3439
},
3540
"e2e": {
36-
"inputs": ["default", "^production"],
41+
"inputs": [
42+
"default",
43+
"^production"
44+
],
3745
"cache": true
3846
},
3947
"@nx/jest:jest": {
40-
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
48+
"inputs": [
49+
"default",
50+
"^production",
51+
"{workspaceRoot}/jest.preset.js"
52+
],
4153
"cache": true,
4254
"options": {
4355
"passWithNoTests": true
@@ -50,27 +62,43 @@
5062
}
5163
},
5264
"@nx/eslint:lint": {
53-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
65+
"inputs": [
66+
"default",
67+
"{workspaceRoot}/.eslintrc.json"
68+
],
5469
"cache": true
5570
},
5671
"@nx/rollup:rollup": {
5772
"cache": true,
58-
"dependsOn": ["^build"],
59-
"inputs": ["production", "^production"]
73+
"dependsOn": [
74+
"^build"
75+
],
76+
"inputs": [
77+
"production",
78+
"^production"
79+
]
6080
},
6181
"@nx/vite:test": {
6282
"cache": true,
63-
"inputs": ["default", "^production"]
83+
"inputs": [
84+
"default",
85+
"^production"
86+
]
6487
},
6588
"@nx/js:release-publish": {
66-
"dependsOn": ["build"],
89+
"dependsOn": [
90+
"build"
91+
],
6792
"options": {
6893
"packageRoot": "dist/{projectRoot}"
6994
}
7095
}
7196
},
7297
"namedInputs": {
73-
"default": ["{projectRoot}/**/*", "sharedGlobals"],
98+
"default": [
99+
"{projectRoot}/**/*",
100+
"sharedGlobals"
101+
],
74102
"sharedGlobals": [
75103
"{workspaceRoot}/workspace.json",
76104
"{workspaceRoot}/tsconfig.base.json",
@@ -94,17 +122,26 @@
94122
"useInferencePlugins": false,
95123
"defaultBase": "main",
96124
"release": {
125+
"groups": {
126+
"default": {
127+
"projects": [
128+
"cypress-harness",
129+
"microwave",
130+
"operators",
131+
"playwright-ct-angular",
132+
"rx-computed"
133+
],
134+
"projectsRelationship": "independent"
135+
},
136+
"swc-angular": {
137+
"projects": [
138+
"swc-angular",
139+
"swc-angular-plugin"
140+
],
141+
"projectsRelationship": "fixed"
142+
}
143+
},
97144
"releaseTagPattern": "{projectName}-{version}",
98-
"projects": [
99-
"cypress-harness",
100-
"microwave",
101-
"operators",
102-
"playwright-ct-angular",
103-
"rx-computed",
104-
"swc-plugin-angular",
105-
"swc-angular-preset"
106-
],
107-
"projectsRelationship": "independent",
108145
"version": {
109146
"conventionalCommits": true,
110147
"generatorOptions": {
@@ -126,8 +163,12 @@
126163
{
127164
"plugin": "@nx/vite/plugin",
128165
"_comment": "@todo: use exclude instead of include once this is fixed: https://github.com/nrwl/nx/issues/22737",
129-
"_exclude": ["tests/swc-plugin-angular-wide/**/*"],
130-
"include": ["packages/**/*"]
166+
"_exclude": [
167+
"tests/swc-angular-wide/**/*"
168+
],
169+
"include": [
170+
"packages/**/*"
171+
]
131172
}
132173
]
133174
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"publish:cypress-mount": "npm publish dist/packages/cypress-mount",
3131
"contributors:add": "all-contributors add",
3232
"prepare": "husky install",
33-
"postinstall": "ln -snf ../../dist/packages/swc-plugin-angular node_modules/@jscutlery/swc-plugin-angular"
33+
"postinstall": "ln -snf ../../dist/packages/swc-angular-plugin node_modules/@jscutlery/swc-angular-plugin"
3434
},
3535
"private": true,
3636
"dependencies": {

packages/swc-plugin-angular/Cargo.toml packages/swc-angular-plugin/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "swc-plugin-angular"
2+
name = "swc-angular-plugin"
33
version = "0.1.0"
44
edition = "2021"
55

@@ -21,4 +21,4 @@ testing = "0.35.21"
2121
[profile.release]
2222
# Disable LTO to avoid linker error when using TransformPluginProgramMetadata#get_transform_plugin_config()
2323
# Cf. https://github.com/swc-project/swc/issues/7934
24-
lto = false
24+
lto = false

packages/swc-plugin-angular/README.md packages/swc-angular-plugin/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ This means that while it is suitable for testing, it shouldn't be used to build
1616

1717
## Try it now with your Jest tests
1818

19-
Cf. [`@jscutlery/swc-angular-preset`](../swc-angular-preset/README.md)
19+
Cf. [`@jscutlery/swc-angular`](../swc-angular/README.md)

packages/swc-plugin-angular/package.json packages/swc-angular-plugin/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@jscutlery/swc-plugin-angular",
2+
"name": "@jscutlery/swc-angular-plugin",
33
"version": "0.11.0",
44
"repository": {
55
"url": "https://github.com/jscutlery/devkit"
@@ -10,7 +10,7 @@
1010
"Plugin",
1111
"Testing"
1212
],
13-
"main": "wasm32-wasi/release/swc_plugin_angular.wasm",
13+
"main": "wasm32-wasi/release/swc_angular_plugin.wasm",
1414
"files": [],
1515
"preferUnplugged": true
1616
}

packages/swc-plugin-angular/project.json packages/swc-angular-plugin/project.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3-
"name": "swc-plugin-angular",
3+
"name": "swc-angular-plugin",
44
"projectType": "library",
5-
"sourceRoot": "packages/swc-plugin-angular/src",
5+
"sourceRoot": "packages/swc-angular-plugin/src",
66
"targets": {
77
"build": {
88
"executor": "nx:run-commands",
@@ -21,7 +21,7 @@
2121
"{options.target-dir}"
2222
],
2323
"options": {
24-
"target-dir": "dist/packages/swc-plugin-angular"
24+
"target-dir": "dist/packages/swc-angular-plugin"
2525
},
2626
"configurations": {
2727
"production": {
@@ -35,7 +35,7 @@
3535
"{options.target-dir}"
3636
],
3737
"options": {
38-
"target-dir": "dist/packages/swc-plugin-angular"
38+
"target-dir": "dist/packages/swc-angular-plugin"
3939
}
4040
},
4141
"nx-release-publish": {

packages/swc-plugin-angular/src/lib.rs packages/swc-angular-plugin/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod testing;
2323
pub fn process_transform(program: Program, metadata: TransformPluginProgramMetadata) -> Program {
2424
let config: Option<Value> = metadata.get_transform_plugin_config().map(|config_str| {
2525
serde_json::from_str(config_str.as_str())
26-
.expect("Invalid @jscutlery/swc-plugin-angular config")
26+
.expect("Invalid @jscutlery/swc-angular-plugin config")
2727
});
2828
let template_raw_suffix = config
2929
.and_then(|value| value["templateRawSuffix"].as_bool())

packages/swc-angular-preset/.eslintrc.json packages/swc-angular/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"{projectRoot}/{vite,vitest}.config.{js,ts,mjs,mts}"
2727
],
2828
"ignoredDependencies": [
29-
"@jscutlery/swc-plugin-angular",
29+
"@jscutlery/swc-angular-plugin",
3030
"@swc/core"
3131
]
3232
}
File renamed without changes.
File renamed without changes.

packages/swc-angular-preset/README.md packages/swc-angular/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This is where SWC (Speedy Web Compiler) comes in. SWC is a JavaScript/TypeScript
1616
fast.
1717

1818
This package enables you to use SWC with Angular projects by setting the right configuration for SWC and using
19-
our Angular plugin for SWC [`@jscutlery/swc-plugin-angular`](../swc-plugin-angular)
19+
our Angular plugin for SWC [`@jscutlery/swc-angular-plugin`](../swc-angular-plugin)
2020

2121
## 🥇 Benchmark
2222

@@ -33,7 +33,7 @@ our Angular plugin for SWC [`@jscutlery/swc-plugin-angular`](../swc-plugin-angul
3333
Install this preset and its dependencies via npm:
3434

3535
```sh
36-
npm install -D @jscutlery/swc-angular-preset @jscutlery/swc-plugin-angular @swc/core @swc/jest
36+
npm install -D @jscutlery/swc-angular @jscutlery/swc-angular-plugin @swc/core @swc/jest
3737
grep .swc .gitignore || echo .swc >> .gitignore
3838
```
3939

@@ -43,7 +43,7 @@ In your Jest configuration file (e.g., `jest.config.ts`), use the `swcAngularJes
4343
transform `.ts`, `.js`, and `.mjs` files.
4444

4545
```js
46-
import { swcAngularJestTransformer } from '@jscutlery/swc-angular-preset';
46+
import { swcAngularJestTransformer } from '@jscutlery/swc-angular';
4747

4848
export default {
4949
// ...
@@ -79,7 +79,7 @@ import 'reflect-metadata';
7979
Install this preset and its dependencies via npm:
8080

8181
```sh
82-
npm install -D @jscutlery/swc-angular-preset @jscutlery/swc-plugin-angular @swc/core unplugin-swc
82+
npm install -D @jscutlery/swc-angular @jscutlery/swc-angular-plugin @swc/core unplugin-swc
8383
grep .swc .gitignore || echo .swc >> .gitignore
8484
```
8585

@@ -89,7 +89,7 @@ In your vite configuration file (e.g., `vite.config.ts`), use the `unplugin-swc`
8989
preset: `swcAngularVitePreset`.
9090

9191
```js
92-
import { swcAngularUnpluginOptions } from '@jscutlery/swc-angular-preset';
92+
import { swcAngularUnpluginOptions } from '@jscutlery/swc-angular';
9393
import swc from 'unplugin-swc';
9494
import { defineConfig } from 'vite';
9595

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@jscutlery/swc-angular-preset",
3-
"version": "0.3.0",
2+
"name": "@jscutlery/swc-angular",
3+
"version": "0.11.0",
44
"repository": {
55
"url": "https://github.com/jscutlery/devkit"
66
},
@@ -11,7 +11,7 @@
1111
"Testing"
1212
],
1313
"peerDependencies": {
14-
"@jscutlery/swc-plugin-angular": ">=0.11.0 <1.0.0",
14+
"@jscutlery/swc-angular-plugin": ">=0.11.0 <1.0.0",
1515
"@swc/core": "~1.4.0"
1616
}
1717
}

packages/swc-angular-preset/project.json packages/swc-angular/project.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "swc-angular-preset",
2+
"name": "swc-angular",
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4-
"sourceRoot": "packages/swc-angular-preset/src",
4+
"sourceRoot": "packages/swc-angular/src",
55
"implicitDependencies": [
6-
"swc-plugin-angular"
6+
"swc-angular-plugin"
77
],
88
"projectType": "library",
99
"tags": [],
@@ -14,9 +14,9 @@
1414
"{options.outputPath}"
1515
],
1616
"options": {
17-
"outputPath": "dist/packages/swc-angular-preset",
18-
"main": "packages/swc-angular-preset/src/index.ts",
19-
"tsConfig": "packages/swc-angular-preset/tsconfig.lib.json",
17+
"outputPath": "dist/packages/swc-angular",
18+
"main": "packages/swc-angular/src/index.ts",
19+
"tsConfig": "packages/swc-angular/tsconfig.lib.json",
2020
"assets": [
2121
{
2222
"glob": "LICENSE",
@@ -25,11 +25,11 @@
2525
},
2626
{
2727
"glob": "*.md",
28-
"input": "packages/swc-angular-preset",
28+
"input": "packages/swc-angular",
2929
"output": "."
3030
}
3131
],
32-
"project": "packages/swc-angular-preset/package.json",
32+
"project": "packages/swc-angular/package.json",
3333
"compiler": "swc",
3434
"format": [
3535
"cjs",

0 commit comments

Comments
 (0)