Skip to content

Commit ecb4816

Browse files
committed
chore: init commit
0 parents  commit ecb4816

Some content is hidden

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

48 files changed

+22322
-0
lines changed

.eslintrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "@baiwusanyu",
3+
"rules": {
4+
"no-console": ["warn", { "allow": ["log"] }]
5+
}
6+
}

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Project exclude paths
2+
/build/node_modules/
3+
/node_modules/
4+
/packages/**/node_modules/
5+
/playground/**/node_modules/
6+
/playground/node_modules/
7+
/utils/node_modules/
8+
dist

.idea/.gitignore

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/svelte-kit-inspector.iml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
auto-install-peers=true
2+
strict-peer-dependencies=false

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 白雾三语
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

build.config.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: [
5+
'src/index',
6+
],
7+
clean: false,
8+
declaration: true,
9+
externals: [
10+
'vite',
11+
],
12+
rollup: {
13+
emitCJS: true,
14+
inlineDependencies: true,
15+
},
16+
})

build/index.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
import {defineConfig, Options} from 'tsup'
3+
4+
const config = {
5+
entry: ['src/index.ts'],
6+
external: [
7+
'magic-string',
8+
],
9+
format: ['cjs', 'esm'],
10+
clean: true,
11+
minify: false,
12+
dts: true,
13+
14+
}
15+
16+
export default defineConfig(config as Options)

package.json

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"name": "svelte-kit-inspector",
3+
"description": "jump to local IDE source code while click the element of browser automatically.",
4+
"private": false,
5+
"type": "module",
6+
"version": "1.0.0",
7+
"packageManager": "[email protected]",
8+
"keywords": [
9+
"typescript",
10+
"javascript",
11+
"DX",
12+
"vue",
13+
"vue3",
14+
"vite",
15+
"react",
16+
"svelte",
17+
"web component"
18+
],
19+
"license": "MIT",
20+
"author": "baiwusanyu-c",
21+
"homepage": "https://github.com/baiwusanyu-c",
22+
"repository": "https://github.com/baiwusanyu-c/svelte-kit-inspector",
23+
"bugs": "https://github.com/baiwusanyu-c/svelte-kit-inspector/issues",
24+
"exports": {
25+
".": {
26+
"types": "./dist/index.d.ts",
27+
"require": "./dist/index.cjs",
28+
"import": "./dist/index.mjs"
29+
},
30+
"./*": "./*"
31+
},
32+
"main": "dist/index.cjs",
33+
"module": "dist/index.mjs",
34+
"types": "dist/index.d.ts",
35+
"files": [
36+
"dist",
37+
"*.d.ts",
38+
"README.md"
39+
],
40+
"engines": {
41+
"node": ">=v14"
42+
},
43+
"typesVersions": {
44+
"*": {
45+
"*": [
46+
"./dist/*",
47+
"./dist/index.d.ts"
48+
]
49+
}
50+
},
51+
"scripts": {
52+
"init": "pnpm i",
53+
"dev": "unbuild --stub",
54+
"play": "pnpm run --filter svelte-kit-inspector-playground dev",
55+
"build": "tsup --config ./build/index.ts",
56+
"release": "bumpp package.json --commit --push --tag",
57+
"publish": "pnpm publish --no-git-checks --access public",
58+
"lint:fix": "eslint --fix ./ --ext .vue,.js,.ts,.jsx,.tsx,.json",
59+
"clean": "rimraf dist",
60+
"prepare": "npx simple-git-hooks"
61+
},
62+
"peerDependencies": {
63+
"baiwusanyu-utils": "^1.0.8",
64+
"magic-string": "^0.30.0"
65+
},
66+
"dependencies": {
67+
"ansi-colors": "^4.1.3",
68+
"baiwusanyu-utils": "^1.0.14",
69+
"magic-string": "^0.30.0"
70+
},
71+
"devDependencies": {
72+
"@baiwusanyu/eslint-config": "^1.0.12",
73+
"bumpp": "^9.1.0",
74+
"cross-env": "^7.0.3",
75+
"eslint": "^8.40.0",
76+
"esno": "^0.16.3",
77+
"git-ensure": "^0.1.0",
78+
"gulp": "^4.0.2",
79+
"jsdom": "^22.0.0",
80+
"lint-staged": "^13.2.2",
81+
"magic-string-ast": "^0.1.2",
82+
"npm-run-all": "^4.1.5",
83+
"rimraf": "^5.0.1",
84+
"rollup": "^3.21.6",
85+
"simple-git-hooks": "^2.8.1",
86+
"sucrase": "^3.32.0",
87+
"tsup": "^6.7.0",
88+
"typescript": "5.1.3",
89+
"vite": "^4.4.4",
90+
"unbuild": "^1.2.1"
91+
},
92+
"simple-git-hooks": {
93+
"pre-commit": "pnpm lint-staged",
94+
"commit-msg": "node vertify-commit.js"
95+
},
96+
"lint-staged": {
97+
"*.{vue,js,ts,jsx,tsx,md,json}": [
98+
"eslint ./ --fix"
99+
]
100+
},
101+
"publishConfig": {
102+
"access": "public"
103+
},
104+
"eslintConfig": {
105+
"extends": [
106+
"@baiwusanyu"
107+
]
108+
}
109+
}

playground/.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
.vercel
10+
.output
11+
vite.config.js.timestamp-*
12+
vite.config.ts.timestamp-*

playground/.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
engine-strict=true
2+
resolution-mode=highest

playground/README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# create-svelte
2+
3+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4+
5+
## Creating a project
6+
7+
If you're seeing this, you've probably already done this step. Congrats!
8+
9+
```bash
10+
# create a new project in the current directory
11+
npm create svelte@latest
12+
13+
# create a new project in my-app
14+
npm create svelte@latest my-app
15+
```
16+
17+
## Developing
18+
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
21+
```bash
22+
npm run dev
23+
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
27+
28+
## Building
29+
30+
To create a production version of your app:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

playground/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "svelte-kit-inspector-playground",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"dev": "vite dev",
6+
"build": "vite build",
7+
"preview": "vite preview",
8+
"check": "svelte-kit sync && svelte-check --tsconfig tsconfig.json",
9+
"check:watch": "svelte-kit sync && svelte-check --tsconfig tsconfig.json --watch"
10+
},
11+
"devDependencies": {
12+
"@fontsource/fira-mono": "^4.5.10",
13+
"@neoconfetti/svelte": "^1.0.0",
14+
"@sveltejs/adapter-auto": "^2.0.0",
15+
"@sveltejs/kit": "^1.20.4",
16+
"@types/cookie": "^0.5.1",
17+
"svelte": "^4.0.5",
18+
"svelte-check": "^3.4.3",
19+
"tslib": "^2.4.1",
20+
"typescript": "^5.0.0",
21+
"vite": "^4.4.2",
22+
"svelte-kit-inspector": "workspace:*"
23+
},
24+
"type": "module"
25+
}

playground/src/app.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// See https://kit.svelte.dev/docs/types#app
2+
// for information about these interfaces
3+
declare global {
4+
namespace App {
5+
// interface Error {}
6+
// interface Locals {}
7+
// interface PageData {}
8+
// interface Platform {}
9+
}
10+
}
11+
12+
export {};

playground/src/app.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6+
<meta name="viewport" content="width=device-width" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover">
10+
<div style="display: contents">%sveltekit.body%</div>
11+
</body>
12+
</html>

playground/src/lib/images/github.svg

+16
Loading
Loading
352 KB
Loading
113 KB
Binary file not shown.

playground/src/routes/+layout.svelte

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<script>
2+
import Header from './Header.svelte';
3+
import './styles.css';
4+
</script>
5+
6+
<div class="app">
7+
<Header />
8+
9+
<main>
10+
<slot />
11+
</main>
12+
13+
<footer>
14+
<p>visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to learn SvelteKit</p>
15+
</footer>
16+
</div>
17+
18+
<style>
19+
.app {
20+
display: flex;
21+
flex-direction: column;
22+
min-height: 100vh;
23+
}
24+
25+
main {
26+
flex: 1;
27+
display: flex;
28+
flex-direction: column;
29+
padding: 1rem;
30+
width: 100%;
31+
max-width: 64rem;
32+
margin: 0 auto;
33+
box-sizing: border-box;
34+
}
35+
36+
footer {
37+
display: flex;
38+
flex-direction: column;
39+
justify-content: center;
40+
align-items: center;
41+
padding: 12px;
42+
}
43+
44+
footer a {
45+
font-weight: bold;
46+
}
47+
48+
@media (min-width: 480px) {
49+
footer {
50+
padding: 12px 0;
51+
}
52+
}
53+
</style>

0 commit comments

Comments
 (0)