phio 0.1.1 → 0.1.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/package.json +1 -1
- package/src/commands/DevCommand.ts +16 -15
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@ import { defaultInstanceId } from './../lib/defaultInstanceId'
|
|
|
12
12
|
async function deployMyCode(
|
|
13
13
|
instanceName: string,
|
|
14
14
|
include: string[],
|
|
15
|
-
exclude: string[]
|
|
15
|
+
exclude: string[],
|
|
16
|
+
verbose: boolean
|
|
16
17
|
) {
|
|
17
18
|
const cachePath = '.cache'
|
|
18
19
|
ensureDirSync(cachePath)
|
|
@@ -25,8 +26,7 @@ async function deployMyCode(
|
|
|
25
26
|
'server-dir': `${instanceName}/`,
|
|
26
27
|
include,
|
|
27
28
|
exclude: [...excludeDefaults, ...exclude],
|
|
28
|
-
'
|
|
29
|
-
'log-level': 'verbose',
|
|
29
|
+
'log-level': verbose ? 'verbose' : 'standard',
|
|
30
30
|
})
|
|
31
31
|
console.log('🚀 Deploy done!')
|
|
32
32
|
}
|
|
@@ -35,6 +35,7 @@ export const DevCommand = () => {
|
|
|
35
35
|
return new Command('dev')
|
|
36
36
|
.argument(`[instanceId]`, `Instance name`, defaultInstanceId())
|
|
37
37
|
.description(`Watch for local modifications and sync to remote`)
|
|
38
|
+
.option(`-v, --verbose`, `Verbose output`)
|
|
38
39
|
.option(
|
|
39
40
|
'-i, --include <include...>',
|
|
40
41
|
'Files to include in the sync',
|
|
@@ -54,7 +55,7 @@ export const DevCommand = () => {
|
|
|
54
55
|
(val, prev) => [...prev, val],
|
|
55
56
|
[`pb_data`, `pb_data/**/*`]
|
|
56
57
|
)
|
|
57
|
-
.action(async (_instanceId, { include, exclude }) => {
|
|
58
|
+
.action(async (_instanceId, { include, exclude, verbose }) => {
|
|
58
59
|
if (!_instanceId) {
|
|
59
60
|
console.error(
|
|
60
61
|
`No instance name provided and none was found in package.json or pockethost.json. Use 'phio link <instance>'`
|
|
@@ -62,7 +63,7 @@ export const DevCommand = () => {
|
|
|
62
63
|
process.exit(1)
|
|
63
64
|
}
|
|
64
65
|
console.log(`Dev mode`)
|
|
65
|
-
console.log({ include, exclude })
|
|
66
|
+
// console.log({ include, exclude })
|
|
66
67
|
|
|
67
68
|
const instance = await getInstanceBySubdomainCnameOrId(_instanceId)
|
|
68
69
|
|
|
@@ -70,7 +71,7 @@ export const DevCommand = () => {
|
|
|
70
71
|
const upload = debounce(
|
|
71
72
|
() =>
|
|
72
73
|
limiter.schedule(() =>
|
|
73
|
-
deployMyCode(instance.subdomain, include, exclude).catch(
|
|
74
|
+
deployMyCode(instance.subdomain, include, exclude, verbose).catch(
|
|
74
75
|
console.error
|
|
75
76
|
)
|
|
76
77
|
),
|
|
@@ -84,14 +85,14 @@ export const DevCommand = () => {
|
|
|
84
85
|
const isIncluded = multimatch([file], include).length > 0
|
|
85
86
|
const isExcluded = multimatch([file], exclude).length > 0
|
|
86
87
|
const isIgnored = !isIncluded || isExcluded
|
|
87
|
-
console.log({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
})
|
|
88
|
+
// console.log({
|
|
89
|
+
// file,
|
|
90
|
+
// include,
|
|
91
|
+
// isIncluded,
|
|
92
|
+
// exclude,
|
|
93
|
+
// isExcluded,
|
|
94
|
+
// isIgnored,
|
|
95
|
+
// })
|
|
95
96
|
return isIgnored
|
|
96
97
|
},
|
|
97
98
|
})
|
|
@@ -101,7 +102,7 @@ export const DevCommand = () => {
|
|
|
101
102
|
const handle = (path: string, details: any) => {
|
|
102
103
|
upload()
|
|
103
104
|
// internal
|
|
104
|
-
console.log(`Syncing ${path}`)
|
|
105
|
+
// console.log(`Syncing ${path}`)
|
|
105
106
|
}
|
|
106
107
|
watcher.on('add', handle).on('change', handle).on('unlink', handle)
|
|
107
108
|
})
|