-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use custom server host, reduce deps (#20)
- Loading branch information
Showing
40 changed files
with
298 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
components/RuleLevelIcon.vue → app/components/RuleLevelIcon.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,3 +154,4 @@ function resetFilters() { | |
/> | ||
</div> | ||
</template> | ||
~/app/composables/state~/app/composables/payload |
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createWsServer } from '~~/src/ws' | ||
|
||
export default lazyEventHandler(async () => { | ||
const ws = await createWsServer() | ||
|
||
return defineEventHandler(async () => { | ||
return await ws.getData() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,3 @@ | ||
#!/usr/bin/env node | ||
/* eslint-disable no-console */ | ||
import process from 'node:process' | ||
import fs from 'node:fs/promises' | ||
import { existsSync } from 'node:fs' | ||
import { relative, resolve } from 'node:path' | ||
import open from 'open' | ||
import { getPort } from 'get-port-please' | ||
import cac from 'cac' | ||
|
||
const cli = cac() | ||
|
||
cli | ||
.command('build', 'Build inspector with current config file for static hosting') | ||
.option('--config <configFile>', 'Config file path', { default: process.env.ESLINT_CONFIG }) | ||
.option('--out-dir <dir>', 'Output directory', { default: '.eslint-config-inspector' }) | ||
.action(async (options) => { | ||
console.log('Building static ESLint config inspector...') | ||
|
||
const cwd = process.cwd() | ||
const outDir = resolve(cwd, options.outDir) | ||
const { readConfig } = await import('./dist/server/chunks/routes/api/utils.mjs') | ||
const configs = await readConfig(cwd, options.config || process.env.ESLINT_CONFIG) | ||
if (existsSync(outDir)) | ||
await fs.rm(outDir, { recursive: true }) | ||
await fs.mkdir(outDir, { recursive: true }) | ||
const distDir = new URL('./dist/public', import.meta.url) | ||
await fs.cp(distDir, outDir, { recursive: true }) | ||
await fs.mkdir(resolve(outDir, 'api'), { recursive: true }) | ||
configs.payload.meta.configPath = '' | ||
await fs.writeFile(resolve(outDir, 'api/payload.json'), JSON.stringify(configs.payload, null, 2), 'utf-8') | ||
|
||
console.log(`Built to ${relative(cwd, outDir)}`) | ||
console.log(`You can use static server like \`npx serve ${relative(cwd, outDir)}\` to serve the inspector`) | ||
}) | ||
|
||
cli | ||
.command('', 'Start dev inspector') | ||
.option('--config <configFile>', 'Config file path', { default: process.env.ESLINT_CONFIG }) | ||
.option('--host <host>', 'Host', { default: process.env.HOST || '127.0.0.1' }) | ||
.option('--port <port>', 'Port', { default: process.env.PORT || 7777 }) | ||
.option('--open', 'Open browser', { default: true }) | ||
.action(async (options) => { | ||
process.env.HOST = options.host | ||
process.env.PORT = await getPort({ port: options.port }) | ||
if (options.config) | ||
process.env.ESLINT_CONFIG = options.config | ||
|
||
process.argv = process.argv.slice(0, 2) | ||
|
||
await Promise.all([ | ||
import('./dist/server/index.mjs'), | ||
options.open ? open(`http://localhost:${process.env.PORT}`) : undefined, | ||
]) | ||
}) | ||
|
||
cli.help() | ||
cli.parse() | ||
await import('./dist/cli.mjs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
|
||
export default defineBuildConfig({ | ||
entries: [ | ||
'src/cli.ts', | ||
], | ||
clean: false, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,9 @@ export default nuxt() | |
}, | ||
), | ||
) | ||
.append({ | ||
files: ['src/**/*.ts'], | ||
rules: { | ||
'no-console': 'off', | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
"dist" | ||
], | ||
"scripts": { | ||
"build": "nuxi build", | ||
"build": "nuxi build && unbuild", | ||
"dev": "nuxi dev", | ||
"prepare": "nuxi prepare", | ||
"start": "node bin.mjs", | ||
|
@@ -33,21 +33,16 @@ | |
"eslint": "^8.50.0" | ||
}, | ||
"dependencies": { | ||
"@unhead/shared": "^1.9.4", | ||
"@unhead/ssr": "^1.9.4", | ||
"bundle-require": "^4.0.2", | ||
"cac": "^6.7.14", | ||
"chokidar": "^3.6.0", | ||
"devalue": "^4.3.2", | ||
"connect": "^3.7.0", | ||
"esbuild": "^0.20.2", | ||
"fast-glob": "^3.3.2", | ||
"get-port-please": "^3.1.2", | ||
"minimatch": "^9.0.4", | ||
"ofetch": "^1.3.4", | ||
"open": "^10.1.0", | ||
"unhead": "^1.9.4", | ||
"vue": "^3.4.21", | ||
"vue-bundle-renderer": "^2.0.0", | ||
"sirv": "^2.0.4", | ||
"ws": "^8.16.0" | ||
}, | ||
"devDependencies": { | ||
|
@@ -57,6 +52,7 @@ | |
"@iconify-json/ph": "^1.1.11", | ||
"@iconify-json/twemoji": "^1.1.15", | ||
"@nuxt/eslint": "0.3.0-beta.6", | ||
"@types/connect": "^3.4.38", | ||
"@types/ws": "^8.5.10", | ||
"@typescript-eslint/utils": "^7.5.0", | ||
"@unocss/eslint-config": "^0.58.9", | ||
|
@@ -71,10 +67,5 @@ | |
"typescript": "^5.4.3", | ||
"unbuild": "^2.0.0", | ||
"vue-tsc": "^2.0.7" | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.