Skip to content

Commit c2c512d

Browse files
userquinzyyv
andauthored
test: add additional attw test for built packages (#4322)
Co-authored-by: Chris <[email protected]>
1 parent aafa343 commit c2c512d

File tree

41 files changed

+288
-35
lines changed

Some content is hidden

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

41 files changed

+288
-35
lines changed

.attw-esm-only.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ignoreRules": [
3+
"cjs-resolves-to-esm"
4+
]
5+
}

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ jobs:
5959

6060
- name: Typecheck
6161
run: nr typecheck
62+
63+
- name: Check types
64+
run: nr test:attw

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
"test": "vitest",
2525
"test:update": "vitest -u",
2626
"test:integration": "pnpm -F svelte-scoped test:integration",
27-
"test:ci": "nr build && nr typecheck && nr lint && nr test && nr test:integration"
27+
"test:ci": "nr build && nr typecheck && nr lint && nr test && nr test:integration",
28+
"test:attw": "pnpm --filter=./packages/* --filter=!cli --filter=!reset --filter=!shared-* --filter=!vscode test:attw"
2829
},
2930
"devDependencies": {
3031
"@antfu/eslint-config": "catalog:",
3132
"@antfu/ni": "catalog:",
33+
"@arethetypeswrong/cli": "catalog:",
3234
"@codemirror/lang-css": "catalog:",
3335
"@codemirror/lang-html": "catalog:",
3436
"@codemirror/lang-javascript": "catalog:",
@@ -141,6 +143,9 @@
141143
"object.assign": "npm:@nolyfill/object.assign@^1.0.28",
142144
"side-channel": "npm:@nolyfill/side-channel@^1.0.29",
143145
"which-typed-array": "npm:@nolyfill/which-typed-array@^1.0.29"
146+
},
147+
"patchedDependencies": {
148+
"@arethetypeswrong/[email protected]": "patches/@[email protected]"
144149
}
145150
},
146151
"resolutions": {

packages/astro/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
],
3939
"scripts": {
4040
"build": "unbuild",
41-
"stub": "unbuild --stub"
41+
"stub": "unbuild --stub",
42+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
4243
},
4344
"peerDependencies": {
4445
"vite": "^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0"

packages/autocomplete/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"fzf": "catalog:",

packages/config/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
},
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*",

packages/core/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
],
3939
"scripts": {
4040
"build": "unbuild",
41-
"stub": "unbuild --stub"
41+
"stub": "unbuild --stub",
42+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
4243
},
4344
"devDependencies": {
4445
"magic-string": "catalog:",

packages/eslint-config/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
},
5050
"scripts": {
5151
"build": "unbuild",
52-
"stub": "unbuild --stub"
52+
"stub": "unbuild --stub",
53+
"test:attw": "attw --pack"
5354
},
5455
"dependencies": {
5556
"@unocss/eslint-plugin": "workspace:*"

packages/eslint-plugin/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"scripts": {
3838
"build": "unbuild",
3939
"typecheck": "tsc --noEmit",
40-
"lint": "nr build && cd ./fixtures && eslint ./src"
40+
"lint": "nr build && cd ./fixtures && eslint ./src",
41+
"test:attw": "attw --pack"
4142
},
4243
"dependencies": {
4344
"@typescript-eslint/utils": "catalog:",

packages/extractor-arbitrary-variants/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*"

packages/extractor-mdc/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"devDependencies": {
4041
"@unocss/core": "workspace:*"

packages/extractor-pug/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
],
3636
"scripts": {
3737
"build": "unbuild",
38-
"stub": "unbuild --stub"
38+
"stub": "unbuild --stub",
39+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3940
},
4041
"peerDependencies": {
4142
"pug": "^3.0.0"

packages/extractor-svelte/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"devDependencies": {
4041
"@unocss/core": "workspace:*"

packages/inspector/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"build-post": "vite build",
3939
"stub": "unbuild --stub",
4040
"dev": "nr stub && vite",
41-
"update-post": "vite build"
41+
"update-post": "vite build",
42+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
4243
},
4344
"dependencies": {
4445
"@unocss/core": "workspace:*",

packages/nuxt/.attw.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ignoreRules": [
3+
"false-esm"
4+
]
5+
}

packages/nuxt/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
],
4040
"scripts": {
4141
"build": "unbuild",
42-
"stub": "unbuild --stub"
42+
"stub": "unbuild --stub",
43+
"test:attw": "attw --pack"
4344
},
4445
"dependencies": {
4546
"@nuxt/kit": "catalog:",

packages/postcss/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
},
5353
"scripts": {
5454
"build": "unbuild",
55-
"stub": "unbuild --stub"
55+
"stub": "unbuild --stub",
56+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
5657
},
5758
"peerDependencies": {
5859
"postcss": "^8.4.21"

packages/preset-attributify/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*"

packages/preset-icons/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
],
5555
"scripts": {
5656
"build": "unbuild",
57-
"stub": "unbuild --stub"
57+
"stub": "unbuild --stub",
58+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
5859
},
5960
"dependencies": {
6061
"@iconify/utils": "catalog:",

packages/preset-legacy-compat/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
],
3434
"scripts": {
3535
"build": "unbuild",
36-
"stub": "unbuild --stub"
36+
"stub": "unbuild --stub",
37+
"test:attw": "attw --pack"
3738
},
3839
"dependencies": {
3940
"@unocss/core": "workspace:*"

packages/preset-mini/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
],
5858
"scripts": {
5959
"build": "unbuild",
60-
"stub": "unbuild --stub"
60+
"stub": "unbuild --stub",
61+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
6162
},
6263
"dependencies": {
6364
"@unocss/core": "workspace:*",

packages/preset-rem-to-px/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*"

packages/preset-tagify/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*"

packages/preset-typography/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
],
3434
"scripts": {
3535
"build": "unbuild",
36-
"stub": "unbuild --stub"
36+
"stub": "unbuild --stub",
37+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3738
},
3839
"dependencies": {
3940
"@unocss/core": "workspace:*",

packages/preset-uno/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
],
5757
"scripts": {
5858
"build": "unbuild",
59-
"stub": "unbuild --stub"
59+
"stub": "unbuild --stub",
60+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
6061
},
6162
"dependencies": {
6263
"@unocss/core": "workspace:*",

packages/preset-web-fonts/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
],
5151
"scripts": {
5252
"build": "unbuild",
53-
"stub": "unbuild --stub"
53+
"stub": "unbuild --stub",
54+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
5455
},
5556
"dependencies": {
5657
"@unocss/core": "workspace:*",

packages/preset-wind/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
],
5454
"scripts": {
5555
"build": "unbuild",
56-
"stub": "unbuild --stub"
56+
"stub": "unbuild --stub",
57+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
5758
},
5859
"dependencies": {
5960
"@unocss/core": "workspace:*",

packages/rule-utils/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
},
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:^",

packages/runtime/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"build:node": "tsup --config tsup.node-config.ts",
4141
"build:presets": "tsup src/presets/*.ts --format iife --minify --out-dir .",
4242
"watch": "tsup src/cdn/*.ts --format iife --watch src --out-dir .",
43-
"dev": "nr watch & live-server --open=/play"
43+
"dev": "nr watch & live-server --open=/play",
44+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
4445
},
4546
"dependencies": {
4647
"@unocss/core": "workspace:*",

packages/svelte-scoped/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"build": "unbuild",
5454
"stub": "unbuild --stub",
5555
"bench": "vitest bench",
56-
"test:integration": "pnpm -r --filter=\"./test/fixtures/*\" test"
56+
"test:integration": "pnpm -r --filter=\"./test/fixtures/*\" test",
57+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
5758
},
5859
"dependencies": {
5960
"@unocss/config": "workspace:*",

packages/transformer-attributify-jsx-babel/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@babel/core": "catalog:",

packages/transformer-attributify-jsx/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*"

packages/transformer-compile-class/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*"

packages/transformer-directives/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
],
3434
"scripts": {
3535
"build": "unbuild",
36-
"stub": "unbuild --stub"
36+
"stub": "unbuild --stub",
37+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3738
},
3839
"dependencies": {
3940
"@unocss/core": "workspace:*",

packages/transformer-variant-group/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
],
3535
"scripts": {
3636
"build": "unbuild",
37-
"stub": "unbuild --stub"
37+
"stub": "unbuild --stub",
38+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
3839
},
3940
"dependencies": {
4041
"@unocss/core": "workspace:*"

packages/unocss/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
},
112112
"scripts": {
113113
"build": "unbuild",
114-
"stub": "unbuild --stub"
114+
"stub": "unbuild --stub",
115+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
115116
},
116117
"peerDependencies": {
117118
"@unocss/webpack": "workspace:*",

packages/vite/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
],
4848
"scripts": {
4949
"build": "unbuild",
50-
"stub": "unbuild --stub"
50+
"stub": "unbuild --stub",
51+
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
5152
},
5253
"peerDependencies": {
5354
"vite": "^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0"

packages/webpack/package.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,21 @@
4545
"main": "./dist/index.cjs",
4646
"module": "./dist/index.mjs",
4747
"types": "./dist/index.d.ts",
48+
"typesVersions": {
49+
"*": {
50+
"*": [
51+
"./dist/*",
52+
"./*"
53+
]
54+
}
55+
},
4856
"files": [
4957
"dist"
5058
],
5159
"scripts": {
5260
"build": "unbuild",
53-
"stub": "unbuild --stub"
61+
"stub": "unbuild --stub",
62+
"test:attw": "attw --pack"
5463
},
5564
"peerDependencies": {
5665
"webpack": "^4 || ^5"

0 commit comments

Comments
 (0)