forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: reconfig dev and build env with vite
- Loading branch information
Showing
145 changed files
with
2,566 additions
and
56,370 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
dist | ||
build | ||
/etc |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"plugins": { | ||
"autoprefixer": {"overrideBrowserslist": ["safari >= 13"]} | ||
} | ||
} |
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,5 @@ | ||
node_modules | ||
dist | ||
build | ||
/etc | ||
reset.css |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"svelte.svelte-vscode", | ||
"dbaeumer.vscode-eslint", | ||
"stylelint.vscode-stylelint" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "pnpm: install", | ||
"detail": "Install dev dependencies", | ||
"type": "shell", | ||
"command": "pnpm install", | ||
"group": "build", | ||
"options": { | ||
"cwd": "./" | ||
} | ||
}, | ||
{ | ||
"label": "pnpm: dev", | ||
"detail": "Run dev server", | ||
"type": "shell", | ||
"command": "pnpm dev", | ||
"group": "build", | ||
"options": { | ||
"cwd": "./" | ||
} | ||
}, | ||
{ | ||
"label": "pnpm: build", | ||
"detail": "Build to xcode dist path", | ||
"type": "shell", | ||
"command": "pnpm build", | ||
"group": "build", | ||
"options": { | ||
"cwd": "./" | ||
} | ||
}, | ||
{ | ||
"label": "xcode: build", | ||
"detail": "xcodebuild", | ||
"type": "shell", | ||
"command": "xcodebuild -scheme Userscripts build", | ||
"group": "build", | ||
"options": { | ||
"cwd": "./xcode/" | ||
} | ||
}, | ||
{ | ||
"label": "xcode: rebuild", | ||
"detail": "pnpm build + xcodebuild", | ||
"presentation": { | ||
"reveal": "silent" | ||
}, | ||
"dependsOrder": "sequence", | ||
"dependsOn": [ | ||
"pnpm: build", | ||
"xcode: build" | ||
], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Empty file.
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,23 @@ | ||
The `root` directory is a typical multi-page app of Vite with Svelte JavaScript project. | ||
|
||
The `xcode` directory is the root of the Xcode project where the Safari extension app is built. | ||
|
||
# Environment | ||
- [`Node.js`](https://nodejs.dev/en/learn/how-to-install-nodejs/) | ||
- [`pnpm`](https://pnpm.io/installation) (optional) | ||
- [`Xcode`](https://geo.itunes.apple.com/app/xcode/id497799835) | ||
|
||
# Dev | ||
- `pnpm install` | ||
- `pnpm dev` | ||
|
||
# Build | ||
- `pnpm build` | ||
- `cd ./xcode` | ||
- `xcodebuild` or build with Xcode App | ||
|
||
# Contribute | ||
[Contribution Guidelines](contribute.md) | ||
|
||
# About | ||
Userscripts @ 2022 |
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,47 @@ | ||
# Svelte + Vite | ||
|
||
This template should help get you started developing with Svelte in Vite. | ||
|
||
## Recommended IDE Setup | ||
|
||
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode). | ||
|
||
## Need an official Svelte framework? | ||
|
||
Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more. | ||
|
||
## Technical considerations | ||
|
||
**Why use this over SvelteKit?** | ||
|
||
- It brings its own routing solution which might not be preferable for some users. | ||
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app. | ||
|
||
This template contains as little as possible to get started with Vite + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project. | ||
|
||
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate. | ||
|
||
**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?** | ||
|
||
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information. | ||
|
||
**Why include `.vscode/extensions.json`?** | ||
|
||
Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project. | ||
|
||
**Why enable `checkJs` in the JS template?** | ||
|
||
It is likely that most cases of changing variable types in runtime are likely to be accidental, rather than deliberate. This provides advanced typechecking out of the box. Should you like to take advantage of the dynamically-typed nature of JavaScript, it is trivial to change the configuration. | ||
|
||
**Why is HMR not preserving my local component state?** | ||
|
||
HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr). | ||
|
||
If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR. | ||
|
||
```js | ||
// store.js | ||
// An extremely simple external store | ||
import { writable } from 'svelte/store' | ||
export default writable(0) | ||
``` |
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,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="color-scheme" content="dark"> | ||
<title>background</title> | ||
</head> | ||
<body> | ||
<noscript>Please enable Javascript to use this app</noscript> | ||
<div id="app"></div> | ||
<script type="module" src="/src/background/main.js"></script> | ||
</body> | ||
</html> |
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,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="color-scheme" content="dark"> | ||
<title>Userscripts page</title> | ||
</head> | ||
<body> | ||
<noscript>Please enable Javascript to use this app</noscript> | ||
<div id="app"></div> | ||
<script type="module" src="/src/page/main.js"></script> | ||
</body> | ||
</html> |
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,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="color-scheme" content="dark"> | ||
<title>Userscripts popup</title> | ||
</head> | ||
<body> | ||
<noscript>Please enable Javascript to use this app</noscript> | ||
<div id="app"></div> | ||
<script type="module" src="/src/popup/main.js"></script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
21,518 changes: 0 additions & 21,518 deletions
21,518
extension/Userscripts Extension/Resources/page.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.