Skip to content

Commit

Permalink
chore: initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Sep 7, 2022
1 parent b965ef4 commit d9b5eee
Show file tree
Hide file tree
Showing 15 changed files with 5,155 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build/
dist/
dev-dist/
node_modules/
*.svelte
*.d.ts
!.vitepress/dist/
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": ["@antfu"],
"overrides": [
{
"files": [
"**/*.md/*.*"
],
"rules": {
"@typescript-eslint/no-this-alias": "off",
"n/handle-callback-err": "off",
"no-restricted-syntax": "off",
"no-labels": "off"
}
}
]
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
.DS_Store
dist
dev-dist
# intellij stuff
.idea/
# routify
.routify/
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore-workspace-root-check=true
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=true
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing Guide

Hi! We are really excited that you are interested in contributing to `vite-plugin-pwa`. Before submitting your contribution, please make sure to take a moment and read through the following guide.

Refer also to https://github.com/antfu/contribute.
## Set up your local development environment

The `vite-plugin-pwa` repo is a monorepo using pnpm workspaces. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/).

To develop and test the `vite-plugin-pwa` package:

1. Fork the `vite-plugin-pwa` repository to your own GitHub account and then clone it to your local device.

2. Ensure using the latest Node.js (16.x)

3. `vite-plugin-pwa` uses pnpm v7. If you are working on multiple projects with different versions of pnpm, it's recommend to enable [Corepack](https://github.com/nodejs/corepack) by running `corepack enable`.

4. Check out a branch where you can work and commit your changes:
```shell
git checkout -b my-new-branch
```

5. Run `pnpm i` in `vite-plugin-pwa`'s root folder

6. Run `pnpm run build` in `vite-plugin-pwa`'s root folder.

## Testing changes

The `vite-plugin-pwa` repo includes a set of examples where you can test the changes (you can find them on examples folder), you should check your changes against each framework using the `cli` for running examples:
- `pnpm run examples`: select `vue` framework and default options on the cli (you can also test another options)
- `pnpm run examples`: select `react` framework and default options on the cli (you can also test another options)
- `pnpm run examples`: select `preact` framework and default options on the cli (you can also test another options)
- `pnpm run examples`: select `svelte` framework and default options on the cli (you can also test another options)
- `pnpm run examples`: select `sveltekit` framework and default options on the cli (you can also test another options)
- `pnpm run examples`: select `solid` framework and default options on the cli (you can also test another options)

> The default options from the `cli` are just to check your changes are not breaking major ui/app frameworks build: `generateSW` strategy, `Prompt for update` behavior and `Enable periodic SW updates` to `no`.
> If your changes are specific to some behavior, just use the corresponding option on the `cli`.
## Testing website docs changes

`vite-plugin-pwa` uses `Vitepress` for the website docs, if your changes are about the documentation, you can find the website on the `docs` folder.

Once you made the changes to the documentation, you can test them running `pnpm run docs` from the root folder.

To check the website build, just run `pnpm run docs:serve` from the root folder.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Joaquín Sánchez
Copyright (c) 2020 Anthony Fu<https://github.com/antfu>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 20 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [
'src/index',
],
clean: true,
declaration: true,
externals: [
'vite',
'rollup',
'workbox-build',
],
rollup: {
emitCJS: false,
dts: {
respectExternal: true,
},
},
})
64 changes: 64 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "@vite-pwa/sveltekit",
"version": "0.12.7",
"type": "module",
"packageManager": "[email protected]",
"description": "Zero-config PWA for SvelteKit",
"author": "antfu <[email protected]>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/antfu/vite-plugin-pwa",
"repository": {
"type": "git",
"url": "https://github.com/vite-pwa/sveltekit"
},
"bugs": "https://github.com/vite-pwa/sveltekit/issues",
"keywords": [
"sveltekit",
"workbox",
"vite",
"vite-plugin"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs"
}
},
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"lint": "eslint .",
"lint-fix": "nr lint --fix",
"prepublishOnly": "npm run build",
"release": "npx bumpp --push --tag --commit && npm publish",
"examples": "esno scripts/run-examples.ts"
},
"peerDependencies": {
"vite-plugin-pwa": "^0.12.7"
},
"devDependencies": {
"@antfu/eslint-config": "^0.26.3",
"@antfu/ni": "^0.18.0",
"@types/debug": "^4.1.7",
"@types/node": "^18.7.15",
"@types/prompts": "^2.4.0",
"@types/workbox-build": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^5.36.2",
"eslint": "^8.23.0",
"kolorist": "^1.5.1",
"prompts": "^2.4.2",
"svelte": "^3.50.0",
"typescript": "^4.8.2",
"unbuild": "^0.8.10",
"vite": "^3.1.0",
"vite-plugin-pwa": "file:vite-plugin-pwa-0.12.7.tgz",
"workbox-window": "^6.5.4"
},
"engines": {
"node": ">=16.14"
}
}
Loading

0 comments on commit d9b5eee

Please sign in to comment.