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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Johann Schopplich
3
+ Copyright (c) 2021-2022 Johann Schopplich
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -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 colorette = require('colorette');
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" ? colorette.cyan : colorette.magenta;
127
- consola__default.log(colorette.white(colorette.dim(prettyOutDir)) + writeColor(filePath) + " " + colorette.dim(`${kibs.toFixed(2)} KiB${compressedSize}`));
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.2";
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("No input file, try " + colorette.cyan(`${name} <path/to/file.js>`));
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(colorette.green(`${name} v${version}`));
253
- consola__default.start("Building " + colorette.cyan(options.entry));
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) => colorette.cyan(i)).join(", "));
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(`${colorette.cyan(pathe.basename(file))} changed, setting new config`);
278
+ consola__default.info(`${picocolors.cyan(pathe.basename(file))} changed, setting new config`);
282
279
  } else {
283
- consola__default.log(colorette.green(type) + " " + colorette.white(colorette.dim(file)));
280
+ consola__default.log(picocolors.green(type) + " " + picocolors.white(picocolors.dim(file)));
284
281
  }
285
282
  debouncedBuild();
286
283
  });
@@ -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 'colorette';
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.2";
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("No input file, try " + cyan(`${name} <path/to/file.js>`));
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("Building " + cyan(options.entry));
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
@@ -12,7 +12,7 @@ require('postcss-load-config');
12
12
  require('postcss-logical');
13
13
  require('postcss-dir-pseudo-class');
14
14
  require('consola');
15
- require('colorette');
15
+ require('picocolors');
16
16
  require('fs/promises');
17
17
  require('zlib');
18
18
  require('util');
package/dist/cli.mjs CHANGED
@@ -10,7 +10,7 @@ import 'postcss-load-config';
10
10
  import 'postcss-logical';
11
11
  import 'postcss-dir-pseudo-class';
12
12
  import 'consola';
13
- import 'colorette';
13
+ import 'picocolors';
14
14
  import 'fs/promises';
15
15
  import 'zlib';
16
16
  import 'util';
package/dist/index.cjs CHANGED
@@ -11,7 +11,7 @@ require('postcss-load-config');
11
11
  require('postcss-logical');
12
12
  require('postcss-dir-pseudo-class');
13
13
  require('consola');
14
- require('colorette');
14
+ require('picocolors');
15
15
  require('magic-string');
16
16
  require('unconfig');
17
17
  require('fs/promises');
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import 'postcss-load-config';
7
7
  import 'postcss-logical';
8
8
  import 'postcss-dir-pseudo-class';
9
9
  import 'consola';
10
- import 'colorette';
10
+ import 'picocolors';
11
11
  import 'magic-string';
12
12
  import 'unconfig';
13
13
  import 'fs/promises';
package/dist/plugin.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- /** Inherits Vite's `import.meta.globEager` result type */
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: GlobEagerResult): Record<string, any>;
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.2",
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 -u",
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": "node scripts/release.js",
57
- "prepare": "husky install"
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.2",
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
- "postcss": "^8.4.5",
66
- "postcss-dir-pseudo-class": "^6.0.2",
67
- "postcss-load-config": "^3.1.1",
68
- "postcss-logical": "^5.0.2",
69
- "sass": "^1.46.0",
70
- "unconfig": "^0.2.2",
71
- "vite": "^2.7.10",
72
- "vite-plugin-vue2": "^1.9.2",
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.4.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.8",
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.13.0",
83
- "execa": "5.1.1",
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
- "husky": "^7.0.4",
90
+ "minimist": "^1.2.5",
87
91
  "prettier": "^2.5.1",
88
92
  "prompts": "^2.4.2",
89
- "ts-essentials": "^9.1.2",
90
- "typescript": "^4.5.4",
91
- "unbuild": "^0.6.7",
92
- "vitest": "^0.0.134"
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
  }