@idleberg/vite-plugin-devcert 0.5.0 → 0.5.2

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/LICENSE CHANGED
@@ -1,21 +1,20 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2025 Jan T. Sott
3
+ Copyright (c) 2025, 2026 Jan T. Sott
4
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:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
11
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
14
 
15
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
21
- THE SOFTWARE.
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -9,6 +9,7 @@
9
9
 
10
10
 
11
11
  > [!IMPORTANT]
12
+ >
12
13
  > 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
14
 
14
15
  ## Installation 💿
@@ -56,6 +57,8 @@ Hide the info box displayed at startup.
56
57
 
57
58
  ## Related 👫
58
59
 
60
+ If this project is not for you, maybe these alternatives suit you better:
61
+
59
62
  - [vite-plugin-basic-ssl](https://www.npmjs.com/package/@vitejs/plugin-basic-ssl)
60
63
  - [vite-plugin-mkcert](https://www.npmjs.com/package/vite-plugin-mkcert)
61
64
 
@@ -11,6 +11,7 @@ type PluginOptions = {
11
11
  * @param options Options passed on to `@expo/devcert`
12
12
  * @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}}
13
13
  * @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}}
14
+ * @param options.hideInfoBox Hide the info box displayed at startup
14
15
  * @returns a Vite plugin
15
16
  */
16
17
  declare function DevcertPlugin(options?: PluginOptions): Plugin;
@@ -1 +1 @@
1
- import{env as e}from"node:process";import{certificateFor as t}from"@expo/devcert";import n from"boxen";import{cyan as r,underline as i}from"kleur/colors";import a from"log-symbols";function o(e={}){return{name:`@idleberg/vite-plugin-devcert`,config:async(n,{command:o})=>{if(o!==`serve`)return;let{server:c}=n;if(c?.https?.key&&c?.https?.cert)return console.warn(`${a.warning} Skipping devcert, key and cert already provided.`),n;let l=c?.host&&typeof c.host==`string`?c.host:`localhost`,{hideInfoBox:u,...d}=e;u||console.info(s([`Generating a certificate for "${r(l)}".`,`You may be prompted to enter your password to allow the creation of a root certificate authority.`,`\n\nFor details, please refer to the Expo documentation at ${i(`https://github.com/expo/devcert#how-it-works`)}.`].join(` `)));let{key:f,cert:p}=await t(l,d);return{...n,server:{...c,https:{...c?.https,key:f??void 0,cert:p??void 0}}}}}}function s(t){return n(t.trim(),{borderColor:e.NO_COLOR?void 0:`blue`,margin:{top:1,bottom:1},padding:1,title:`vite-plugin-devcert`})}export{o as default};
1
+ import{env as e}from"node:process";import{certificateFor as t}from"@expo/devcert";import n from"boxen";import{cyan as r,underline as i}from"kleur/colors";import a from"log-symbols";function o(e={}){return{name:`@idleberg/vite-plugin-devcert`,config:async(n,{command:o})=>{if(o!==`serve`)return;let{server:c}=n;if(c?.https?.key&&c?.https?.cert)return console.warn(`${a.warning} Skipping devcert, key and cert already provided.`),n;let l=c?.host&&typeof c.host==`string`?c.host:`localhost`,{hideInfoBox:u,...d}=e;u||console.info(s([`Generating a certificate for "${r(l)}".`,`You may be prompted to enter your password to allow the creation of a root certificate authority.`,`\n\nFor details, please refer to the Expo documentation at ${i(`https://github.com/expo/devcert#how-it-works`)}.`].join(` `)));try{let{key:e,cert:r}=await t(l,d);return!e||!r?(console.error(`${a.error} Failed to generate certificates`),n):{...n,server:{...c,https:{...typeof c?.https==`object`?c.https:{},key:e,cert:r}}}}catch(e){return console.error(`${a.error} Certificate generation failed:`,e),n}}}}function s(t){return n(t.trim(),{borderColor:e.NO_COLOR?void 0:`blue`,margin:{top:1,bottom:1},padding:1,title:`vite-plugin-devcert`})}export{o as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idleberg/vite-plugin-devcert",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
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",
@@ -17,10 +17,9 @@
17
17
  ],
18
18
  "type": "module",
19
19
  "exports": {
20
- "types": "./dist/plugin.d.ts",
21
- "import": "./dist/plugin.js"
20
+ "types": "./dist/plugin.d.mts",
21
+ "import": "./dist/plugin.mjs"
22
22
  },
23
- "types": "./dist/plugin.d.ts",
24
23
  "engines": {
25
24
  "node": "^20.19.0 || >=22.12.0"
26
25
  },
@@ -35,26 +34,29 @@
35
34
  "log-symbols": "^7.0.1"
36
35
  },
37
36
  "devDependencies": {
38
- "@commitlint/cli": "^20.1.0",
39
- "@commitlint/config-conventional": "^20.0.0",
40
- "@idleberg/configs": "^0.3.1",
41
- "@playwright/test": "^1.56.1",
37
+ "@commitlint/cli": "^20.3.1",
38
+ "@commitlint/config-conventional": "^20.3.1",
39
+ "@expo/devcert": "^1.2.1",
40
+ "@idleberg/configs": "^0.4.1",
41
+ "@playwright/test": "^1.57.0",
42
42
  "@types/node": "^24.9.1",
43
43
  "concurrently": "^9.2.1",
44
44
  "np": "^10.2.0",
45
- "tsdown": "^0.15.9",
45
+ "tsdown": "^0.19.0",
46
46
  "typescript": "^5.9.3",
47
- "vite": "^7.1.12",
48
- "vitest": "^3.2.4"
47
+ "vite": "^7.3.1",
48
+ "vitest": "^4.0.16"
49
49
  },
50
50
  "peerDependencies": {
51
- "@expo/devcert": "^1.2.0",
52
- "vite": "^5.0.0 || ^6.0.0 || >=7.0.0"
51
+ "@expo/devcert": "^1.2.1",
52
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-beta"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsdown",
56
56
  "dev": "tsdown --watch",
57
- "lint": "biome check",
57
+ "lint": "concurrently --prefix-colors blue,green,magenta npm:lint:*",
58
+ "lint:biome": "biome check",
59
+ "lint:e18e": "e18e-cli analyze",
58
60
  "publish:jsr": "deno publish",
59
61
  "publish:npm": "np --any-branch",
60
62
  "server": "concurrently -n 'e2e,unit' -c 'blue,green' 'npm:server:*'",