Skip to content

Commit

Permalink
Merge branch 'main' into allow-for-vite-5
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav authored Jan 20, 2024
2 parents d6ec5bd + 12dc23d commit af8970d
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 143 deletions.
38 changes: 19 additions & 19 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"cSpell.words": [
"Carniato",
"codeql",
"crxjs",
"Demaine",
"dgraph",
"otonashixav",
"outin",
"sarif",
"stefanzweifel",
"taze",
"todomvc",
"twind",
"undici"
],
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
}
"cSpell.words": [
"Carniato",
"codeql",
"crxjs",
"Demaine",
"dgraph",
"otonashixav",
"outin",
"sarif",
"stefanzweifel",
"taze",
"todomvc",
"twind",
"undici"
],
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "never"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@typescript-eslint/parser": "^6.11.0",
"babel-preset-solid": "^1.8.4",
"cross-env": "^7.0.3",
"esbuild": "^0.19.5",
"esbuild": "^0.19.11",
"esbuild-plugin-solid": "^0.5.0",
"eslint": "^8.53.0",
"eslint-plugin-eslint-comments": "^3.2.0",
Expand All @@ -49,17 +49,17 @@
"solid-js": "^1.8.5",
"tsup": "^7.2.0",
"tsup-preset-solid": "^2.1.0",
"tsx": "^4.1.2",
"tsx": "^4.7.0",
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"unocss": "^0.57.4",
"vite": "4.5.0",
"vite-plugin-solid": "^2.8.0",
"vitest": "^0.34.6"
},
"packageManager": "pnpm@8.9.0",
"packageManager": "pnpm@8.14.0",
"engines": {
"node": ">=18",
"pnpm": ">=8.6.0"
"pnpm": ">=8.14.0"
}
}
2 changes: 1 addition & 1 deletion packages/debugger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"devDependencies": {
"solid-js": "^1.8.5"
},
"packageManager": "pnpm@8.9.0",
"packageManager": "pnpm@8.14.0",
"keywords": [
"solid",
"devtools",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
"vite": "^4"
}
},
"packageManager": "pnpm@8.9.0"
"packageManager": "pnpm@8.14.0"
}
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@
"peerDependencies": {
"solid-js": "^1.8.0"
},
"packageManager": "pnpm@8.9.0"
"packageManager": "pnpm@8.14.0"
}
2 changes: 1 addition & 1 deletion packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"peerDependencies": {
"solid-js": "^1.8.0"
},
"packageManager": "pnpm@8.9.0",
"packageManager": "pnpm@8.14.0",
"keywords": [
"solid",
"devtools",
Expand Down
2 changes: 1 addition & 1 deletion packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"optional": true
}
},
"packageManager": "pnpm@8.9.0",
"packageManager": "pnpm@8.14.0",
"keywords": [
"solid",
"devtools",
Expand Down
5 changes: 2 additions & 3 deletions packages/overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@
"peerDependencies": {
"solid-js": "^1.8.0"
},
"packageManager": "pnpm@8.9.0",
"packageManager": "pnpm@8.14.0",
"devDependencies": {
"@types/clean-css": "^4.2.10",
"chokidar": "^3.5.3",
"clean-css": "^5.3.2",
"solid-js": "^1.8.5",
"tsx": "^4.1.2"
"solid-js": "^1.8.5"
}
}
5 changes: 2 additions & 3 deletions packages/overlay/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ if (!isDev) {

// generate type declarations
{
const worker = new Worker(path.resolve(__dirname, `./dts_worker.ts`), {
argv: isDev ? ['--watch'] : [],
})
const filepath = path.resolve(__dirname, `dts_worker.js`)
const worker = new Worker(filepath, {argv: isDev ? ['--watch'] : []})

if (isDev) {
chokidar.watch(path.resolve(cwd, `src`)).on('change', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
// @ts-check

import path from 'path'
import ts from 'typescript'
import * as worker_threads from 'worker_threads'

const isDev = process.argv.includes('--watch')
const entryFile = path.resolve(process.cwd(), `src/index.tsx`)

const options = getTscOptions()

if (isDev) {
/** @type {ts.Program | undefined} */
let old_program
worker_threads.parentPort?.on('message', () => {
old_program = emitDts(entryFile, options, old_program)
})
} else {
emitDts(entryFile, options)
process.exit()
}

export function getTscOptions(): ts.CompilerOptions {
/**
* @returns {ts.CompilerOptions}
*/
export function getTscOptions() {
const configFile = ts.findConfigFile(process.cwd(), ts.sys.fileExists, 'tsconfig.json')
if (!configFile) throw Error('tsconfig.json not found')
const {config} = ts.readConfigFile(configFile, ts.sys.readFile)
Expand All @@ -18,7 +41,13 @@ export function getTscOptions(): ts.CompilerOptions {
}
}

export function emitDts(entryFile: string, options: ts.CompilerOptions, oldProgram?: ts.Program) {
/**
* @param {string} entryFile
* @param {ts.CompilerOptions} options
* @param {ts.Program} [oldProgram]
* @returns {ts.Program}
*/
export function emitDts(entryFile, options, oldProgram) {
const timestamp = Date.now()
const program = ts.createProgram([entryFile], options, undefined, oldProgram)
program.emit()
Expand Down
19 changes: 0 additions & 19 deletions packages/overlay/scripts/dts_worker.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"@nothing-but/utils": "~0.12.0"
},
"packageManager": "pnpm@8.9.0",
"packageManager": "pnpm@8.14.0",
"keywords": [
"solid",
"devtools",
Expand Down
Loading

0 comments on commit af8970d

Please sign in to comment.