@idleberg/vite-plugin-devcert 0.2.1 → 0.3.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 +9 -6
- package/dist/plugin.d.ts +6 -5
- package/dist/plugin.js +2 -4
- package/package.json +19 -16
package/README.md
CHANGED
|
@@ -13,32 +13,35 @@
|
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
On NodeJS or Bun, install
|
|
16
|
+
On NodeJS or Bun, install from npm:
|
|
17
17
|
|
|
18
18
|
```shell
|
|
19
|
-
npm install @idleberg/vite-plugin-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
|
|
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
|
|
35
|
+
import devcert from "@idleberg/vite-plugin-devcert";
|
|
33
36
|
|
|
34
37
|
export default defineConfig({
|
|
35
|
-
plugins: [
|
|
38
|
+
plugins: [devcert()],
|
|
36
39
|
});
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
### API
|
|
40
43
|
|
|
41
|
-
`
|
|
44
|
+
`devcert(options?)`
|
|
42
45
|
|
|
43
46
|
### Options
|
|
44
47
|
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Plugin } from
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
2
|
|
|
3
|
+
//#region src/plugin.d.ts
|
|
3
4
|
type PluginOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
2
|
-
|
|
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.
|
|
3
|
+
"version": "0.3.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",
|
|
@@ -16,10 +16,13 @@
|
|
|
16
16
|
"tls"
|
|
17
17
|
],
|
|
18
18
|
"type": "module",
|
|
19
|
-
"exports":
|
|
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
|
-
"node": "^
|
|
25
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
23
26
|
},
|
|
24
27
|
"files": [
|
|
25
28
|
"dist/",
|
|
@@ -30,34 +33,34 @@
|
|
|
30
33
|
"log-symbols": "^7.0.1"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
|
-
"@biomejs/biome": "^
|
|
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.
|
|
39
|
+
"@playwright/test": "^1.53.1",
|
|
37
40
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
38
|
-
"@types/node": "^22.15.
|
|
39
|
-
"concurrently": "^9.
|
|
40
|
-
"lefthook": "^1.11.
|
|
41
|
+
"@types/node": "^22.15.32",
|
|
42
|
+
"concurrently": "^9.2.0",
|
|
43
|
+
"lefthook": "^1.11.14",
|
|
41
44
|
"np": "^10.2.0",
|
|
42
|
-
"
|
|
45
|
+
"tsdown": "^0.12.9",
|
|
43
46
|
"typescript": "^5.8.3",
|
|
44
|
-
"vite": "^
|
|
45
|
-
"vitest": "^3.
|
|
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 ||
|
|
52
|
+
"vite": "^5.0.0 || ^6.0.0 || >=7.0.0"
|
|
50
53
|
},
|
|
51
54
|
"scripts": {
|
|
52
|
-
"build": "
|
|
53
|
-
"dev": "
|
|
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 '
|
|
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
|
|
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
|
}
|