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

feat: support devtools for better user experience #110

Merged
merged 1 commit into from
Apr 20, 2022
Merged
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
16 changes: 13 additions & 3 deletions example/craco/craco.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
const WindiCSSWebpackPlugin = require('windicss-webpack-plugin')
const WindiCSSWebpackPlugin = require('../../')

module.exports = {
eslint: {
pluginOptions: config => {
config.exclude = ['**/node_modules/**', '**/virtual:windi-devtools*']
return config;
},
},
webpack: {
plugins: {
add: [
new WindiCSSWebpackPlugin({
virtualModulePath: 'src'
virtualModulePath: 'src',
server: {
port: 9999,
host: 'localhost'
}
})
],
},
},
}
}
3 changes: 2 additions & 1 deletion example/craco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "^4.0.3",
"web-vitals": "^1.0.1"
"web-vitals": "^1.0.1",
"windicss-webpack-plugin": "file:../../"
},
"scripts": {
"start": "craco start",
Expand Down
1 change: 1 addition & 0 deletions example/craco/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import './virtual:windi.css'
import './virtual:windi-devtools'

ReactDOM.render(
<React.StrictMode>
Expand Down
3 changes: 3 additions & 0 deletions example/icejs/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"webpackPlugins": {
"windicss-webpack-plugin": {}
},
"eslint": {
"exclude": ["**/node_modules/**", "**/virtual:windi-devtools*"]
}
}
2 changes: 1 addition & 1 deletion example/icejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"eslint": "^7.30.0",
"ice.js": "^2.0.0",
"stylelint": "^13.7.2",
"windicss-webpack-plugin": "^1.5.6"
"windicss-webpack-plugin": "file:../../"
},
"scripts": {
"start": "icejs start",
Expand Down
1 change: 1 addition & 0 deletions example/icejs/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { runApp, IAppConfig } from 'ice';

import 'windi.css';
import 'windi-devtools';

const appConfig: IAppConfig = {
app: {
Expand Down
142 changes: 88 additions & 54 deletions example/icejs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
lodash.debounce "^4.0.8"
lodash.throttle "^4.1.1"

"@antfu/utils@^0.3.0":
version "0.3.0"
resolved "https://registry.npmmirror.com/@antfu/utils/download/@antfu/utils-0.3.0.tgz#6306c43b52a883bd8e973e3ed8dd64248418bcc4"
integrity sha1-YwbEO1Kog72Olz4+2N1kJIQYvMQ=
dependencies:
"@types/throttle-debounce" "^2.1.0"
"@antfu/utils@^0.5.1":
version "0.5.1"
resolved "https://registry.yarnpkg.com/@antfu/utils/-/utils-0.5.1.tgz#7eb6764878adb715daff20019e5a15fd63d93342"
integrity sha512-8Afo0+xvYe1K8Wm4xHTymfTkpzy36aaqDvhXIayUwl+mecMG9Xzl3XjXa6swG6Bk8FBeQ646RyvmsYt6+2Be9g==

"@apideck/better-ajv-errors@^0.2.4":
version "0.2.6"
Expand Down Expand Up @@ -1496,11 +1494,6 @@
resolved "https://registry.npmmirror.com/@types/scheduler/download/@types/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
integrity sha1-GmL4lSVyPd4kuhsBsJK/XfitTTk=

"@types/throttle-debounce@^2.1.0":
version "2.1.0"
resolved "https://registry.npmmirror.com/@types/throttle-debounce/download/@types/throttle-debounce-2.1.0.tgz#1c3df624bfc4b62f992d3012b84c56d41eab3776"
integrity sha1-HD32JL/Eti+ZLTASuExW1B6rN3Y=

"@types/trusted-types@^2.0.2":
version "2.0.2"
resolved "https://registry.npmmirror.com/@types/trusted-types/download/@types/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
Expand Down Expand Up @@ -1608,27 +1601,27 @@
"@rollup/pluginutils" "^4.1.1"
react-refresh "^0.10.0"

"@windicss/config@1.5.1":
version "1.5.1"
resolved "https://registry.npmmirror.com/@windicss/config/download/@windicss/config-1.5.1.tgz#e3fdaddfc553442c85f67f2e9290ef46ce87b3a1"
integrity sha1-4/2t38VTRCyF9n8ukpDvRs6Hs6E=
"@windicss/config@1.8.4":
version "1.8.4"
resolved "https://registry.yarnpkg.com/@windicss/config/-/config-1.8.4.tgz#090c7f48cb86b6cba1bd97742a2f012852026d3c"
integrity sha512-i4fFGFfZoRess6WMkauykHC3PFd9xKYVx7lSuLfMK7sgo6x3+l4dY42GbsWMHyLqH1sTMfyt1LgfXSIKYJozSA==
dependencies:
debug "^4.3.2"
jiti "^1.12.9"
windicss "^3.2.1"
debug "^4.3.4"
jiti "^1.13.0"
windicss "^3.5.1"

"@windicss/plugin-utils@^1.5.1":
version "1.5.1"
resolved "https://registry.npmmirror.com/@windicss/plugin-utils/download/@windicss/plugin-utils-1.5.1.tgz#9750bb72e8c14585e011d46a33351d47d8519e31"
integrity sha1-l1C7cujBRYXgEdRqMzUdR9hRnjE=
"@windicss/plugin-utils@^1.8.4":
version "1.8.4"
resolved "https://registry.yarnpkg.com/@windicss/plugin-utils/-/plugin-utils-1.8.4.tgz#fba74b6eb29276e24b9d09931bc22808fd7230d7"
integrity sha512-DqJVwAfzlgd8nYSNlmhXOey32pI8UwH7QiOWdFS/AR2O/q9oLDGHDn97Its/kZdfoyhi8ylwZNP2Pk0H7cihhQ==
dependencies:
"@antfu/utils" "^0.3.0"
"@windicss/config" "1.5.1"
debug "^4.3.2"
fast-glob "^3.2.7"
magic-string "^0.25.7"
micromatch "^4.0.4"
windicss "^3.2.1"
"@antfu/utils" "^0.5.1"
"@windicss/config" "1.8.4"
debug "^4.3.4"
fast-glob "^3.2.11"
magic-string "^0.26.1"
micromatch "^4.0.5"
windicss "^3.5.1"

accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
version "1.3.7"
Expand Down Expand Up @@ -2071,7 +2064,7 @@ braces@^2.3.1:
split-string "^3.0.2"
to-regex "^3.0.1"

braces@^3.0.1, braces@~3.0.2:
braces@^3.0.1, braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.npmmirror.com/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc=
Expand Down Expand Up @@ -2828,13 +2821,20 @@ debug@^3.0.1, debug@^3.1.0, debug@^3.1.1, debug@^3.2.6, debug@^3.2.7:
dependencies:
ms "^2.1.1"

debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2:
debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1:
version "4.3.2"
resolved "https://registry.npmmirror.com/debug/download/debug-4.3.2.tgz?cache=0&sync_timestamp=1636300872595&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fdebug%2Fdownload%2Fdebug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha1-8KScGKyHeeMdSgxgKd+3aHPHQos=
dependencies:
ms "2.1.2"

debug@^4.3.3, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"

decamelize-keys@^1.1.0:
version "1.1.0"
resolved "https://registry.npmmirror.com/decamelize-keys/download/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9"
Expand Down Expand Up @@ -3803,6 +3803,17 @@ fast-glob@^3.1.1, fast-glob@^3.2.5, fast-glob@^3.2.7:
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^3.2.11:
version "3.2.11"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9"
integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
Expand Down Expand Up @@ -4131,6 +4142,11 @@ get-own-enumerable-property-symbols@^3.0.0:
resolved "https://registry.npmmirror.com/get-own-enumerable-property-symbols/download/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664"
integrity sha1-tf3nfyLL4185C04ImSLFC85u9mQ=

get-port@^6.1.2:
version "6.1.2"
resolved "https://registry.yarnpkg.com/get-port/-/get-port-6.1.2.tgz#c1228abb67ba0e17fb346da33b15187833b9c08a"
integrity sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==

get-stdin@^8.0.0:
version "8.0.0"
resolved "https://registry.npmmirror.com/get-stdin/download/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53"
Expand Down Expand Up @@ -5119,10 +5135,10 @@ jest-worker@^27.3.1:
merge-stream "^2.0.0"
supports-color "^8.0.0"

jiti@^1.12.9:
version "1.12.9"
resolved "https://registry.npmmirror.com/jiti/download/jiti-1.12.9.tgz#2ce45b265cfc8dc91ebd70a5204807cf915291bc"
integrity sha1-LORbJlz8jckevXClIEgHz5FSkbw=
jiti@^1.13.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.13.0.tgz#3cdfc4e651ca0cca4c62ed5e47747b5841d41a8e"
integrity sha512-/n9mNxZj/HDSrincJ6RP+L+yXbpnB8FybySBa+IjIaoH9FIxBbrbRT5XUbe8R7zuVM2AQqNMNDDqz0bzx3znOQ==

"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
Expand Down Expand Up @@ -5430,6 +5446,13 @@ magic-string@^0.25.0, magic-string@^0.25.7:
dependencies:
sourcemap-codec "^1.4.4"

magic-string@^0.26.1:
version "0.26.1"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.1.tgz#ba9b651354fa9512474199acecf9c6dbe93f97fd"
integrity sha512-ndThHmvgtieXe8J/VGPjG+Apu7v7ItcD5mhEIvOscWjPF/ccOiLxHaSuCAS2G+3x4GKsAbT8u7zdyamupui8Tg==
dependencies:
sourcemap-codec "^1.4.8"

make-dir@^2.0.0, make-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/make-dir/download/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
Expand Down Expand Up @@ -5598,6 +5621,14 @@ micromatch@^4.0.2, micromatch@^4.0.4:
braces "^3.0.1"
picomatch "^2.2.3"

micromatch@^4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
dependencies:
braces "^3.0.2"
picomatch "^2.3.1"

mime-db@1.51.0, "mime-db@>= 1.43.0 < 2":
version "1.51.0"
resolved "https://registry.npmmirror.com/mime-db/download/mime-db-1.51.0.tgz?cache=0&sync_timestamp=1636425999210&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fmime-db%2Fdownload%2Fmime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c"
Expand Down Expand Up @@ -6305,6 +6336,11 @@ path-type@^4.0.0:
resolved "https://registry.npmmirror.com/path-type/download/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
integrity sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=

pathe@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/pathe/-/pathe-0.2.0.tgz#30fd7bbe0a0d91f0e60bae621f5d19e9e225c339"
integrity sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==

picocolors@^0.2.1:
version "0.2.1"
resolved "https://registry.npmmirror.com/picocolors/download/picocolors-0.2.1.tgz?cache=0&sync_timestamp=1634093437726&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fpicocolors%2Fdownload%2Fpicocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f"
Expand All @@ -6320,6 +6356,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3:
resolved "https://registry.npmmirror.com/picomatch/download/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
integrity sha1-8fBh3o9qS/AiiS4tEoI0+5gwKXI=

picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

pify@^4.0.1:
version "4.0.1"
resolved "https://registry.npmmirror.com/pify/download/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
Expand Down Expand Up @@ -7477,7 +7518,7 @@ source-map@^0.8.0-beta.0:
dependencies:
whatwg-url "^7.0.0"

sourcemap-codec@^1.4.4:
sourcemap-codec@^1.4.4, sourcemap-codec@^1.4.8:
version "1.4.8"
resolved "https://registry.npmmirror.com/sourcemap-codec/download/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
integrity sha1-6oBL2UhXQC5pktBaOO8a41qatMQ=
Expand Down Expand Up @@ -8231,11 +8272,6 @@ upath@^1.2.0:
resolved "https://registry.npmmirror.com/upath/download/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894"
integrity sha1-j2bbzVWog6za5ECK+LA1pQRMGJQ=

upath@^2.0.1:
version "2.0.1"
resolved "https://registry.npmmirror.com/upath/download/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b"
integrity sha1-UMc96mjW9rmQ9R0nnOYIFmXWGos=

upper-case@^1.1.1:
version "1.1.3"
resolved "https://registry.npmmirror.com/upper-case/download/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598"
Expand Down Expand Up @@ -8569,24 +8605,22 @@ wide-align@^1.1.0:
dependencies:
string-width "^1.0.2 || 2 || 3 || 4"

windicss-webpack-plugin@^1.5.6:
version "1.5.6"
resolved "https://registry.npmmirror.com/windicss-webpack-plugin/download/windicss-webpack-plugin-1.5.6.tgz#451333bac64d3d0b229d4a58c70f5f66249acefd"
integrity sha512-Wap3bvaNlIFKkJugaeVMqV1ICMDfSmwernYkYrRftK/ZJXP7/pkVvdXu5DDvFIlRVXjhlJlltIlFb1UNJn84sA==
"windicss-webpack-plugin@file:../..":
version "1.6.10"
dependencies:
"@windicss/plugin-utils" "^1.5.1"
debug "^4.3.2"
"@windicss/plugin-utils" "^1.8.4"
debug "^4.3.3"
get-port "^6.1.2"
loader-utils "^2.0.0"
lodash "^4.17.21"
magic-string "^0.25.7"
upath "^2.0.1"
pathe "^0.2.0"
webpack-virtual-modules "^0.4.3"
windicss "^3.2.1"
windicss "^3.5.1"

windicss@^3.2.1:
version "3.2.1"
resolved "https://registry.npmmirror.com/windicss/download/windicss-3.2.1.tgz#bd0f7b9ebabba04ea8dfedcbb0263c2ef9591db4"
integrity sha1-vQ97nrq7oE6o3+3LsCY8LvlZHbQ=
windicss@^3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/windicss/-/windicss-3.5.1.tgz#5e279c21179dbc122122d0b3a3a2651511249241"
integrity sha512-E1hYZATcZFci/XhGS0sJAMRxULjnK+glNukE78Ku7xeb3jxgMY55fFOdIrav+GjQCsgR+IZxPq9/DwmO6eyc4Q==

word-wrap@^1.2.3, word-wrap@~1.2.3:
version "1.2.3"
Expand Down
3 changes: 2 additions & 1 deletion example/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"next": "11.0.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"sass": "^1.35.1"
"sass": "^1.35.1",
"windicss-webpack-plugin": "file:../../"
}
}
1 change: 1 addition & 0 deletions example/next/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import '../styles/plain.css'
import '../styles/main.sass'
import '../styles/main.scss'
import 'windi.css'
import 'windi-devtools'

function MyApp({Component, pageProps}) {
return <Component {...pageProps} />
Expand Down
Loading