Skip to content

Commit

Permalink
feat: introduce debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Mar 22, 2023
1 parent 62a2738 commit 08db699
Show file tree
Hide file tree
Showing 16 changed files with 1,528 additions and 780 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
strict-peer-dependencies=false
auto-install-peers=true
strict-peer-dependencies=true
auto-install-peers=false
2 changes: 1 addition & 1 deletion __test__/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'node:path'
import path from 'path'
import { describe, expect, test } from 'vitest'
import { eol, eq, isPublicTypescript, linebreak } from '../src/utils'
import { getContentHash } from '../src/utils/build'
Expand Down
30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,35 @@
"test": "vitest",
"lint": "eslint .",
"preinstall": "npx only-allow pnpm",
"upgrade:deps": "pnpm update --i --L",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"bump": "pnpm changelog && bumpp package.json CHANGELOG.md --commit --push --tag -all"
"up": "pnpm update --i --L",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"bump": "bumpp package.json -c --all -p -t"
},
"peerDependencies": {
"vite": "3 || 4"
},
"dependencies": {
"esbuild": "^0.17.10",
"fs-extra": "^11.1.0",
"debug": "^4.3.4",
"esbuild": "^0.17.12",
"fs-extra": "^11.1.1",
"on-change": "^4.0.2",
"tiny-glob": "^0.2.9",
"watcher": "^2.2.2"
},
"devDependencies": {
"@minko-fe/eslint-config": "^1.2.18",
"@minko-fe/tsconfig": "^1.2.18",
"@minko-fe/eslint-config": "^1.2.31",
"@minko-fe/tsconfig": "^1.2.31",
"@types/debug": "^4.1.7",
"@types/fs-extra": "^11.0.1",
"@types/mock-fs": "^4.13.1",
"@types/node": "^18.14.0",
"bumpp": "^8.2.1",
"@types/node": "^18.15.5",
"bumpp": "^9.0.0",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.34.0",
"eslint": "^8.36.0",
"mock-fs": "^5.2.0",
"tsup": "^6.6.3",
"typescript": "^4.9.5",
"vite": "^4.1.3",
"vitest": "^0.28.5"
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vitest": "^0.29.7"
}
}
14 changes: 7 additions & 7 deletions playground/spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"dev": "cross-env DEBUG=vite-plugin-public-typescript vite",
"build": "vite build",
"preview": "vite preview"
},
Expand All @@ -13,11 +13,11 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^3.0.0",
"typescript": "^4.6.4",
"vite": "4.0.4",
"vite-plugin-public-typescript": "link: ./../../../"
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"typescript": "^4.9.5",
"vite": "4.2.1",
"vite-plugin-public-typescript": "workspace:*"
}
}
6 changes: 3 additions & 3 deletions playground/spa/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import path from 'node:path'
import path from 'path'
import type { HtmlTagDescriptor } from 'vite'
import { defineConfig } from 'vite'
import { publicTypescript } from 'vite-plugin-public-typescript'
import react from '@vitejs/plugin-react'
import tg from 'tiny-glob'
import glob from 'tiny-glob'
import manifest from './publicTypescript/manifest.json'

// https://vitejs.dev/config/
Expand All @@ -24,7 +24,7 @@ export default defineConfig({
{
name: 'add-script',
async transformIndexHtml(html) {
const scripts = await tg('./public/*.js')
const scripts = await glob('./public/*.js')
const tags: HtmlTagDescriptor[] = scripts.map((s) => {
return {
tag: 'script',
Expand Down
12 changes: 6 additions & 6 deletions playground/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
},
"dependencies": {
"compression": "^1.7.4",
"express": "^4.18.1",
"express": "^4.18.2",
"lib": "file: ./../lib",
"sirv": "^2.0.2"
},
"devDependencies": {
"@types/express": "^4.17.14",
"@types/node": "^18.7.21",
"@types/express": "^4.17.17",
"@types/node": "^18.15.5",
"cross-env": "^7.0.3",
"typescript": "^4.8.3",
"vite": "^4.0.0",
"vite-plugin-public-typescript": "link: ./../../../"
"typescript": "^4.9.5",
"vite": "^4.2.1",
"vite-plugin-public-typescript": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion playground/ssr/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'node:fs/promises'
import fs from 'fs/promises'
import express from 'express'
import manifest from './publicTypescript/custom-manifest.json' assert { type: 'json' }

Expand Down
Loading

0 comments on commit 08db699

Please sign in to comment.