@idleberg/vite-plugin-devcert 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/plugin.d.ts +5 -11
- package/dist/plugin.js +1 -1
- package/package.json +14 -8
package/README.md
CHANGED
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
[](https://github.com/idleberg/vite-plugin-devcert/actions/workflows/deno.yml)
|
|
10
10
|
|
|
11
11
|
> [!IMPORTANT]
|
|
12
|
-
> This plugin is based on [`@expo/devcert`](https://www.npmjs.com/package/@expo/devcert), an actively maintained fork of `devcert`. Read about [how it works](https://github.com/expo/devcert/#how-it-works) and
|
|
12
|
+
> This plugin is based on [`@expo/devcert`](https://www.npmjs.com/package/@expo/devcert), an actively maintained fork of `devcert`. Read about [how it works](https://github.com/expo/devcert/#how-it-works) and [its implications on security](https://github.com/expo/devcert/#security-concerns).
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
On NodeJS or Bun
|
|
16
|
+
On NodeJS or Bun, install the plugin and its peer dependencies from npm:
|
|
17
17
|
|
|
18
18
|
```shell
|
|
19
|
-
npm install @idleberg/vite-plugin-devcert
|
|
19
|
+
npm install @idleberg/vite-plugin-devcert @expo/devcert
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
On Deno you
|
|
22
|
+
On Deno you will likely want to use JSR:
|
|
23
23
|
|
|
24
24
|
```shell
|
|
25
|
-
deno add jsr:@idleberg/vite-plugin-devcert
|
|
25
|
+
deno add jsr:@idleberg/vite-plugin-devcert npm:@expo/devcert
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Usage
|
|
@@ -44,16 +44,16 @@ export default defineConfig({
|
|
|
44
44
|
|
|
45
45
|
#### `options.skipHostsFile`
|
|
46
46
|
|
|
47
|
-
If `certutil` is not installed already (for updating NSS databases; e.g. Firefox), do not attempt to install it. [Read the
|
|
47
|
+
If `certutil` is not installed already (for updating NSS databases; e.g. Firefox), do not attempt to install it. [Read the documentation for more](https://github.com/expo/devcert#skiphostsfile).
|
|
48
48
|
|
|
49
49
|
#### `options.skipCertutil`
|
|
50
50
|
|
|
51
|
-
Do not update your systems host file with the domain name of the certificate. [Read the
|
|
51
|
+
Do not update your systems host file with the domain name of the certificate. [Read the documentation for more](https://github.com/expo/devcert#skipcertutil).
|
|
52
52
|
|
|
53
53
|
## Related
|
|
54
54
|
|
|
55
|
-
- [vite-plugin-basic-ssl](https://
|
|
56
|
-
- [vite-plugin-mkcert](https://
|
|
55
|
+
- [vite-plugin-basic-ssl](https://www.npmjs.com/package/@vitejs/plugin-basic-ssl)
|
|
56
|
+
- [vite-plugin-mkcert](https://www.npmjs.com/package/vite-plugin-mkcert)
|
|
57
57
|
|
|
58
58
|
## License
|
|
59
59
|
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
2
|
|
|
3
3
|
type PluginOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* {@see {@link https://github.com/expo/devcert#skiphostsfile}}
|
|
7
|
-
*/
|
|
8
|
-
skipHostsFile: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Do not update your systems host file with the domain name of the certificate.
|
|
11
|
-
* {@see {@link https://github.com/expo/devcert#skipcertutil}}
|
|
12
|
-
*/
|
|
13
|
-
skipCertutil: boolean;
|
|
4
|
+
skipHostsFile?: boolean;
|
|
5
|
+
skipCertutil?: boolean;
|
|
14
6
|
};
|
|
15
7
|
/**
|
|
16
8
|
* Generate trusted SSL/TLS certificates for local development.
|
|
17
|
-
* @param options
|
|
9
|
+
* @param options Options passed on to `@expo/devcert`
|
|
10
|
+
* @param options.skipHostsFile If `certutil` is not installed already (for updating NSS databases; e.g. Firefox), do not attempt to install it {@see {@link https://github.com/expo/devcert#skiphostsfile}}
|
|
11
|
+
* @param options.skipCertutil Do not update your systems host file with the domain name of the certificate {@see {@link https://github.com/expo/devcert#skipcertutil}}
|
|
18
12
|
* @returns a Vite plugin
|
|
19
13
|
*/
|
|
20
14
|
declare function DevcertPlugin(options?: PluginOptions): Plugin;
|
package/dist/plugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {certificateFor}from'@expo/devcert';import r from'log-symbols';function p(i){return {name:"@idleberg/vite-plugin-devcert",config:async(e,{command:n})=>{if(n!=="serve")return;let{server:t}=e;if(t?.https?.key&&t?.https?.cert)return console.warn(`${r.warning} Skipping devcert, key and cert already provided.`),e;let o=t?.host&&typeof t.host=="string"?t.host:"localhost";console.info([`
|
|
1
|
+
import {certificateFor}from'@expo/devcert';import r from'log-symbols';function p(i={}){return {name:"@idleberg/vite-plugin-devcert",config:async(e,{command:n})=>{if(n!=="serve")return;let{server:t}=e;if(t?.https?.key&&t?.https?.cert)return console.warn(`${r.warning} Skipping devcert, key and cert already provided.`),e;let o=t?.host&&typeof t.host=="string"?t.host:"localhost";console.info([`
|
|
2
2
|
${r.info} Generating certificate for "${o}".`,"You may be prompted to enter your password to allow the creation of root certificate authority.",`
|
|
3
3
|
Please refer to documentation at https://github.com/expo/devcert#how-it-works for details.
|
|
4
4
|
`].join(" "));let{key:s,cert:a}=await certificateFor(o,i);return {...e,server:{...t,https:{...t?.https,key:s??void 0,cert:a??void 0}}}}}}export{p as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idleberg/vite-plugin-devcert",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A Vite plugin to generate trusted SSL/TLS certificates for local development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jan T. Sott",
|
|
@@ -10,10 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"vite-plugin",
|
|
13
|
-
"vite-server",
|
|
14
|
-
"server",
|
|
15
|
-
"http-server",
|
|
16
13
|
"certificate",
|
|
14
|
+
"https",
|
|
17
15
|
"ssl",
|
|
18
16
|
"tls"
|
|
19
17
|
],
|
|
@@ -29,23 +27,26 @@
|
|
|
29
27
|
"README.md"
|
|
30
28
|
],
|
|
31
29
|
"dependencies": {
|
|
32
|
-
"@expo/devcert": "^1.2.0",
|
|
33
30
|
"log-symbols": "^7.0.1"
|
|
34
31
|
},
|
|
35
32
|
"devDependencies": {
|
|
36
33
|
"@biomejs/biome": "^1.9.4",
|
|
37
34
|
"@commitlint/cli": "^19.8.1",
|
|
38
35
|
"@commitlint/config-conventional": "^19.8.1",
|
|
36
|
+
"@playwright/test": "^1.52.0",
|
|
39
37
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
40
38
|
"@types/node": "^22.15.21",
|
|
39
|
+
"concurrently": "^9.1.2",
|
|
41
40
|
"lefthook": "^1.11.13",
|
|
42
41
|
"np": "^10.2.0",
|
|
43
42
|
"tsup": "^8.5.0",
|
|
44
43
|
"typescript": "^5.8.3",
|
|
45
|
-
"vite": "^6.3.5"
|
|
44
|
+
"vite": "^6.3.5",
|
|
45
|
+
"vitest": "^3.1.4"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"
|
|
48
|
+
"@expo/devcert": "^1.2.0",
|
|
49
|
+
"vite": "^5.0.0 || >=6.0.0"
|
|
49
50
|
},
|
|
50
51
|
"scripts": {
|
|
51
52
|
"build": "tsup",
|
|
@@ -53,6 +54,11 @@
|
|
|
53
54
|
"lint": "biome check --no-errors-on-unmatched --vcs-enabled=true --vcs-use-ignore-file=true",
|
|
54
55
|
"publish:jsr": "deno publish",
|
|
55
56
|
"publish:npm": "np --any-branch",
|
|
56
|
-
"
|
|
57
|
+
"server": "concurrently -n 'server,client' -c 'blue,green' 'npm:server:*'",
|
|
58
|
+
"server:http": "vite --config e2e/vite.config-http.ts",
|
|
59
|
+
"server:https": "vite --config e2e/vite.config-https.ts",
|
|
60
|
+
"test": "concurrently -n 'server,client' -c 'blue,green' 'npm:test:e2e' 'npm:test:unit'",
|
|
61
|
+
"test:e2e": "playwright test",
|
|
62
|
+
"test:unit": "vitest run --dir src"
|
|
57
63
|
}
|
|
58
64
|
}
|