kirbyup 0.9.5 → 0.10.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
@@ -1,30 +1,46 @@
1
1
  # kirbyup
2
2
 
3
- > Take a lool into the [pluginkit](./pluginkit) folder for an example setup.
3
+ > Take a look into Kirby's [pluginkit](https://github.com/getkirby/pluginkit/tree/4-panel) repository for an example setup.
4
4
 
5
5
  The fastest and leanest way to bundle your Kirby Panel plugins. No configuration necessary.
6
6
 
7
- ## Install
7
+ ## Installation
8
8
 
9
- Install it locally in your project folder:
9
+ If you want to use kirbyup right away, there is no need to install it. Simply call it with `npx`:
10
+
11
+ ```json
12
+ {
13
+ "scripts": {
14
+ "dev": "npx -y kirbyup src/index.js --watch",
15
+ "build": "npx -y kirbyup src/index.js"
16
+ }
17
+ }
18
+ ```
19
+
20
+ While kirbyup will stay backwards compatible, exact build reproducibility may be of importance to you. If so, I recommend to target a specific package version, rather than using `npx`. Install kirbyup with a package manager of your choice locally to your project:
10
21
 
11
22
  ```bash
12
23
  npm i kirbyup --save-dev
13
24
  ```
14
25
 
15
- You can also install it globally.
16
-
17
- ## Usage
26
+ Example package configuration:
18
27
 
19
28
  ```json
20
29
  {
21
30
  "scripts": {
22
- "dev": "npx -y kirbyup src/index.js --watch",
23
- "build": "npx -y kirbyup src/index.js"
31
+ "dev": "kirbyup src/index.js --watch",
32
+ "build": "kirbyup src/index.js"
33
+ },
34
+ "devDependencies": {
35
+ "kirbyup": "^0.9.5"
24
36
  }
25
37
  }
26
38
  ```
27
39
 
40
+ Global installation is supported as well, but not recommended.
41
+
42
+ ## Usage
43
+
28
44
  ### Development
29
45
 
30
46
  Rebuild the Panel plugin on any file changes:
@@ -53,10 +69,6 @@ kirbyup src/index.js
53
69
 
54
70
  The final panel plugin will be bundled, minified, and written into the current directory as `./index.js`.
55
71
 
56
- ## TODO
57
-
58
- - [ ] HMR with Vite in lib mode
59
-
60
72
  ## Credits
61
73
 
62
74
  - [Vite](https://vitejs.dev) by Evan You and all of its contributors.
package/dist/cli.js CHANGED
@@ -56,7 +56,7 @@ var name, version;
56
56
  var init_package = __esm({
57
57
  "package.json"() {
58
58
  name = "kirbyup";
59
- version = "0.9.5";
59
+ version = "0.10.0";
60
60
  }
61
61
  });
62
62
 
@@ -153,6 +153,7 @@ __export(src_exports, {
153
153
  async function runViteBuild(options) {
154
154
  let result;
155
155
  const currentDir = process.cwd();
156
+ const isDev = !!options.watch;
156
157
  try {
157
158
  result = await (0, import_vite.build)({
158
159
  plugins: [(0, import_vite_plugin_vue2.createVuePlugin)()],
@@ -163,7 +164,8 @@ async function runViteBuild(options) {
163
164
  name: "kirbyupExport",
164
165
  fileName: () => "index.js"
165
166
  },
166
- minify: !options.watch,
167
+ sourcemap: isDev ? "inline" : false,
168
+ minify: !isDev,
167
169
  outDir: currentDir,
168
170
  emptyOutDir: false,
169
171
  rollupOptions: {
@@ -204,7 +206,7 @@ async function build(_options) {
204
206
  "index.{css,js}"
205
207
  ];
206
208
  const watchPaths = typeof options.watch === "boolean" ? (0, import_path.dirname)(options.entry) : Array.isArray(options.watch) ? options.watch.filter((path) => typeof path === "string") : options.watch;
207
- log(`Watching for changes in ${Array.isArray(watchPaths) ? watchPaths.map((v) => '"' + v + '"').join(" | ") : '"' + watchPaths + '"'}`);
209
+ log(`Watching for changes in ${Array.isArray(watchPaths) ? watchPaths.map((i) => `"${i}"`).join(" | ") : `"${watchPaths}"`}`);
208
210
  const watcher = watch(watchPaths, {
209
211
  ignoreInitial: true,
210
212
  ignorePermissionErrors: true,
package/dist/index.js CHANGED
@@ -92,7 +92,7 @@ var import_nanocolors2 = __toModule(require("nanocolors"));
92
92
 
93
93
  // package.json
94
94
  var name = "kirbyup";
95
- var version = "0.9.5";
95
+ var version = "0.10.0";
96
96
 
97
97
  // src/log.ts
98
98
  var colorMap = new Map([
@@ -117,6 +117,7 @@ function log(message, type = "info") {
117
117
  async function runViteBuild(options) {
118
118
  let result;
119
119
  const currentDir = process.cwd();
120
+ const isDev = !!options.watch;
120
121
  try {
121
122
  result = await (0, import_vite.build)({
122
123
  plugins: [(0, import_vite_plugin_vue2.createVuePlugin)()],
@@ -127,7 +128,8 @@ async function runViteBuild(options) {
127
128
  name: "kirbyupExport",
128
129
  fileName: () => "index.js"
129
130
  },
130
- minify: !options.watch,
131
+ sourcemap: isDev ? "inline" : false,
132
+ minify: !isDev,
131
133
  outDir: currentDir,
132
134
  emptyOutDir: false,
133
135
  rollupOptions: {
@@ -177,7 +179,7 @@ async function build(_options) {
177
179
  "index.{css,js}"
178
180
  ];
179
181
  const watchPaths = typeof options.watch === "boolean" ? (0, import_path.dirname)(options.entry) : Array.isArray(options.watch) ? options.watch.filter((path) => typeof path === "string") : options.watch;
180
- log(`Watching for changes in ${Array.isArray(watchPaths) ? watchPaths.map((v) => '"' + v + '"').join(" | ") : '"' + watchPaths + '"'}`);
182
+ log(`Watching for changes in ${Array.isArray(watchPaths) ? watchPaths.map((i) => `"${i}"`).join(" | ") : `"${watchPaths}"`}`);
181
183
  const watcher = watch(watchPaths, {
182
184
  ignoreInitial: true,
183
185
  ignorePermissionErrors: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kirbyup",
3
- "version": "0.9.5",
3
+ "version": "0.10.0",
4
4
  "description": "Zero-config bundler for Kirby Panel plugins",
5
5
  "files": [
6
6
  "dist"
@@ -35,12 +35,13 @@
35
35
  "build": "tsup src/cli.ts src/index.ts --target node14 --clean --dts",
36
36
  "test": "jest",
37
37
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
38
- "release": "node scripts/release.js"
38
+ "release": "node scripts/release.js",
39
+ "prepare": "husky install"
39
40
  },
40
41
  "dependencies": {
41
42
  "cac": "^6.7.3",
42
43
  "chokidar": "^3.5.2",
43
- "nanocolors": "^0.1.6",
44
+ "nanocolors": "^0.2.10",
44
45
  "sass": "^1.42.1",
45
46
  "vite": "^2.5.10",
46
47
  "vite-plugin-vue2": "^1.8.2",
@@ -49,17 +50,18 @@
49
50
  "devDependencies": {
50
51
  "@types/fs-extra": "^9.0.13",
51
52
  "@types/jest": "^27.0.2",
52
- "@types/node": "^16.9.6",
53
+ "@types/node": "^16.10.1",
53
54
  "conventional-changelog-cli": "^2.1.1",
54
- "enquirer": "^2.3.6",
55
55
  "execa": "^5.1.1",
56
56
  "fast-glob": "^3.2.7",
57
57
  "fs-extra": "^10.0.0",
58
- "jest": "^27.2.1",
58
+ "jest": "^27.2.2",
59
59
  "prettier": "^2.4.1",
60
+ "prompts": "^2.4.1",
60
61
  "ts-essentials": "^8.1.0",
61
62
  "ts-jest": "^27.0.5",
62
- "tsup": "^5.1.0",
63
- "typescript": "^4.4.3"
63
+ "tsup": "^5.2.1",
64
+ "typescript": "^4.4.3",
65
+ "husky": "^7.0.2"
64
66
  }
65
67
  }