@idleberg/vite-plugin-devcert 0.1.1 → 0.2.0

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 CHANGED
@@ -9,20 +9,20 @@
9
9
  [![CI: Deno](https://img.shields.io/github/actions/workflow/status/idleberg/vite-plugin-devcert/deno.yml?logo=deno&logoColor=white&style=for-the-badge)](https://github.com/idleberg/vite-plugin-devcert/actions/workflows/deno.yml)
10
10
 
11
11
  > [!IMPORTANT]
12
- > This plugin is based on `@expo/devcert`, an actively maintained fork of `devcert`. Read about [how it works](https://github.com/expo/devcert/tree/master?tab=readme-ov-file#how-it-works) and what the [security concerns](https://github.com/expo/devcert/tree/master?tab=readme-ov-file#security-concerns) are.
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 what it means for [security](https://github.com/expo/devcert/#security-concerns).
13
13
 
14
14
  ## Installation
15
15
 
16
16
  On NodeJS or Bun you can install 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
22
  On Deno you can install using 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 more](https://github.com/expo/devcert#skiphostsfile).
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 more](https://github.com/expo/devcert#skipcertutil).
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://github.com/vitejs/vite-plugin-basic-ssl)
56
- - [vite-plugin-mkcert](https://github.com/vite-plugin/vite-plugin-mkcert)
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.js CHANGED
@@ -1 +1,4 @@
1
- import {certificateFor}from'@expo/devcert';import l from'log-symbols';function c(r){return {name:"@idleberg/vite-plugin-devcert",config:async(t,{command:n})=>{if(n!=="serve")return;let{server:e}=t;if(e?.https?.key&&e?.https?.cert)return console.warn(`${l.warning} Skipping devcert, key and cert already provided.`),t;let i=e?.host&&typeof e.host=="string"?e.host:"localhost",{key:o,cert:s}=await certificateFor(i,r);return {...t,server:{...e,https:{...e?.https,key:o??void 0,cert:s??void 0}}}}}}export{c as default};
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
+ ${r.info} Generating certificate for "${o}".`,"You may be prompted to enter your password to allow the creation of root certificate authority.",`
3
+ Please refer to documentation at https://github.com/expo/devcert#how-it-works for details.
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.1",
3
+ "version": "0.2.0",
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
- "vite": ">=1.0.0 <7.0.0"
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
- "test": "echo \"No tests specified\" && exit 0"
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
  }