kirbyup 2.2.0-beta.0 → 2.2.0-beta.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
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cac } from 'cac';
|
|
2
|
-
import { n as name, b as build, s as serve, v as version, h as handleError } from './shared/kirbyup.
|
|
2
|
+
import { n as name, b as build, s as serve, v as version, h as handleError } from './shared/kirbyup.6fa783f0.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'pathe';
|
|
@@ -16,6 +16,7 @@ import 'postcss-logical';
|
|
|
16
16
|
import 'postcss-dir-pseudo-class';
|
|
17
17
|
import 'node:zlib';
|
|
18
18
|
import 'node:util';
|
|
19
|
+
import 'node:buffer';
|
|
19
20
|
import 'unconfig';
|
|
20
21
|
import 'magic-string';
|
|
21
22
|
import 'detect-package-manager';
|
|
@@ -27,9 +28,13 @@ async function startCli(cwd = process.cwd(), argv = process.argv) {
|
|
|
27
28
|
"Watch for file changes. If no path is specified, the folder of the input file will be watched",
|
|
28
29
|
{ default: false }
|
|
29
30
|
).example("kirbyup src/index.js").example("kirbyup src/index.js --out-dir ~/kirby-site/site/plugins/demo").example("kirbyup src/index.js --watch src/**/*.{js,css} --watch assets/*\n").action(async (file, options) => {
|
|
31
|
+
if (!process.env.NODE_ENV)
|
|
32
|
+
process.env.NODE_ENV = options.watch ? "development" : "production";
|
|
30
33
|
await build({ cwd, entry: file, ...options });
|
|
31
34
|
});
|
|
32
35
|
cli.command("serve <file>", "Start development server with live reload").option("--no-watch", "Don't watch .php files for changes", { default: "\0" }).option("-w, --watch <path>", "Watch additional files", { default: "./**/*.php" }).option("-p, --port <number>", "Port for the development server", { default: 5177 }).option("-d, --out-dir <dir>", "Output directory").example("kirbyup serve src/index.js").example("kirbyup serve src/index.js --no-watch --port 3003").example("kirbyup serve src/index.js --watch snippets/*.php --watch templates/*.php\n").action(async (file, options) => {
|
|
36
|
+
if (!process.env.NODE_ENV)
|
|
37
|
+
process.env.NODE_ENV = "development";
|
|
33
38
|
const server = await serve({ cwd, entry: file, ...options });
|
|
34
39
|
const exitProcess = async () => {
|
|
35
40
|
try {
|
package/dist/index.mjs
CHANGED
|
@@ -12,9 +12,10 @@ import 'vite-plugin-full-reload';
|
|
|
12
12
|
import 'postcss-load-config';
|
|
13
13
|
import 'postcss-logical';
|
|
14
14
|
import 'postcss-dir-pseudo-class';
|
|
15
|
-
export { b as build, s as serve } from './shared/kirbyup.
|
|
15
|
+
export { b as build, s as serve } from './shared/kirbyup.6fa783f0.mjs';
|
|
16
16
|
import 'node:zlib';
|
|
17
17
|
import 'node:util';
|
|
18
|
+
import 'node:buffer';
|
|
18
19
|
import 'unconfig';
|
|
19
20
|
import 'magic-string';
|
|
20
21
|
import 'detect-package-manager';
|
|
@@ -14,12 +14,13 @@ import postcssLogical from 'postcss-logical';
|
|
|
14
14
|
import postcssDirPseudoClass from 'postcss-dir-pseudo-class';
|
|
15
15
|
import { gzip } from 'node:zlib';
|
|
16
16
|
import { promisify } from 'node:util';
|
|
17
|
+
import { Buffer } from 'node:buffer';
|
|
17
18
|
import { createConfigLoader } from 'unconfig';
|
|
18
19
|
import MagicString from 'magic-string';
|
|
19
20
|
import { detect } from 'detect-package-manager';
|
|
20
21
|
|
|
21
22
|
const name = "kirbyup";
|
|
22
|
-
const version = "2.2.0-beta.
|
|
23
|
+
const version = "2.2.0-beta.1";
|
|
23
24
|
|
|
24
25
|
class PrettyError extends Error {
|
|
25
26
|
constructor(message) {
|
|
@@ -195,26 +196,6 @@ function kirbyupAutoImportPlugin() {
|
|
|
195
196
|
};
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
function kirbyupComponentCleanupPlugin() {
|
|
199
|
-
return {
|
|
200
|
-
name: "kirbyup:component-cleanup",
|
|
201
|
-
async transform(code) {
|
|
202
|
-
if (!code.includes("__component__.options.__file"))
|
|
203
|
-
return;
|
|
204
|
-
const fileOptionRE = /\b__component__.options.__file\s*=\s*('[^']+'|"[^"]+"|`[^`]+`)/g;
|
|
205
|
-
const match = fileOptionRE.exec(code);
|
|
206
|
-
if (!match)
|
|
207
|
-
return;
|
|
208
|
-
const { 0: exp, index } = match;
|
|
209
|
-
const s = new MagicString(code);
|
|
210
|
-
s.remove(index, index + exp.length);
|
|
211
|
-
return {
|
|
212
|
-
code: s.toString()
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
199
|
function kirbyupHmrPlugin(options) {
|
|
219
200
|
let config;
|
|
220
201
|
let entry;
|
|
@@ -301,8 +282,7 @@ function getViteConfig(command, options) {
|
|
|
301
282
|
// looks in the current directory and breaks `npx kirbyup`
|
|
302
283
|
vuePlugin({ compiler: vueCompilerSfc }),
|
|
303
284
|
vueJsxPlugin(),
|
|
304
|
-
kirbyupAutoImportPlugin()
|
|
305
|
-
kirbyupComponentCleanupPlugin()
|
|
285
|
+
kirbyupAutoImportPlugin()
|
|
306
286
|
],
|
|
307
287
|
css: { postcss: resolvedPostCssConfig },
|
|
308
288
|
envPrefix: ["VITE_", "KIRBYUP_"],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirbyup",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
4
|
-
"packageManager": "pnpm@8.1.
|
|
3
|
+
"version": "2.2.0-beta.1",
|
|
4
|
+
"packageManager": "pnpm@8.1.1",
|
|
5
5
|
"description": "Zero-config bundler for Kirby Panel plugins",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Johann Schopplich",
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"postcss-dir-pseudo-class": "^7.0.2",
|
|
84
84
|
"postcss-load-config": "^4.0.1",
|
|
85
85
|
"postcss-logical": "^6.1.0",
|
|
86
|
-
"sass": "^1.
|
|
86
|
+
"sass": "^1.61.0",
|
|
87
87
|
"unconfig": "^0.3.7",
|
|
88
88
|
"vite": "^4.2.1",
|
|
89
89
|
"vite-plugin-full-reload": "^1.0.5",
|
|
90
90
|
"vue": "^2.7.14"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@antfu/eslint-config": "^0.38.
|
|
93
|
+
"@antfu/eslint-config": "^0.38.4",
|
|
94
94
|
"@types/fs-extra": "^11.0.1",
|
|
95
95
|
"@types/node": "^18.15.11",
|
|
96
96
|
"@types/prompts": "^2.4.4",
|