kirbyup 0.22.2 → 0.22.3
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 +1 -1
- package/dist/chunks/index.cjs +10 -13
- package/dist/chunks/index.mjs +4 -7
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/plugin.d.ts +3 -4
- package/package.json +30 -26
package/LICENSE
CHANGED
package/dist/chunks/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ const postcssrc = require('postcss-load-config');
|
|
|
10
10
|
const postcssLogical = require('postcss-logical');
|
|
11
11
|
const postcssDirPseudoClass = require('postcss-dir-pseudo-class');
|
|
12
12
|
const consola = require('consola');
|
|
13
|
-
const
|
|
13
|
+
const picocolors = require('picocolors');
|
|
14
14
|
const promises = require('fs/promises');
|
|
15
15
|
const zlib = require('zlib');
|
|
16
16
|
const util = require('util');
|
|
@@ -123,8 +123,8 @@ async function printFileInfo(root, outDir, filePath, type, content) {
|
|
|
123
123
|
const prettyOutDir = pathe.normalize(pathe.relative(root, pathe.resolve(root, outDir))) + "/";
|
|
124
124
|
const kibs = content.length / 1024;
|
|
125
125
|
const compressedSize = await getCompressedSize(content);
|
|
126
|
-
const writeColor = type === "chunk" ?
|
|
127
|
-
consola__default.log(
|
|
126
|
+
const writeColor = type === "chunk" ? picocolors.cyan : picocolors.magenta;
|
|
127
|
+
consola__default.log(picocolors.white(picocolors.dim(prettyOutDir)) + writeColor(filePath) + " " + picocolors.dim(`${kibs.toFixed(2)} KiB${compressedSize}`));
|
|
128
128
|
}
|
|
129
129
|
function debouncePromise(fn, delay, onError) {
|
|
130
130
|
let timeout;
|
|
@@ -151,9 +151,6 @@ function debouncePromise(fn, delay, onError) {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
// src/math.ts
|
|
155
|
-
|
|
156
|
-
// src/array.ts
|
|
157
154
|
function toArray(array) {
|
|
158
155
|
array = array || [];
|
|
159
156
|
if (Array.isArray(array))
|
|
@@ -162,7 +159,7 @@ function toArray(array) {
|
|
|
162
159
|
}
|
|
163
160
|
|
|
164
161
|
const name = "kirbyup";
|
|
165
|
-
const version = "0.22.
|
|
162
|
+
const version = "0.22.3";
|
|
166
163
|
|
|
167
164
|
let resolvedKirbyupConfig;
|
|
168
165
|
let resolvedPostCssConfig;
|
|
@@ -227,7 +224,7 @@ async function viteBuild(options) {
|
|
|
227
224
|
}
|
|
228
225
|
async function resolveOptions(options) {
|
|
229
226
|
if (!options.entry) {
|
|
230
|
-
throw new PrettyError(
|
|
227
|
+
throw new PrettyError(`No input file, try ${picocolors.cyan(`${name} <path/to/file.js>`)}`);
|
|
231
228
|
}
|
|
232
229
|
if (!fs.existsSync(options.entry)) {
|
|
233
230
|
throw new PrettyError(`Cannot find ${options.entry}`);
|
|
@@ -249,8 +246,8 @@ async function build(_options) {
|
|
|
249
246
|
plugins: [postcssLogical__default(), postcssDirPseudoClass__default()]
|
|
250
247
|
};
|
|
251
248
|
}
|
|
252
|
-
consola__default.log(
|
|
253
|
-
consola__default.start(
|
|
249
|
+
consola__default.log(picocolors.green(`${name} v${version}`));
|
|
250
|
+
consola__default.start(`Building ${picocolors.cyan(options.entry)}`);
|
|
254
251
|
if (options.watch) {
|
|
255
252
|
consola__default.info("Running in watch mode");
|
|
256
253
|
}
|
|
@@ -266,7 +263,7 @@ async function build(_options) {
|
|
|
266
263
|
"index.{css,js}"
|
|
267
264
|
];
|
|
268
265
|
const watchPaths = typeof options.watch === "boolean" ? pathe.dirname(options.entry) : Array.isArray(options.watch) ? options.watch.filter((path) => typeof path === "string") : options.watch;
|
|
269
|
-
consola__default.info("Watching for changes in " + toArray(watchPaths).map((i) =>
|
|
266
|
+
consola__default.info("Watching for changes in " + toArray(watchPaths).map((i) => picocolors.cyan(i)).join(", "));
|
|
270
267
|
const watcher = watch(watchPaths, {
|
|
271
268
|
ignoreInitial: true,
|
|
272
269
|
ignorePermissionErrors: true,
|
|
@@ -278,9 +275,9 @@ async function build(_options) {
|
|
|
278
275
|
watcher.on("all", async (type, file) => {
|
|
279
276
|
if (configSources.includes(file)) {
|
|
280
277
|
resolvedKirbyupConfig = (await loadConfig()).config;
|
|
281
|
-
consola__default.info(`${
|
|
278
|
+
consola__default.info(`${picocolors.cyan(pathe.basename(file))} changed, setting new config`);
|
|
282
279
|
} else {
|
|
283
|
-
consola__default.log(
|
|
280
|
+
consola__default.log(picocolors.green(type) + " " + picocolors.white(picocolors.dim(file)));
|
|
284
281
|
}
|
|
285
282
|
debouncedBuild();
|
|
286
283
|
});
|
package/dist/chunks/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import postcssrc from 'postcss-load-config';
|
|
|
8
8
|
import postcssLogical from 'postcss-logical';
|
|
9
9
|
import postcssDirPseudoClass from 'postcss-dir-pseudo-class';
|
|
10
10
|
import consola from 'consola';
|
|
11
|
-
import { white, dim, cyan, magenta, green } from '
|
|
11
|
+
import { white, dim, cyan, magenta, green } from 'picocolors';
|
|
12
12
|
import { readFile } from 'fs/promises';
|
|
13
13
|
import { gzip } from 'zlib';
|
|
14
14
|
import { promisify } from 'util';
|
|
@@ -141,9 +141,6 @@ function debouncePromise(fn, delay, onError) {
|
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
// src/math.ts
|
|
145
|
-
|
|
146
|
-
// src/array.ts
|
|
147
144
|
function toArray(array) {
|
|
148
145
|
array = array || [];
|
|
149
146
|
if (Array.isArray(array))
|
|
@@ -152,7 +149,7 @@ function toArray(array) {
|
|
|
152
149
|
}
|
|
153
150
|
|
|
154
151
|
const name = "kirbyup";
|
|
155
|
-
const version = "0.22.
|
|
152
|
+
const version = "0.22.3";
|
|
156
153
|
|
|
157
154
|
let resolvedKirbyupConfig;
|
|
158
155
|
let resolvedPostCssConfig;
|
|
@@ -217,7 +214,7 @@ async function viteBuild(options) {
|
|
|
217
214
|
}
|
|
218
215
|
async function resolveOptions(options) {
|
|
219
216
|
if (!options.entry) {
|
|
220
|
-
throw new PrettyError(
|
|
217
|
+
throw new PrettyError(`No input file, try ${cyan(`${name} <path/to/file.js>`)}`);
|
|
221
218
|
}
|
|
222
219
|
if (!existsSync(options.entry)) {
|
|
223
220
|
throw new PrettyError(`Cannot find ${options.entry}`);
|
|
@@ -240,7 +237,7 @@ async function build(_options) {
|
|
|
240
237
|
};
|
|
241
238
|
}
|
|
242
239
|
consola.log(green(`${name} v${version}`));
|
|
243
|
-
consola.start(
|
|
240
|
+
consola.start(`Building ${cyan(options.entry)}`);
|
|
244
241
|
if (options.watch) {
|
|
245
242
|
consola.info("Running in watch mode");
|
|
246
243
|
}
|
package/dist/cli.cjs
CHANGED
package/dist/cli.mjs
CHANGED
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/plugin.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
declare type GlobEagerResult = Record<string, {
|
|
1
|
+
declare type Module = {
|
|
3
2
|
[key: string]: any;
|
|
4
|
-
}
|
|
3
|
+
};
|
|
5
4
|
declare const kirbyup: Readonly<{
|
|
6
5
|
/**
|
|
7
6
|
* Auto-import Kirby Panel components, will be transformed by
|
|
@@ -10,7 +9,7 @@ declare const kirbyup: Readonly<{
|
|
|
10
9
|
* @example
|
|
11
10
|
* kirbyup.import('./components/blocks/*.vue')
|
|
12
11
|
*/
|
|
13
|
-
import(modules:
|
|
12
|
+
import(modules: Record<string, Module>): Record<string, any>;
|
|
14
13
|
}>;
|
|
15
14
|
|
|
16
15
|
export { kirbyup };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirbyup",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
4
4
|
"description": "Zero-config bundler for Kirby Panel plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kirby-cms",
|
|
@@ -49,46 +49,50 @@
|
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "unbuild",
|
|
51
51
|
"stub": "unbuild --stub",
|
|
52
|
-
"test": "vitest",
|
|
53
|
-
"test:update": "vitest
|
|
52
|
+
"test": "vitest --watch",
|
|
53
|
+
"test:update": "vitest --update",
|
|
54
54
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
55
55
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
56
|
-
"release": "
|
|
57
|
-
"prepare": "
|
|
56
|
+
"release": "vitest --run && esno scripts/release.ts",
|
|
57
|
+
"prepare": "pnpm exec simple-git-hooks"
|
|
58
|
+
},
|
|
59
|
+
"simple-git-hooks": {
|
|
60
|
+
"commit-msg": "pnpm exec esno scripts/verifyCommit.ts $1"
|
|
58
61
|
},
|
|
59
62
|
"dependencies": {
|
|
60
63
|
"cac": "^6.7.12",
|
|
61
|
-
"chokidar": "^3.5.
|
|
62
|
-
"colorette": "^2.0.16",
|
|
64
|
+
"chokidar": "^3.5.3",
|
|
63
65
|
"consola": "^2.15.3",
|
|
66
|
+
"execa": "5.1.1",
|
|
64
67
|
"pathe": "^0.2.0",
|
|
65
|
-
"
|
|
66
|
-
"postcss
|
|
67
|
-
"postcss-
|
|
68
|
-
"postcss-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"vite
|
|
68
|
+
"picocolors": "^1.0.0",
|
|
69
|
+
"postcss": "^8.4.6",
|
|
70
|
+
"postcss-dir-pseudo-class": "^6.0.4",
|
|
71
|
+
"postcss-load-config": "^3.1.3",
|
|
72
|
+
"postcss-logical": "^5.0.4",
|
|
73
|
+
"sass": "^1.49.8",
|
|
74
|
+
"unconfig": "^0.3.1",
|
|
75
|
+
"vite": "^2.8.4",
|
|
76
|
+
"vite-plugin-vue2": "^1.9.3",
|
|
73
77
|
"vue": "^2.6.14",
|
|
74
78
|
"vue-template-compiler": "^2.6.14"
|
|
75
79
|
},
|
|
76
80
|
"devDependencies": {
|
|
77
|
-
"@antfu/utils": "^0.
|
|
78
|
-
"@types/cross-spawn": "^6.0.2",
|
|
81
|
+
"@antfu/utils": "^0.5.0",
|
|
79
82
|
"@types/fs-extra": "^9.0.13",
|
|
80
|
-
"@types/node": "^17.0.
|
|
83
|
+
"@types/node": "^17.0.19",
|
|
84
|
+
"@types/prompts": "^2.4.0",
|
|
85
|
+
"@types/semver": "^7.3.9",
|
|
81
86
|
"conventional-changelog-cli": "^2.2.2",
|
|
82
|
-
"esno": "^0.
|
|
83
|
-
"
|
|
84
|
-
"fast-glob": "^3.2.7",
|
|
87
|
+
"esno": "^0.14.1",
|
|
88
|
+
"fast-glob": "^3.2.11",
|
|
85
89
|
"fs-extra": "^10.0.0",
|
|
86
|
-
"
|
|
90
|
+
"minimist": "^1.2.5",
|
|
87
91
|
"prettier": "^2.5.1",
|
|
88
92
|
"prompts": "^2.4.2",
|
|
89
|
-
"
|
|
90
|
-
"typescript": "^4.5.
|
|
91
|
-
"unbuild": "^0.6.
|
|
92
|
-
"vitest": "^0.
|
|
93
|
+
"simple-git-hooks": "^2.7.0",
|
|
94
|
+
"typescript": "^4.5.5",
|
|
95
|
+
"unbuild": "^0.6.9",
|
|
96
|
+
"vitest": "^0.5.1"
|
|
93
97
|
}
|
|
94
98
|
}
|