Skip to content

Commit

Permalink
Merge pull request #2232 from embroider-build/vite-ts-project
Browse files Browse the repository at this point in the history
move @embroider/vite typescript build to a project reference
  • Loading branch information
mansona authored Jan 21, 2025
2 parents f779011 + 3db307e commit b3b53c1
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 36 deletions.
5 changes: 4 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"main": "src/index.js",
"typesVersions": {
"*": {
"virtual": ["types/virtual"]
"virtual": [
"types/virtual"
]
}
},
"files": [
Expand Down Expand Up @@ -67,6 +69,7 @@
"@types/jsdom": "^16.2.11",
"@types/lodash": "^4.14.170",
"@types/node": "^22.9.3",
"@types/qunit": "^2.19.12",
"@types/resolve": "^1.20.0",
"@types/semver": "^7.3.5",
"@types/tmp": "^0.1.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/messages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import makeDebug from 'debug';
import { format } from 'util';
// @ts-expect-error we can't import the NestedHooks from qunit here
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type qunit from 'qunit';

const todo = makeDebug('embroider:todo');
const unsupported = makeDebug('embroider:unsupported');
Expand Down
1 change: 1 addition & 0 deletions packages/vite/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/tests/**/*.js
/tests/**/*.d.ts
/tests/**/*.map
/dist/
9 changes: 0 additions & 9 deletions packages/vite/index.d.ts

This file was deleted.

File renamed without changes.
10 changes: 3 additions & 7 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"type": "module",
"exports": {
".": {
"default": "./index.mjs",
"types": "./index.d.ts"
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"peerDependencies": {
Expand Down Expand Up @@ -44,10 +44,6 @@
"vite": "^5.3.3"
},
"files": [
"index.mjs",
"index.d.ts",
"src/**/*.js",
"src/**/*.d.ts",
"src/**/*.js.map"
"dist"
]
}
11 changes: 11 additions & 0 deletions packages/vite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"include": [
"./src/**/*.ts",
"./index.ts"
],
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"composite": true,
"outDir": "dist"
},
}
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

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

19 changes: 19 additions & 0 deletions tsconfig-base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es2019",
"module": "nodenext",
"moduleResolution": "nodenext",
"declaration": true,
"typeRoots": ["types", "node_modules/@types"],
"esModuleInterop": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"sourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"allowUnreachableCode": false,
"strict": true,
"skipLibCheck": true,
"useUnknownInCatchVariables": false,
},
}
24 changes: 5 additions & 19 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,7 @@
"./test-packages/release/src/**/*.ts",
"./tests/scenarios/**/*.ts"
],
"compilerOptions": {
"target": "es2019",
"module": "nodenext",
"moduleResolution": "nodenext",
"declaration": true,
"typeRoots": ["types", "node_modules/@types"],
"esModuleInterop": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"sourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"allowUnreachableCode": false,
"strict": true,
"skipLibCheck": true,
"useUnknownInCatchVariables": false,
},
"extends": "./tsconfig-base.json",
"exclude": [
"node_modules",
"packages/*/tmp",
Expand All @@ -34,9 +18,11 @@
"tmp",
"tests/scenarios/output",
"packages/config-meta-loader/src",
"packages/router/src"
"packages/router/src",
"packages/vite"
],
"references": [
{ "path": "packages/config-meta-loader" }
{ "path": "packages/config-meta-loader" },
{ "path": "packages/vite" }
]
}

0 comments on commit b3b53c1

Please sign in to comment.