@idleberg/vite-plugin-devcert 0.2.1 → 0.2.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/README.md CHANGED
@@ -13,32 +13,35 @@
13
13
 
14
14
  ## Installation
15
15
 
16
- On NodeJS or Bun, install the plugin and its peer dependencies from npm:
16
+ On NodeJS or Bun, install from npm:
17
17
 
18
18
  ```shell
19
- npm install @idleberg/vite-plugin-devcert @expo/devcert
19
+ npm install @idleberg/vite-plugin-devcert
20
20
  ```
21
21
 
22
22
  On Deno you will likely want to use JSR:
23
23
 
24
24
  ```shell
25
- deno add jsr:@idleberg/vite-plugin-devcert npm:@expo/devcert
25
+ deno add jsr:@idleberg/vite-plugin-devcert
26
26
  ```
27
27
 
28
+ > [!NOTE]
29
+ > Unless your package manager is set up to install peer dependencies automatically, you need to install `@expo/devcert` yourself.
30
+
28
31
  ## Usage
29
32
 
30
33
  ```javascript
31
34
  import { defineConfig } from "vite";
32
- import devCert from "@idleberg/vite-plugin-devcert";
35
+ import devcert from "@idleberg/vite-plugin-devcert";
33
36
 
34
37
  export default defineConfig({
35
- plugins: [devCert()],
38
+ plugins: [devcert()],
36
39
  });
37
40
  ```
38
41
 
39
42
  ### API
40
43
 
41
- `devCert(options?)`
44
+ `devcert(options?)`
42
45
 
43
46
  ### Options
44
47
 
package/dist/plugin.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Plugin } from 'vite';
1
+ import { Plugin } from "vite";
2
2
 
3
+ //#region src/plugin.d.ts
3
4
  type PluginOptions = {
4
- skipHostsFile?: boolean;
5
- skipCertutil?: boolean;
5
+ skipHostsFile?: boolean;
6
+ skipCertutil?: boolean;
6
7
  };
7
8
  /**
8
9
  * Generate trusted SSL/TLS certificates for local development.
@@ -12,5 +13,5 @@ type PluginOptions = {
12
13
  * @returns a Vite plugin
13
14
  */
14
15
  declare function DevcertPlugin(options?: PluginOptions): Plugin;
15
-
16
- export { DevcertPlugin as default };
16
+ //#endregion
17
+ export { DevcertPlugin as default };
package/dist/plugin.js CHANGED
@@ -1,4 +1,2 @@
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};
1
+ import{certificateFor as e}from"@expo/devcert";import t from"log-symbols";function n(n={}){return{name:`@idleberg/vite-plugin-devcert`,config:async(r,{command:i})=>{if(i!==`serve`)return;let{server:a}=r;if(a?.https?.key&&a?.https?.cert)return console.warn(`${t.warning} Skipping devcert, key and cert already provided.`),r;let o=a?.host&&typeof a.host==`string`?a.host:`localhost`;console.info([`${t.info} Generating certificate for "${o}".`,`You may be prompted to enter your password to allow the creation of root certificate authority.`,`
2
+ Please refer to documentation at https://github.com/expo/devcert#how-it-works for details.`].join(` `));let{key:s,cert:c}=await e(o,n);return{...r,server:{...a,https:{...a?.https,key:s??void 0,cert:c??void 0}}}}}}export{n as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idleberg/vite-plugin-devcert",
3
- "version": "0.2.1",
3
+ "version": "0.2.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",
@@ -16,7 +16,10 @@
16
16
  "tls"
17
17
  ],
18
18
  "type": "module",
19
- "exports": "./dist/plugin.js",
19
+ "exports": {
20
+ "import": "./dist/plugin.js",
21
+ "types": "./dist/plugin.d.ts"
22
+ },
20
23
  "types": "./dist/plugin.d.ts",
21
24
  "engines": {
22
25
  "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
@@ -30,34 +33,34 @@
30
33
  "log-symbols": "^7.0.1"
31
34
  },
32
35
  "devDependencies": {
33
- "@biomejs/biome": "^1.9.4",
36
+ "@biomejs/biome": "^2.0.5",
34
37
  "@commitlint/cli": "^19.8.1",
35
38
  "@commitlint/config-conventional": "^19.8.1",
36
- "@playwright/test": "^1.52.0",
39
+ "@playwright/test": "^1.53.1",
37
40
  "@total-typescript/tsconfig": "^1.0.4",
38
- "@types/node": "^22.15.21",
39
- "concurrently": "^9.1.2",
40
- "lefthook": "^1.11.13",
41
+ "@types/node": "^22.15.32",
42
+ "concurrently": "^9.2.0",
43
+ "lefthook": "^1.11.14",
41
44
  "np": "^10.2.0",
42
- "tsup": "^8.5.0",
45
+ "tsdown": "^0.12.9",
43
46
  "typescript": "^5.8.3",
44
- "vite": "^6.3.5",
45
- "vitest": "^3.1.4"
47
+ "vite": "^7.0.0",
48
+ "vitest": "^3.2.4"
46
49
  },
47
50
  "peerDependencies": {
48
51
  "@expo/devcert": "^1.2.0",
49
- "vite": "^5.0.0 || >=6.0.0"
52
+ "vite": "^5.0.0 || ^6.0.0 || >=7.0.0"
50
53
  },
51
54
  "scripts": {
52
- "build": "tsup",
53
- "dev": "tsup --watch",
55
+ "build": "tsdown",
56
+ "dev": "tsdown --watch",
54
57
  "lint": "biome check --no-errors-on-unmatched --vcs-enabled=true --vcs-use-ignore-file=true",
55
58
  "publish:jsr": "deno publish",
56
59
  "publish:npm": "np --any-branch",
57
- "server": "concurrently -n 'server,client' -c 'blue,green' 'npm:server:*'",
60
+ "server": "concurrently -n 'e2e,unit' -c 'blue,green' 'npm:server:*'",
58
61
  "server:http": "vite --config e2e/vite.config-http.ts",
59
62
  "server:https": "vite --config e2e/vite.config-https.ts",
60
- "test": "concurrently -n 'server,client' -c 'blue,green' 'npm:test:e2e' 'npm:test:unit'",
63
+ "test": "concurrently -n 'server,client' -c 'blue,green' 'npm:test:*'",
61
64
  "test:e2e": "playwright test",
62
65
  "test:unit": "vitest run --dir src"
63
66
  }