Skip to content

Commit 74e0f0b

Browse files
chore: migrate to monorepo (#759)
WIP. Still there are a lot of todos. -> I will continue work on next weekend. (18th, 19th May) --------- Co-authored-by: yosuke ota <[email protected]>
1 parent 7e4e258 commit 74e0f0b

File tree

1,887 files changed

+463
-607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,887 files changed

+463
-607
lines changed

.browserslistrc

-1
This file was deleted.

.github/workflows/GHPages.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@ jobs:
2828
- uses: pnpm/action-setup@v2
2929
- uses: actions/setup-node@v4
3030
- name: Install And Build
31-
run: |+
31+
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

.github/workflows/NodeCI.yml

+54-20
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [main]
88

9+
env:
10+
project_root_path: ./packages/eslint-plugin-svelte
11+
912
jobs:
1013
lint:
1114
runs-on: ubuntu-latest
@@ -15,12 +18,20 @@ jobs:
1518
- uses: actions/setup-node@v4
1619
- name: Install Packages
1720
run: pnpm install
18-
- name: Lint
19-
run: |+
21+
- name: Lint eslint-plugin-svelte
22+
run: |
2023
pnpm run build
2124
pnpm run lint
25+
working-directory: ${{ env.project_root_path }}
26+
- name: Lint docs-svelte-kit
27+
run: |
28+
pnpm run build
29+
pnpm run lint
30+
working-directory: ./docs-svelte-kit
2231
- name: Type Coverage
2332
run: pnpm run typecov
33+
working-directory: ${{ env.project_root_path }}
34+
2435
build:
2536
runs-on: ubuntu-latest
2637
steps:
@@ -30,9 +41,11 @@ jobs:
3041
- name: Install Packages
3142
run: pnpm install
3243
- name: Build
33-
run: |+
44+
run: |
3445
pnpm run update
3546
pnpm run build
47+
working-directory: ${{ env.project_root_path }}
48+
3649
test:
3750
name: 'Test for ESLint ${{ matrix.eslint }} on Node.js: ${{ matrix.node }} OS: ${{matrix.os}}'
3851
runs-on: ${{ matrix.os }}
@@ -49,15 +62,23 @@ jobs:
4962
uses: actions/setup-node@v4
5063
with:
5164
node-version: ${{ matrix.node }}
52-
- name: Install ESLint ${{ matrix.eslint }}
53-
run: |+
54-
pnpm install -D eslint@${{ matrix.eslint }}
55-
rm -rf node_modules
56-
if: matrix.eslint != 9
5765
- name: Install Packages
5866
run: pnpm install
67+
- name: Build eslint-plugin-svelte
68+
run: pnpm build
69+
working-directory: ${{ env.project_root_path }}
70+
# Hack: Install `eslint-plugin-svelte` is necessary for `packages/eslint-plugin-svelte/tests/src/configs` tests.
71+
- name: Install eslint-plugin-svelte
72+
run: pnpm install -D eslint-plugin-svelte
73+
working-directory: ${{ env.project_root_path }}
74+
- name: Install ESLint ${{ matrix.eslint }}
75+
if: matrix.eslint != 9
76+
run: pnpm install -D -w eslint@${{ matrix.eslint }}
77+
5978
- name: Test
60-
run: pnpm run test
79+
run: pnpm test
80+
working-directory: ${{ env.project_root_path }}
81+
6182
test-for-svelte-v4:
6283
name: 'Test for Svelte v4 on Node.js: ${{ matrix.node }} OS: ${{matrix.os}}'
6384
runs-on: ${{ matrix.os }}
@@ -83,17 +104,20 @@ jobs:
83104
with:
84105
node-version: ${{ matrix.node }}
85106
- name: Install svelte@4
86-
run: |+
107+
run: |
87108
pnpm install -D svelte@4
88109
rm -rf node_modules
110+
working-directory: ${{ env.project_root_path }}
89111
- name: Install ESLint ${{ matrix.eslint }}
90-
run: |+
91-
pnpm install -D eslint@${{ matrix.eslint }}
112+
run: |
113+
pnpm install -D -w eslint@${{ matrix.eslint }}
92114
rm -rf node_modules
93115
- name: Install Packages
94116
run: pnpm install
95117
- name: Test
96118
run: pnpm run test
119+
working-directory: ${{ env.project_root_path }}
120+
97121
test-for-svelte-v3:
98122
name: Test for Svelte v3
99123
runs-on: ${{ matrix.os }}
@@ -109,18 +133,25 @@ jobs:
109133
uses: actions/setup-node@v4
110134
with:
111135
node-version: ${{ matrix.node }}
112-
- name: Remove @sveltejs/kit # Remove @sveltejs/kit because postinstall fails on old node.
113-
run: |+
114-
pnpm rm @sveltejs/kit
115-
rm -rf node_modules
116136
- name: Install svelte@3
117-
run: |+
118-
pnpm install -D svelte@3 @typescript-eslint/parser@5 @typescript-eslint/eslint-plugin@5 eslint@8
137+
# Remove @sveltejs/kit because postinstall fails on old node.
138+
run: |
139+
cd docs-svelte-kit
140+
pnpm rm @sveltejs/kit
141+
cd ..
142+
pnpm install -D -w @typescript-eslint/parser@5 @typescript-eslint/eslint-plugin@5 eslint@8
143+
cd packages/eslint-plugin-svelte
144+
pnpm install -D svelte@3
145+
cd ../..
146+
rm -rf packages/eslint-plugin-svelte/node_modules
147+
rm -rf docs-svelte-kit/node_modules
119148
rm -rf node_modules
120149
- name: Install Packages
121150
run: pnpm install
122151
- name: Test
123152
run: pnpm run test
153+
working-directory: ${{ env.project_root_path }}
154+
124155
test-for-typescript-eslint-v5:
125156
name: Test for typescript-eslint v5
126157
runs-on: ${{ matrix.os }}
@@ -137,13 +168,15 @@ jobs:
137168
with:
138169
node-version: ${{ matrix.node }}
139170
- name: Install typescript-eslint v5
140-
run: |+
141-
pnpm install -D @typescript-eslint/parser@5 @typescript-eslint/eslint-plugin@5
171+
run: |
172+
pnpm install -D -w @typescript-eslint/parser@5 @typescript-eslint/eslint-plugin@5
142173
rm -rf node_modules
143174
- name: Install Packages
144175
run: pnpm install
145176
- name: Test
146177
run: pnpm run test
178+
working-directory: ${{ env.project_root_path }}
179+
147180
update-resources:
148181
runs-on: ubuntu-latest
149182
steps:
@@ -156,6 +189,7 @@ jobs:
156189
run: pnpm install
157190
- name: Update resources
158191
run: pnpm run update
192+
working-directory: ${{ env.project_root_path }}
159193
- name: Check changes
160194
run: |
161195
git add --all && \

.github/workflows/format.yml

-33
This file was deleted.

.gitignore

+5-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ dist
102102

103103
## repo
104104
/pnpm-lock.yaml
105-
/lib
106-
/.svelte-kit
107-
/.type-coverage
108-
/build
105+
packages/eslint-plugin-svelte/lib
106+
packages/eslint-plugin-svelte/.type-coverage
107+
108+
docs-svelte-kit/.svelte-kit
109+
docs-svelte-kit/build
109110
/svelte.config-dist.js
110111
/docs-svelte-kit/shim/eslint.mjs
111112
/docs-svelte-kit/shim/assert.mjs

.stylelintignore

-22
This file was deleted.

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

+1-1
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/eslint.config.mjs

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import * as myPlugin from '@ota-meshi/eslint-plugin';
2+
import globals from 'globals';
3+
4+
/**
5+
* @type {import('eslint').Linter.FlatConfig[]}
6+
*/
7+
const config = [
8+
{
9+
ignores: [
10+
'node_modules/',
11+
'.svelte-kit/',
12+
'build/',
13+
'shim/eslint.mjs',
14+
'shim/assert.mjs',
15+
'src/routes/*.md',
16+
'src/routes/**/*.md',
17+
'src/app.html'
18+
]
19+
},
20+
...myPlugin.config({
21+
eslintPlugin: true,
22+
ts: true,
23+
json: true,
24+
packageJson: true,
25+
yaml: true,
26+
md: true,
27+
prettier: true,
28+
svelte: { withTs: false }
29+
}),
30+
{
31+
languageOptions: {
32+
sourceType: 'module',
33+
globals: {
34+
...globals.browser,
35+
require: 'readonly'
36+
}
37+
}
38+
},
39+
{
40+
rules: {
41+
'jsdoc/require-jsdoc': 'off',
42+
'@typescript-eslint/no-shadow': 'off',
43+
'no-shadow': 'off',
44+
'@typescript-eslint/naming-convention': 'off',
45+
'new-cap': 'off',
46+
complexity: 'off',
47+
'n/no-missing-import': 'off',
48+
'n/file-extension-in-import': 'off',
49+
'n/no-extraneous-import': 'off'
50+
}
51+
},
52+
{
53+
files: ['**/*.svelte'],
54+
languageOptions: {
55+
parserOptions: { project: null }
56+
}
57+
}
58+
];
59+
export default config;

docs-svelte-kit/package.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "docs",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"lint": "eslint --cache .",
7+
"lint-fix": "eslint --cache . --fix",
8+
"build": "cd ../packages/eslint-plugin-svelte && pnpm build && cd ../../docs-svelte-kit && pnpm run svelte-kit build",
9+
"preview": "pnpm run svelte-kit preview",
10+
"dev": "pnpm run svelte-kit dev",
11+
"svelte-kit": "vite"
12+
},
13+
"devDependencies": {
14+
"@babel/core": "^7.24.5",
15+
"@babel/types": "^7.24.5",
16+
"@fontsource/fira-mono": "^5.0.13",
17+
"@ota-meshi/eslint-plugin": "^0.17.1",
18+
"@sindresorhus/slugify": "^2.2.1",
19+
"@sveltejs/adapter-static": "^3.0.1",
20+
"@sveltejs/kit": "^2.5.9",
21+
"@sveltejs/vite-plugin-svelte": "^3.1.0",
22+
"@types/babel__core": "^7.20.5",
23+
"@types/cross-spawn": "^6.0.6",
24+
"@types/escape-html": "^1.0.4",
25+
"@types/eslint-scope": "^3.7.7",
26+
"@types/eslint-visitor-keys": "^3.3.0",
27+
"@types/less": "^3.0.6",
28+
"@types/markdown-it": "^14.1.1",
29+
"@types/markdown-it-container": "^2.0.10",
30+
"@types/markdown-it-emoji": "^3.0.1",
31+
"@types/node": "^20.12.12",
32+
"@types/prismjs": "^1.26.4",
33+
"@types/stylus": "^0.48.42",
34+
"@typescript/vfs": "^1.5.0",
35+
"acorn": "^8.11.3",
36+
"assert": "^2.1.0",
37+
"cross-spawn": "^7.0.3",
38+
"env-cmd": "^10.1.0",
39+
"esbuild": "^0.21.3",
40+
"escape-html": "^1.0.3",
41+
"eslint-plugin-svelte": "workspace:^",
42+
"eslint-scope": "^8.0.1",
43+
"eslint-visitor-keys": "^4.0.0",
44+
"espree": "^10.0.1",
45+
"globals": "^15.2.0",
46+
"markdown-it-anchor": "^8.6.7",
47+
"markdown-it-container": "^4.0.0",
48+
"markdown-it-emoji": "^3.0.0",
49+
"pako": "^2.1.0",
50+
"postcss-nested": "^6.0.1",
51+
"prism-svelte": "^0.5.0",
52+
"prismjs": "^1.29.0",
53+
"sass": "^1.77.2",
54+
"source-map-js": "^1.2.0",
55+
"stylus": "^0.63.0",
56+
"svelte": "^5.0.0-next.112",
57+
"svelte-adapter-ghpages": "0.2.2",
58+
"util": "^0.12.5",
59+
"vite": "^5.2.11",
60+
"vite-plugin-eslint4b": "^0.4.2",
61+
"vite-plugin-svelte-md": "^0.1.7"
62+
}
63+
}
+2-2
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 };

0 commit comments

Comments
 (0)