screw-up 0.3.0 → 0.5.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 +6 -11
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Simply package metadata inserter for Vite plugins.
|
|
|
10
10
|
|
|
11
11
|
## What is this?
|
|
12
12
|
|
|
13
|
-
This is a Vite plugin that automatically inserts banner comments containing package metadata (name, version, description, author, license, etc.) into your bundled
|
|
13
|
+
This is a Vite plugin that automatically inserts banner comments containing package metadata (name, version, description, author, license, etc.) into your bundled files.
|
|
14
14
|
|
|
15
15
|
This will automatically read metadata from your `package.json`:
|
|
16
16
|
|
|
@@ -65,7 +65,7 @@ Add the plugin to your `vite.config.ts`:
|
|
|
65
65
|
|
|
66
66
|
```typescript
|
|
67
67
|
import { defineConfig } from 'vite';
|
|
68
|
-
import
|
|
68
|
+
import screwUp from 'screw-up';
|
|
69
69
|
|
|
70
70
|
export default defineConfig({
|
|
71
71
|
plugins: [
|
|
@@ -81,13 +81,16 @@ export default defineConfig({
|
|
|
81
81
|
});
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
When no `outputKeys` are specified, the plugin uses these default keys with exact sequence:
|
|
85
|
+
`name`, `version`, `description`, `author`, `license` and `repository.url`.
|
|
86
|
+
|
|
84
87
|
### Custom Output Keys
|
|
85
88
|
|
|
86
89
|
You can specify which metadata fields to include and in what order:
|
|
87
90
|
|
|
88
91
|
```typescript
|
|
89
92
|
import { defineConfig } from 'vite';
|
|
90
|
-
import
|
|
93
|
+
import screwUp from 'screw-up';
|
|
91
94
|
|
|
92
95
|
export default defineConfig({
|
|
93
96
|
plugins: [
|
|
@@ -115,14 +118,6 @@ This will generate a banner with only the specified fields:
|
|
|
115
118
|
*/
|
|
116
119
|
```
|
|
117
120
|
|
|
118
|
-
#### Default Output Keys
|
|
119
|
-
|
|
120
|
-
When no `outputKeys` are specified, the plugin uses these default keys:
|
|
121
|
-
|
|
122
|
-
```typescript
|
|
123
|
-
['name', 'version', 'description', 'author', 'license', 'repository.url']
|
|
124
|
-
```
|
|
125
|
-
|
|
126
121
|
### Working with Nested Objects
|
|
127
122
|
|
|
128
123
|
The plugin automatically flattens nested objects using dot notation:
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAKnC,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAAI,UAAS,cAAmB,KAAG,MA2D/C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAKnC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAAI,UAAS,cAAmB,KAAG,MA2D/C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "screw-up",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Simply package metadata inserter on Vite plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -34,10 +34,12 @@
|
|
|
34
34
|
"build": "rv --npm . && tsc --noEmit && vite build && tsc --emitDeclarationOnly --outDir dist",
|
|
35
35
|
"test": "rv --npm . && tsc --noEmit && vitest run"
|
|
36
36
|
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"vite": "^5.0.0"
|
|
39
|
+
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@types/node": "^20.0.0",
|
|
39
42
|
"typescript": "^5.0.0",
|
|
40
|
-
"vite": "^5.0.0",
|
|
41
43
|
"vite-plugin-dts": "^3.0.0",
|
|
42
44
|
"vitest": "^1.0.0"
|
|
43
45
|
}
|