@konomi-app/k2 0.10.0 → 0.10.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.
|
@@ -12,24 +12,25 @@ export default function command() {
|
|
|
12
12
|
.option('-i, --input <input>', 'Input directory', 'src/apps')
|
|
13
13
|
.option('-o, --outdir <outdir>', 'Output directory.', DEVELOPMENT_DIRECTORY)
|
|
14
14
|
.option('-c, --certdir <certdir>', 'Certificate directory', WORKSPACE_DIRECTORY)
|
|
15
|
+
.option('--config <config>', 'k2 config file path')
|
|
15
16
|
.option('-p, --port <port>', 'Port number')
|
|
16
17
|
.action(action);
|
|
17
18
|
}
|
|
18
19
|
export async function action(options) {
|
|
19
|
-
const { certdir, outdir, port: specifiedPort, input } = options;
|
|
20
|
+
const { certdir, outdir, config, port: specifiedPort, input } = options;
|
|
20
21
|
console.group('🍳 Start development server');
|
|
21
22
|
try {
|
|
22
23
|
console.log(`📂 Output directory: ${outdir}`);
|
|
23
24
|
console.log(`🔑 Certificate directory: ${certdir}`);
|
|
24
25
|
let k2Config = null;
|
|
25
26
|
try {
|
|
26
|
-
k2Config = await importK2Config();
|
|
27
|
+
k2Config = await importK2Config(config);
|
|
27
28
|
}
|
|
28
29
|
catch (error) {
|
|
29
30
|
console.log(`⚙ ${CONFIG_FILE_NAME} not found. use default settings.`);
|
|
30
31
|
}
|
|
31
32
|
const port = Number(specifiedPort ?? k2Config?.server?.port ?? DEFAULT_PORT);
|
|
32
|
-
await Promise.all([build({ certdir, outdir, port, input }), watchCss(k2Config
|
|
33
|
+
await Promise.all([build({ certdir, outdir, port, input }), watchCss(k2Config ?? {})]);
|
|
33
34
|
}
|
|
34
35
|
catch (error) {
|
|
35
36
|
throw error;
|
|
@@ -21,6 +21,7 @@ async function buildTailwindCSS(params) {
|
|
|
21
21
|
}
|
|
22
22
|
export const watchCss = async (k2Config) => {
|
|
23
23
|
if (!k2Config.tailwind?.css || !k2Config.tailwind?.config) {
|
|
24
|
+
console.log('🚫 missing tailwind config. Skip watching css.');
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
const tailwindConfig = await getTailwindConfigFromK2Config(k2Config.tailwind);
|
package/package.json
CHANGED