Skip to content

Commit 28ed0bd

Browse files
committed
chore: migrate site (wip)
1 parent bb5893f commit 28ed0bd

16 files changed

+188
-32
lines changed

.github/workflows/GHPages.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ jobs:
3131
run: |
3232
pnpm install
3333
pnpm run update
34-
pnpm run build
34+
pnpm build
3535
export NODE_OPTIONS="--max-old-space-size=8192"
36-
pnpm run docs:build
36+
cd docs-svelte-kit
37+
pnpm build
3738
- name: Setup Pages
3839
uses: actions/configure-pages@v5
3940
- name: Upload artifact
4041
uses: actions/upload-pages-artifact@v3
4142
with:
42-
path: ./build/eslint-plugin-svelte
43+
path: ./docs-svelte-kit/build/eslint-plugin-svelte
4344
- name: Deploy to GitHub Pages
4445
id: deployment
4546
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ dist
105105
packages/eslint-plugin-svelte/lib
106106
packages/eslint-plugin-svelte/.type-coverage
107107

108-
/.svelte-kit
109-
/build
108+
docs-svelte-kit/.svelte-kit
109+
docs-svelte-kit/build
110110
/svelte.config-dist.js
111111
/docs-svelte-kit/shim/eslint.mjs
112112
/docs-svelte-kit/shim/assert.mjs

docs-svelte-kit/.env-cmdrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
module.exports = {
4+
sveltekit: {
5+
NODE_OPTIONS: `--import ./svelte-kit-import.mjs ${
6+
// eslint-disable-next-line no-process-env -- ignore
7+
process.env.NODE_OPTIONS || ''
8+
}`
9+
}
10+
};

docs-svelte-kit/build-system/build.mts renamed to docs-svelte-kit/build-system/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
55

66
const dirname = path.dirname(fileURLToPath(import.meta.url));
77

8-
build(path.join(dirname, '../../node_modules/assert'), path.join(dirname, '../shim/assert.mjs'));
8+
build(path.join(dirname, '../node_modules/assert'), path.join(dirname, '../shim/assert.mjs'));
99

1010
/** build */
1111
function build(input: string, out: string, injects: string[] = []) {

docs-svelte-kit/package.json

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"name": "docs",
3+
"private": true,
4+
"scripts": {
5+
"build": "pnpm run svelte-kit build",
6+
"preview": "pnpm run svelte-kit preview",
7+
"dev": "pnpm run svelte-kit dev",
8+
"svelte-kit": "env-cmd -e sveltekit node node_modules/vite/bin/vite.js"
9+
},
10+
"dependencies": {
11+
"@eslint-community/eslint-utils": "^4.4.0",
12+
"@jridgewell/sourcemap-codec": "^1.4.15",
13+
"debug": "^4.3.4",
14+
"eslint-compat-utils": "^0.5.0",
15+
"esutils": "^2.0.3",
16+
"known-css-properties": "^0.31.0",
17+
"postcss": "^8.4.38",
18+
"postcss-load-config": "^3.1.4",
19+
"postcss-safe-parser": "^6.0.0",
20+
"postcss-selector-parser": "^6.0.16",
21+
"semver": "^7.6.0",
22+
"svelte-eslint-parser": ">=0.36.0 <1.0.0"
23+
},
24+
"devDependencies": {
25+
"@1stg/stylelint-config": "^6.0.0",
26+
"@babel/core": "^7.24.4",
27+
"@babel/eslint-parser": "^7.24.1",
28+
"@babel/plugin-proposal-function-bind": "^7.24.1",
29+
"@babel/types": "^7.24.0",
30+
"@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
31+
"@fontsource/fira-mono": "^5.0.12",
32+
"@ota-meshi/eslint-plugin": "^0.17.1",
33+
"@sindresorhus/slugify": "^2.2.1",
34+
"@sveltejs/adapter-static": "^3.0.1",
35+
"@sveltejs/kit": "^2.5.6",
36+
"@sveltejs/vite-plugin-svelte": "^3.1.0",
37+
"@types/babel__core": "^7.20.5",
38+
"@types/cross-spawn": "^6.0.6",
39+
"@types/escape-html": "^1.0.4",
40+
"@types/eslint": "^8.56.10",
41+
"@types/eslint-scope": "^3.7.7",
42+
"@types/eslint-utils": "^3.0.5",
43+
"@types/eslint-visitor-keys": "^3.3.0",
44+
"@types/esutils": "^2.0.2",
45+
"@types/json-schema": "^7.0.15",
46+
"@types/less": "^3.0.6",
47+
"@types/markdown-it": "^14.0.1",
48+
"@types/markdown-it-container": "^2.0.10",
49+
"@types/markdown-it-emoji": "^3.0.0",
50+
"@types/mocha": "^10.0.6",
51+
"@types/node": "^20.12.7",
52+
"@types/postcss-safe-parser": "^5.0.4",
53+
"@types/prismjs": "^1.26.3",
54+
"@types/semver": "^7.5.8",
55+
"@types/stylus": "^0.48.42",
56+
"@typescript-eslint/eslint-plugin": "^7.7.0",
57+
"@typescript-eslint/parser": "^7.7.0",
58+
"@typescript/vfs": "^1.5.0",
59+
"acorn": "^8.11.3",
60+
"assert": "^2.1.0",
61+
"cross-spawn": "^7.0.3",
62+
"env-cmd": "^10.1.0",
63+
"esbuild": "^0.21.0",
64+
"esbuild-register": "^3.5.0",
65+
"escape-html": "^1.0.3",
66+
"eslint": "^9.0.0",
67+
"eslint-config-prettier": "^9.1.0",
68+
"eslint-formatter-friendly": "^7.0.0",
69+
"eslint-plugin-eslint-plugin": "^6.0.0",
70+
"eslint-plugin-jsdoc": "^48.2.3",
71+
"eslint-plugin-json-schema-validator": "^5.1.0",
72+
"eslint-plugin-jsonc": "^2.15.1",
73+
"eslint-plugin-markdown": "^5.0.0",
74+
"eslint-plugin-mdx": "^3.1.5",
75+
"eslint-plugin-n": "^17.2.1",
76+
"eslint-plugin-node-dependencies": "^0.12.0",
77+
"eslint-plugin-prettier": "^5.1.3",
78+
"eslint-plugin-regexp": "^2.5.0",
79+
"eslint-plugin-svelte": "workspace:^",
80+
"eslint-plugin-yml": "^1.14.0",
81+
"eslint-scope": "^8.0.1",
82+
"eslint-typegen": "^0.2.3",
83+
"eslint-visitor-keys": "^4.0.0",
84+
"espree": "^10.0.1",
85+
"estree-walker": "^3.0.3",
86+
"globals": "^15.0.0",
87+
"less": "^4.2.0",
88+
"locate-character": "^3.0.0",
89+
"magic-string": "^0.30.10",
90+
"markdown-it-anchor": "^8.6.7",
91+
"markdown-it-container": "^4.0.0",
92+
"markdown-it-emoji": "^3.0.0",
93+
"pako": "^2.1.0",
94+
"postcss-nested": "^6.0.1",
95+
"prettier": "^3.2.5",
96+
"prettier-plugin-pkg": "^0.18.1",
97+
"prettier-plugin-svelte": "^3.2.3",
98+
"prism-svelte": "^0.5.0",
99+
"prismjs": "^1.29.0",
100+
"rimraf": "^5.0.5",
101+
"sass": "^1.75.0",
102+
"source-map-js": "^1.2.0",
103+
"stylelint": "~16.5.0",
104+
"stylelint-config-standard": "^36.0.0",
105+
"stylus": "^0.63.0",
106+
"svelte": "^5.0.0-next.112",
107+
"svelte-adapter-ghpages": "0.2.2",
108+
"tslib": "^2.6.2",
109+
"typescript-eslint": "^7.7.0",
110+
"util": "^0.12.5",
111+
"vite": "^5.2.9",
112+
"vite-plugin-eslint4b": "^0.4.0",
113+
"vite-plugin-svelte-md": "^0.1.7",
114+
"yaml": "^2.4.1"
115+
}
116+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SourceMapGenerator } from '../../node_modules/source-map-js/lib/source-map-generator.js';
2-
import { SourceMapConsumer } from '../../node_modules/source-map-js/lib/source-map-consumer.js';
1+
import { SourceMapGenerator } from '../node_modules/source-map-js/lib/source-map-generator.js';
2+
import { SourceMapConsumer } from '../node_modules/source-map-js/lib/source-map-consumer.js';
33
export { SourceMapGenerator, SourceMapConsumer };
44
export default { SourceMapGenerator, SourceMapConsumer };

docs-svelte-kit/src/lib/components/ESLintCodeBlock.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import ESLintEditor from '../eslint/ESLintEditor.svelte';
44
import { preprocess, postprocess, createLinterConfig } from '../eslint/scripts/linter.js';
55
import { loadTsParser } from '../eslint/scripts/ts-parser.js';
6-
import { loadModulesForBrowser } from '../../../../src/utils/load-module';
6+
import { loadModulesForBrowser } from '../../../../packages/eslint-plugin-svelte/src/utils/load-module.ts';
77
import { Linter } from 'eslint';
88
import globals from 'globals';
99

docs-svelte-kit/src/lib/components/ESLintPlayground.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
createLinterConfig
1111
} from '../eslint/scripts/linter.js';
1212
import { loadTsParser } from '../eslint/scripts/ts-parser.js';
13-
import { loadModulesForBrowser } from '../../../../src/utils/load-module';
13+
import { loadModulesForBrowser } from '../../../../packages/eslint-plugin-svelte/src/utils/load-module.ts';
1414
import { Linter } from 'eslint';
1515
import globals from 'globals';
1616
let tsParser = null;

docs-svelte-kit/src/lib/eslint/scripts/linter.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import { rules as pluginRules } from '../../../../../src/utils/rules.ts';
1+
import { rules as pluginRules } from '../../../../../packages/eslint-plugin-svelte/src/utils/rules.ts';
22
import { builtinRules } from 'eslint/use-at-your-own-risk';
33
import * as svelteEslintParser from 'svelte-eslint-parser';
44

5-
export { preprocess, postprocess } from '../../../../../src/processor/index.ts';
5+
export {
6+
preprocess,
7+
postprocess
8+
} from '../../../../../packages/eslint-plugin-svelte/src/processor/index.ts';
69

710
export const categories = [
811
{

docs-svelte-kit/src/lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { rules } from '../../../src/utils/rules.ts';
1+
import { rules } from '../../../packages/eslint-plugin-svelte/src/utils/rules.ts';
22
import { readable, writable } from 'svelte/store';
33
import { page } from '$app/stores';
44
import { base as baseUrl } from '$app/paths';
File renamed without changes.

svelte.config.mjs renamed to docs-svelte-kit/svelte.config.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ const config = {
3939
assets: outDir
4040
}),
4141
files: {
42-
routes: path.join(dirname, './docs-svelte-kit/src/routes'),
43-
appTemplate: path.join(dirname, './docs-svelte-kit/src/app.html'),
42+
routes: path.join(dirname, './src/routes'),
43+
appTemplate: path.join(dirname, './src/app.html'),
4444
hooks: {
45-
server: path.join(dirname, './docs-svelte-kit/src/hooks/server'),
46-
client: path.join(dirname, './docs-svelte-kit/src/hooks/client')
45+
server: path.join(dirname, './src/hooks/server'),
46+
client: path.join(dirname, './src/hooks/client')
4747
},
48-
lib: path.join(dirname, './docs-svelte-kit/src/lib'),
49-
assets: path.join(dirname, './docs-svelte-kit/statics')
48+
lib: path.join(dirname, './src/lib'),
49+
assets: path.join(dirname, './statics')
5050
}
5151
}
5252
};

docs-svelte-kit/tsconfig.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "./.svelte-kit/tsconfig.json",
3+
"compilerOptions": {
4+
"target": "es2020",
5+
"module": "NodeNext",
6+
"moduleResolution": "Node16",
7+
"lib": ["es2020", "dom"],
8+
"allowJs": true,
9+
"checkJs": true,
10+
"declaration": true,
11+
"strict": true,
12+
"noImplicitAny": true,
13+
14+
"noUnusedLocals": true,
15+
"noUnusedParameters": true,
16+
"noImplicitReturns": true,
17+
"noFallthroughCasesInSwitch": true,
18+
"baseUrl": ".",
19+
"esModuleInterop": true,
20+
"outDir": "lib",
21+
"skipLibCheck": true,
22+
"resolveJsonModule": true
23+
},
24+
"include": ["vite.config.ts", "**/*.mts", "**/*.ts"]
25+
}

vite.config.mts renamed to docs-svelte-kit/vite.config.mts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import path from 'path';
33
// @ts-expect-error -- Missing types
44
import svelteMd from 'vite-plugin-svelte-md';
55
import eslint4b, { requireESLintUseAtYourOwnRisk4b } from 'vite-plugin-eslint4b';
6-
import svelteMdOption from './docs-svelte-kit/tools/vite-plugin-svelte-md-option.mjs';
6+
import svelteMdOption from './tools/vite-plugin-svelte-md-option.mjs';
77

8-
import './docs-svelte-kit/build-system/build.mts';
9-
import generateRoutes from './docs-svelte-kit/tools/generate-routes.mjs';
8+
import './build-system/build.ts';
9+
import generateRoutes from './tools/generate-routes.mjs';
1010
import type { UserConfig } from 'vite';
1111
import { fileURLToPath } from 'url';
1212

@@ -20,7 +20,7 @@ const config: UserConfig = {
2020
svelteMd(
2121
svelteMdOption({
2222
baseUrl: '/eslint-plugin-svelte',
23-
root: path.join(dirname, './docs')
23+
root: path.join(dirname, '../docs')
2424
})
2525
),
2626
sveltekit(),
@@ -32,15 +32,15 @@ const config: UserConfig = {
3232
},
3333
resolve: {
3434
alias: {
35-
assert: path.join(dirname, './docs-svelte-kit/shim/assert.mjs'),
36-
'postcss-load-config': path.join(dirname, './docs-svelte-kit/shim/postcss-load-config.mjs'),
37-
'source-map-js': path.join(dirname, './docs-svelte-kit/shim/source-map-js.mjs'),
38-
module: path.join(dirname, './docs-svelte-kit/shim/module.mjs'),
39-
url: path.join(dirname, './docs-svelte-kit/shim/url.mjs'),
40-
os: path.join(dirname, './docs-svelte-kit/shim/os.mjs'),
41-
fs: path.join(dirname, './docs-svelte-kit/shim/fs.mjs'),
42-
globby: path.join(dirname, './docs-svelte-kit/shim/globby.mjs'),
43-
picocolors: path.join(dirname, './docs-svelte-kit/shim/picocolors.mjs'),
35+
assert: path.join(dirname, './shim/assert.mjs'),
36+
'postcss-load-config': path.join(dirname, './shim/postcss-load-config.mjs'),
37+
'source-map-js': path.join(dirname, './shim/source-map-js.mjs'),
38+
module: path.join(dirname, './shim/module.mjs'),
39+
url: path.join(dirname, './shim/url.mjs'),
40+
os: path.join(dirname, './shim/os.mjs'),
41+
fs: path.join(dirname, './shim/fs.mjs'),
42+
globby: path.join(dirname, './shim/globby.mjs'),
43+
picocolors: path.join(dirname, './shim/picocolors.mjs'),
4444
tslib: path.join(dirname, './node_modules/tslib/tslib.es6.js'),
4545

4646
// Alias to CJS

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
packages:
22
- 'packages/*'
3+
- 'docs-svelte-kit'

0 commit comments

Comments
 (0)