Skip to content

Commit f7dc8bb

Browse files
committed
chore: switch fast-html test fixtures from webpack to vite
1 parent 82cbf5c commit f7dc8bb

File tree

88 files changed

+1479
-714
lines changed

Some content is hidden

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

88 files changed

+1479
-714
lines changed

package-lock.json

Lines changed: 1302 additions & 209 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@
6262
"@babel/preset-env": "^7.12.13",
6363
"@octokit/rest": "^22.0.0",
6464
"@types/lodash-es": "^4.17.4",
65-
"@types/node": "^15.0.1",
65+
"@types/node": "^22.12.0",
6666
"@typescript-eslint/eslint-plugin": "^5.0.0",
6767
"@typescript-eslint/parser": "^5.0.0",
6868
"beachball": "^2.51.0",
6969
"chalk": "^2.4.2",
70+
"concurrently": "^9.2.1",
7071
"copyfiles": "^2.4.1",
7172
"dotenv": "^6.0.0",
7273
"eslint": "^8.0.0",
@@ -80,6 +81,7 @@
8081
"rimraf": "^5.0.0",
8182
"ts-node": "^8.8.2",
8283
"typescript": "~4.7.0",
84+
"vite": "^7.1.10",
8385
"yargs": "^16.2.0"
8486
},
8587
"overrides": {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# don't ever lint node_modules
2+
node_modules
3+
# don't lint build output (make sure it's set to your correct build folder name)
4+
dist
5+
# don't lint coverage output
6+
coverage
7+
# don't lint tests
8+
*.spec.*

packages/web-components/fast-html/package.json

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,25 @@
2121
"./rules/*.yml"
2222
],
2323
"scripts": {
24-
"clean": "tsc -b --clean src",
25-
"clean:dist": "node ../../../build/clean.js dist",
26-
"build": "tsc -b src && npm run doc",
27-
"build:attribute": "webpack --config ./src/fixtures/attribute/webpack.config.js",
28-
"build:event": "webpack --config ./src/fixtures/event/webpack.config.js",
29-
"build:binding": "webpack --config ./src/fixtures/binding/webpack.config.js",
30-
"build:children": "webpack --config ./src/fixtures/children/webpack.config.js",
31-
"build:dot-syntax": "webpack --config ./src/fixtures/dot-syntax/webpack.config.js",
32-
"build:when": "webpack --config ./src/fixtures/when/webpack.config.js",
33-
"build:ref": "webpack --config ./src/fixtures/ref/webpack.config.js",
34-
"build:repeat": "webpack --config ./src/fixtures/repeat/webpack.config.js",
35-
"build:observer-map": "webpack --config ./src/fixtures/observer-map/webpack.config.js",
36-
"build:slotted": "webpack --config ./src/fixtures/slotted/webpack.config.js",
37-
"build:lifecycle-callbacks": "webpack --config ./src/fixtures/lifecycle-callbacks/webpack.config.js",
38-
"build-app": "npm run build:attribute && npm run build:dot-syntax && npm run build:event && npm run build:children && npm run build:binding && npm run build:when && npm run build:ref && npm run build:repeat && npm run build:observer-map && npm run build:slotted && npm run build:lifecycle-callbacks",
39-
"build-server": "tsc -b server",
40-
"doc": "api-extractor run --local",
24+
"build:tsc": "tsc -p ./tsconfig.json",
25+
"build": "npm run build:tsc && npm run doc",
26+
"clean": "rimraf dist temp test-results",
27+
"dev:full": "concurrently -k -n fast-element,fast-html,server \"npm run dev --workspace=@microsoft/fast-element\" \"npm:watch\" \"npm:test-server\"",
28+
"dev": "concurrently -k -n tsc,server \"npm run watch\" \"npm run test-server\"",
4129
"doc:ci": "api-extractor run",
30+
"doc": "npm run doc:ci -- --local",
31+
"eslint:fix": "npm run eslint -- --fix",
4232
"eslint": "eslint . --ext .ts",
43-
"eslint:fix": "eslint . --ext .ts --fix",
33+
"install-playwright-browsers": "npm run playwright install",
4434
"prepublishOnly": "npm run clean && npm run build",
45-
"pretest": "npm run build && npm run build-server",
4635
"prettier:diff": "prettier --config ../../../.prettierrc \"**/*.{ts,html}\" --list-different",
4736
"prettier": "prettier --config ../../../.prettierrc --write \"**/*.{ts,html}\"",
48-
"test": "npm run build-app && playwright test && npm run test:rules",
49-
"test-server": "node server/dist/server.js",
37+
"test-server": "npx vite test/ --clearScreen false",
38+
"test:playwright": "playwright test",
5039
"test:rules": "sg test --skip-snapshot-tests",
51-
"install-playwright-browsers": "npm run playwright install",
52-
"dev": "npm run build && npm run build-app && npm run build-server && npm run test-server"
40+
"test": "npm run test:playwright && npm run test:rules",
41+
"test:ui": "concurrently -k -n fast-element,fast-html,playwright \"npm run dev --workspace=@microsoft/fast-element\" \"npm:watch\" \"npx playwright test --ui\"",
42+
"watch": "npm run build:tsc -- -w --preserveWatchOutput"
5343
},
5444
"description": "A package for facilitating rendering FAST Web Components in a non-browser environment.",
5545
"exports": {
@@ -71,13 +61,8 @@
7161
"@microsoft/api-extractor": "^7.47.0",
7262
"@microsoft/fast-element": "^2.8.0",
7363
"@playwright/test": "^1.49.0",
74-
"@types/express": "^4.17.21",
7564
"@types/node": "^17.0.17",
76-
"express": "^4.19.2",
77-
"typescript": "~5.3.0",
78-
"webpack": "^5.97.1",
79-
"webpack-cli": "^6.0.1",
80-
"webpack-merge": "^6.0.1"
65+
"typescript": "~5.3.0"
8166
},
8267
"beachball": {
8368
"disallowedChangeTypes": [
@@ -86,4 +71,4 @@
8671
"patch"
8772
]
8873
}
89-
}
74+
}
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
export default {
2-
testDir: "./src/fixtures",
1+
import { defineConfig } from "@playwright/test";
2+
3+
export default defineConfig({
4+
testDir: ".",
5+
testMatch: "**/*.spec.ts",
36
retries: 3,
47
webServer: {
58
command: "npm run test-server",
6-
port: 8080,
7-
timeout: 120 * 1000,
9+
port: 5173,
810
reuseExistingServer: true,
911
},
10-
};
12+
});

packages/web-components/fast-html/server/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/web-components/fast-html/server/server.ts

Lines changed: 0 additions & 176 deletions
This file was deleted.

packages/web-components/fast-html/server/tsconfig.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/web-components/fast-html/src/components/observer-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Observable } from "@microsoft/fast-element/observable.js";
22
import { assignObservables } from "./utilities.js";
3-
import { JSONSchema, Schema } from "./schema.js";
3+
import type { JSONSchema, Schema } from "./schema.js";
44

55
/**
66
* ObserverMap provides functionality for caching binding paths, extracting root properties,

packages/web-components/fast-html/src/components/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type ChildrenMap } from "./utilities.js";
1+
import type { ChildrenMap } from "./utilities.js";
22

33
type FastContextMetaData = "$fast_context";
44
type FastContextsMetaData = "$fast_parent_contexts";

0 commit comments

Comments
 (0)