kirby-deploy 0.3.0 → 0.3.2
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/dist/cli.js +15 -4
- package/package.json +11 -7
- package/src/commands/main.ts +3 -1
- package/src/config.ts +2 -1
- package/src/lftp/cat.ts +6 -1
- package/src/types.ts +6 -1
package/dist/cli.js
CHANGED
|
@@ -46,7 +46,12 @@ var ConfigSchema = object({
|
|
|
46
46
|
token: optional(string()),
|
|
47
47
|
remoteDir: optional(string()),
|
|
48
48
|
folderStructure: optional(
|
|
49
|
-
union([
|
|
49
|
+
union([
|
|
50
|
+
literal("flat"),
|
|
51
|
+
literal("public"),
|
|
52
|
+
literal("composer"),
|
|
53
|
+
FolderStructureSchema
|
|
54
|
+
])
|
|
50
55
|
),
|
|
51
56
|
checkComposerLock: optional(boolean()),
|
|
52
57
|
callWebhooks: optional(boolean()),
|
|
@@ -63,6 +68,7 @@ var ConfigSchema = object({
|
|
|
63
68
|
|
|
64
69
|
// src/config.ts
|
|
65
70
|
var loadConfig = async () => {
|
|
71
|
+
var _a;
|
|
66
72
|
let { config, configFile } = await load({
|
|
67
73
|
name: "kirby-deploy",
|
|
68
74
|
dotenv: true
|
|
@@ -96,7 +102,7 @@ ${info}`);
|
|
|
96
102
|
} else if (config.folderStructure === "flat") {
|
|
97
103
|
folderStructure = {
|
|
98
104
|
content: "content",
|
|
99
|
-
media: "
|
|
105
|
+
media: "media",
|
|
100
106
|
accounts: "site/accounts",
|
|
101
107
|
sessions: "site/sessions",
|
|
102
108
|
cache: "site/cache",
|
|
@@ -128,6 +134,7 @@ ${info}`);
|
|
|
128
134
|
include: [],
|
|
129
135
|
includeGlob: [],
|
|
130
136
|
...config,
|
|
137
|
+
url: (_a = config.url) == null ? void 0 : _a.replace(/\/$/, ""),
|
|
131
138
|
folderStructure,
|
|
132
139
|
lftpSettings: {
|
|
133
140
|
"ftp:ssl-force": true,
|
|
@@ -156,7 +163,11 @@ var cat = (file, { host, user, password, lftpSettings }) => {
|
|
|
156
163
|
const child = isWindows ? spawnSync("wsl", ["lftp", "-c", commands.join("; ")], {
|
|
157
164
|
encoding: "utf-8"
|
|
158
165
|
}) : spawnSync("lftp", ["-c", commands.join("; ")], { encoding: "utf-8" });
|
|
159
|
-
if (child.stderr)
|
|
166
|
+
if (child.stderr) {
|
|
167
|
+
if (child.stderr.includes("550")) return void 0;
|
|
168
|
+
consola2.error(child.stderr);
|
|
169
|
+
return void 0;
|
|
170
|
+
}
|
|
160
171
|
return child.stdout;
|
|
161
172
|
};
|
|
162
173
|
|
|
@@ -492,7 +503,7 @@ var main = defineCommand4({
|
|
|
492
503
|
encoding: "utf-8"
|
|
493
504
|
});
|
|
494
505
|
const remoteComposerLock = cat("./composer.lock", config);
|
|
495
|
-
const skipVendor = localComposerLock === remoteComposerLock;
|
|
506
|
+
const skipVendor = remoteComposerLock !== void 0 && localComposerLock === remoteComposerLock;
|
|
496
507
|
if (skipVendor) {
|
|
497
508
|
exclude.push("^vendor/", "^kirby/");
|
|
498
509
|
consola9.info("Skipping vendor\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirby-deploy",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"author": "Arno Schlipf",
|
|
11
11
|
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/arnoson/kirby-deploy"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup src/index.ts src/cli.ts --format esm --dts",
|
|
18
|
+
"dev": "tsup src/index.ts src/cli.ts --format esm --watch",
|
|
19
|
+
"type-check": "tsc --noEmit"
|
|
20
|
+
},
|
|
12
21
|
"devDependencies": {
|
|
13
22
|
"@prettier/plugin-php": "^0.24.0",
|
|
14
23
|
"@types/node": "^20.16.10",
|
|
@@ -21,10 +30,5 @@
|
|
|
21
30
|
"citty": "^0.1.6",
|
|
22
31
|
"consola": "^3.2.3",
|
|
23
32
|
"valibot": "^1.0.0"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "tsup src/index.ts src/cli.ts --format esm --dts",
|
|
27
|
-
"dev": "tsup src/index.ts src/cli.ts --format esm --watch",
|
|
28
|
-
"type-check": "tsc --noEmit"
|
|
29
33
|
}
|
|
30
|
-
}
|
|
34
|
+
}
|
package/src/commands/main.ts
CHANGED
|
@@ -52,7 +52,9 @@ export const main = defineCommand({
|
|
|
52
52
|
encoding: 'utf-8',
|
|
53
53
|
})
|
|
54
54
|
const remoteComposerLock = cat('./composer.lock', config)
|
|
55
|
-
const skipVendor =
|
|
55
|
+
const skipVendor =
|
|
56
|
+
remoteComposerLock !== undefined &&
|
|
57
|
+
localComposerLock === remoteComposerLock
|
|
56
58
|
if (skipVendor) {
|
|
57
59
|
exclude.push('^vendor/', '^kirby/')
|
|
58
60
|
consola.info('Skipping vendor\n')
|
package/src/config.ts
CHANGED
|
@@ -44,7 +44,7 @@ export const loadConfig = async (): Promise<ConfigResolved | null> => {
|
|
|
44
44
|
// 'flat' structure is the default.
|
|
45
45
|
folderStructure = {
|
|
46
46
|
content: 'content',
|
|
47
|
-
media: '
|
|
47
|
+
media: 'media',
|
|
48
48
|
accounts: 'site/accounts',
|
|
49
49
|
sessions: 'site/sessions',
|
|
50
50
|
cache: 'site/cache',
|
|
@@ -77,6 +77,7 @@ export const loadConfig = async (): Promise<ConfigResolved | null> => {
|
|
|
77
77
|
include: [],
|
|
78
78
|
includeGlob: [],
|
|
79
79
|
...config,
|
|
80
|
+
url: config.url?.replace(/\/$/, ''),
|
|
80
81
|
folderStructure,
|
|
81
82
|
lftpSettings: {
|
|
82
83
|
'ftp:ssl-force': true,
|
package/src/lftp/cat.ts
CHANGED
|
@@ -24,6 +24,11 @@ export const cat = (
|
|
|
24
24
|
})
|
|
25
25
|
: spawnSync('lftp', ['-c', commands.join('; ')], { encoding: 'utf-8' })
|
|
26
26
|
|
|
27
|
-
if (child.stderr)
|
|
27
|
+
if (child.stderr) {
|
|
28
|
+
// 550 means the file doesn't exist, silently return undefined
|
|
29
|
+
if (child.stderr.includes('550')) return undefined
|
|
30
|
+
consola.error(child.stderr)
|
|
31
|
+
return undefined
|
|
32
|
+
}
|
|
28
33
|
return child.stdout
|
|
29
34
|
}
|
package/src/types.ts
CHANGED
|
@@ -32,7 +32,12 @@ export const ConfigSchema = object({
|
|
|
32
32
|
token: optional(string()),
|
|
33
33
|
remoteDir: optional(string()),
|
|
34
34
|
folderStructure: optional(
|
|
35
|
-
union([
|
|
35
|
+
union([
|
|
36
|
+
literal('flat'),
|
|
37
|
+
literal('public'),
|
|
38
|
+
literal('composer'),
|
|
39
|
+
FolderStructureSchema,
|
|
40
|
+
]),
|
|
36
41
|
),
|
|
37
42
|
checkComposerLock: optional(boolean()),
|
|
38
43
|
callWebhooks: optional(boolean()),
|