Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: node16 types #888

Draft
wants to merge 10 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run Type Test
on: [push]

env:
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
test:
name: Are the types wrong?
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Check Types
run: pnpm run test:attw
2 changes: 1 addition & 1 deletion components.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/src/components/index.js'
export * from './dist/components.js'
2 changes: 1 addition & 1 deletion composables.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/src/composables/index.js'
export * from './dist/composables.js'
3 changes: 2 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ publish = "docs/.vitepress/dist"
command = "pnpm run build && pnpm docs:build"

[build.environment]
NODE_VERSION = "18"
NODE_VERSION = "20"
NODE_OPTIONS = '--max-old-space-size=4096'
36 changes: 16 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,19 @@
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/tres.d.ts",
"import": "./dist/tres.js",
"require": "./dist/tres.umd.cjs"
},
"./components": {
"types": "./dist/src/components/index.d.ts"
},
"./composables": {
"types": "./dist/src/composables/index.d.ts"
},
"./types": {
"types": "./dist/src/types/index.d.ts"
},
"./utils": {
"types": "./dist/src/utils/index.d.ts"
"require": "./dist/tres.cjs"
},
"./*": "./*"
},
"main": "./dist/tres.js",
"main": "./dist/tres.cjs",
"module": "./dist/tres.js",
"types": "./dist/index.d.ts",
"types": "./dist/tres.d.ts",
"files": [
"*.d.ts",
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"dev": "pnpm --filter='./playground/vue' dev",
"dev:nuxt": "pnpm --filter='./playground/nuxt' dev",
Expand All @@ -63,7 +48,8 @@
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs",
"docs:preview": "vitepress preview docs",
"docs:contributors": "esno scripts/update-contributors.ts"
"docs:contributors": "esno scripts/update-contributors.ts",
"test:attw": "attw --pack --ignore-rules false-esm --ignore-rules cjs-resolves-to-esm"
},
"peerDependencies": {
"three": ">=0.133",
Expand All @@ -75,6 +61,7 @@
"@vueuse/core": "^12.0.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.2",
"@release-it/conventional-changelog": "^9.0.3",
"@stackblitz/sdk": "^1.11.0",
"@tresjs/cientos": "4.0.3",
Expand All @@ -101,6 +88,7 @@
"rollup-plugin-visualizer": "^5.12.0",
"sponsorkit": "^0.16.2",
"three": "^0.171.0",
"typescript": "^5.7.2",
"unocss": "^0.65.2",
"unplugin": "^2.1.0",
"unplugin-vue-components": "^0.28.0",
Expand All @@ -114,5 +102,13 @@
"vitest": "2.1.8",
"vue": "3.5.13",
"vue-demi": "^0.14.10"
},
"pnpm": {
"overrides": {
"typescript": "^5.7.2"
}
},
"publishConfig": {
"access": "public"
}
}
6 changes: 2 additions & 4 deletions playground/vue/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { templateCompilerOptions } from '@tresjs/core'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'pathe'
import UnoCSS from 'unocss/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
Expand Down Expand Up @@ -41,9 +39,9 @@ export default defineConfig({
qrcode(), // only applies in dev mode
],
resolve: {
alias: {
/* alias: {
'@tresjs/core': resolve(__dirname, '../../src/index.ts'),
},
}, */
dedupe: ['three'],
},
})
Loading
Loading