@konomi-app/k2 1.9.0 → 1.11.0
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 +6 -6
- package/types/k2.d.ts +8 -0
- package/types/plugin.d.ts +8 -0
- package/dist/commands/build-base.d.ts +0 -6
- package/dist/commands/build-base.d.ts.map +0 -1
- package/dist/commands/build-base.js +0 -7
- package/dist/commands/build-base.js.map +0 -1
- package/dist/commands/build-esbuild.d.ts +0 -7
- package/dist/commands/build-esbuild.d.ts.map +0 -1
- package/dist/commands/build-esbuild.js +0 -63
- package/dist/commands/build-esbuild.js.map +0 -1
- package/dist/commands/build-tailwind.d.ts +0 -2
- package/dist/commands/build-tailwind.d.ts.map +0 -1
- package/dist/commands/build-tailwind.js +0 -18
- package/dist/commands/build-tailwind.js.map +0 -1
- package/dist/commands/build.d.ts +0 -7
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -52
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/dev/index.d.ts +0 -9
- package/dist/commands/dev/index.d.ts.map +0 -1
- package/dist/commands/dev/index.js +0 -60
- package/dist/commands/dev/index.js.map +0 -1
- package/dist/commands/dev/tailwind.d.ts +0 -5
- package/dist/commands/dev/tailwind.d.ts.map +0 -1
- package/dist/commands/dev/tailwind.js +0 -30
- package/dist/commands/dev/tailwind.js.map +0 -1
- package/dist/commands/dev-base-esbuild.d.ts +0 -8
- package/dist/commands/dev-base-esbuild.d.ts.map +0 -1
- package/dist/commands/dev-base-esbuild.js +0 -18
- package/dist/commands/dev-base-esbuild.js.map +0 -1
- package/dist/commands/genkey-base.d.ts +0 -4
- package/dist/commands/genkey-base.d.ts.map +0 -1
- package/dist/commands/genkey-base.js +0 -19
- package/dist/commands/genkey-base.js.map +0 -1
- package/dist/commands/genkey.d.ts +0 -5
- package/dist/commands/genkey.d.ts.map +0 -1
- package/dist/commands/genkey.js +0 -14
- package/dist/commands/genkey.js.map +0 -1
- package/dist/commands/lint.d.ts +0 -8
- package/dist/commands/lint.d.ts.map +0 -1
- package/dist/commands/lint.js +0 -20
- package/dist/commands/lint.js.map +0 -1
- package/dist/commands/manifest/index.d.ts +0 -2
- package/dist/commands/manifest/index.d.ts.map +0 -1
- package/dist/commands/manifest/index.js +0 -29
- package/dist/commands/manifest/index.js.map +0 -1
- package/dist/commands/plugin-build.d.ts +0 -3
- package/dist/commands/plugin-build.d.ts.map +0 -1
- package/dist/commands/plugin-build.js +0 -60
- package/dist/commands/plugin-build.js.map +0 -1
- package/dist/commands/plugin-dev/create-manifest.d.ts +0 -5
- package/dist/commands/plugin-dev/create-manifest.d.ts.map +0 -1
- package/dist/commands/plugin-dev/create-manifest.js +0 -30
- package/dist/commands/plugin-dev/create-manifest.js.map +0 -1
- package/dist/commands/plugin-dev/index.d.ts +0 -5
- package/dist/commands/plugin-dev/index.d.ts.map +0 -1
- package/dist/commands/plugin-dev/index.js +0 -50
- package/dist/commands/plugin-dev/index.js.map +0 -1
- package/dist/commands/plugin-dev/tailwind.d.ts +0 -2
- package/dist/commands/plugin-dev/tailwind.d.ts.map +0 -1
- package/dist/commands/plugin-dev/tailwind.js +0 -42
- package/dist/commands/plugin-dev/tailwind.js.map +0 -1
- package/dist/commands/plugin-dev/upload.d.ts +0 -5
- package/dist/commands/plugin-dev/upload.d.ts.map +0 -1
- package/dist/commands/plugin-dev/upload.js +0 -58
- package/dist/commands/plugin-dev/upload.js.map +0 -1
- package/dist/commands/plugin-esbuild.d.ts +0 -3
- package/dist/commands/plugin-esbuild.d.ts.map +0 -1
- package/dist/commands/plugin-esbuild.js +0 -66
- package/dist/commands/plugin-esbuild.js.map +0 -1
- package/dist/commands/plugin-genkey.d.ts +0 -3
- package/dist/commands/plugin-genkey.d.ts.map +0 -1
- package/dist/commands/plugin-genkey.js +0 -13
- package/dist/commands/plugin-genkey.js.map +0 -1
- package/dist/commands/plugin-init.d.ts +0 -3
- package/dist/commands/plugin-init.d.ts.map +0 -1
- package/dist/commands/plugin-init.js +0 -45
- package/dist/commands/plugin-init.js.map +0 -1
- package/dist/commands/plugin-tsup.d.ts +0 -3
- package/dist/commands/plugin-tsup.d.ts.map +0 -1
- package/dist/commands/plugin-tsup.js +0 -65
- package/dist/commands/plugin-tsup.js.map +0 -1
- package/dist/commands/plugin-zip.d.ts +0 -2
- package/dist/commands/plugin-zip.d.ts.map +0 -1
- package/dist/commands/plugin-zip.js +0 -46
- package/dist/commands/plugin-zip.js.map +0 -1
- package/dist/commands/test/index.d.ts +0 -3
- package/dist/commands/test/index.d.ts.map +0 -1
- package/dist/commands/test/index.js +0 -17
- package/dist/commands/test/index.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -15
- package/dist/index.js.map +0 -1
- package/dist/lib/cert.d.ts +0 -4
- package/dist/lib/cert.d.ts.map +0 -1
- package/dist/lib/cert.js +0 -16
- package/dist/lib/cert.js.map +0 -1
- package/dist/lib/constants.d.ts +0 -13
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/constants.js +0 -14
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/esbuild.d.ts +0 -6
- package/dist/lib/esbuild.d.ts.map +0 -1
- package/dist/lib/esbuild.js +0 -39
- package/dist/lib/esbuild.js.map +0 -1
- package/dist/lib/exec.d.ts +0 -3
- package/dist/lib/exec.d.ts.map +0 -1
- package/dist/lib/exec.js +0 -4
- package/dist/lib/exec.js.map +0 -1
- package/dist/lib/import.d.ts +0 -4
- package/dist/lib/import.d.ts.map +0 -1
- package/dist/lib/import.js +0 -18
- package/dist/lib/import.js.map +0 -1
- package/dist/lib/k2.d.ts +0 -2
- package/dist/lib/k2.d.ts.map +0 -1
- package/dist/lib/k2.js +0 -9
- package/dist/lib/k2.js.map +0 -1
- package/dist/lib/kintone-api-client.d.ts +0 -57
- package/dist/lib/kintone-api-client.d.ts.map +0 -1
- package/dist/lib/kintone-api-client.js +0 -95
- package/dist/lib/kintone-api-client.js.map +0 -1
- package/dist/lib/lint.d.ts +0 -2
- package/dist/lib/lint.d.ts.map +0 -1
- package/dist/lib/lint.js +0 -28
- package/dist/lib/lint.js.map +0 -1
- package/dist/lib/plugin-contents.d.ts +0 -5
- package/dist/lib/plugin-contents.d.ts.map +0 -1
- package/dist/lib/plugin-contents.js +0 -28
- package/dist/lib/plugin-contents.js.map +0 -1
- package/dist/lib/plugin-manifest.d.ts +0 -4
- package/dist/lib/plugin-manifest.d.ts.map +0 -1
- package/dist/lib/plugin-manifest.js +0 -13
- package/dist/lib/plugin-manifest.js.map +0 -1
- package/dist/lib/tailwind.d.ts +0 -33
- package/dist/lib/tailwind.d.ts.map +0 -1
- package/dist/lib/tailwind.js +0 -91
- package/dist/lib/tailwind.js.map +0 -1
- package/dist/lib/tsup.d.ts +0 -3
- package/dist/lib/tsup.d.ts.map +0 -1
- package/dist/lib/tsup.js +0 -26
- package/dist/lib/tsup.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -16
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -66
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/webpack.d.ts +0 -6
- package/dist/lib/webpack.d.ts.map +0 -1
- package/dist/lib/webpack.js +0 -72
- package/dist/lib/webpack.js.map +0 -1
- package/dist/lib/zip.d.ts +0 -4
- package/dist/lib/zip.d.ts.map +0 -1
- package/dist/lib/zip.js +0 -65
- package/dist/lib/zip.js.map +0 -1
- package/dist/plugin.d.ts +0 -3
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js +0 -25
- package/dist/plugin.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@konomi-app/k2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "kintone sdk",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,11 +14,6 @@
|
|
|
14
14
|
"types",
|
|
15
15
|
"types.d.ts"
|
|
16
16
|
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "rmdir /s /q dist & tsc",
|
|
19
|
-
"dev": "tsc -w",
|
|
20
|
-
"watch": "tsc -w"
|
|
21
|
-
},
|
|
22
17
|
"keywords": [],
|
|
23
18
|
"author": "",
|
|
24
19
|
"license": "ISC",
|
|
@@ -68,5 +63,10 @@
|
|
|
68
63
|
"@types/fs-extra": "*",
|
|
69
64
|
"@types/html-minifier": "^4",
|
|
70
65
|
"typescript": "*"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "rmdir /s /q dist & tsc",
|
|
69
|
+
"dev": "tsc -w",
|
|
70
|
+
"watch": "tsc -w"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/types/k2.d.ts
CHANGED
package/types/plugin.d.ts
CHANGED
|
@@ -128,6 +128,14 @@ declare namespace Plugin {
|
|
|
128
128
|
en: string;
|
|
129
129
|
/** 簡体字中国語 */
|
|
130
130
|
zh: string;
|
|
131
|
+
/** 繁体字中国語 */
|
|
132
|
+
'zh-TW': string;
|
|
133
|
+
/** スペイン語 */
|
|
134
|
+
es: string;
|
|
135
|
+
/** ポルトガル語(ブラジル) */
|
|
136
|
+
'pt-BR': string;
|
|
137
|
+
/** タイ語 */
|
|
138
|
+
th: string;
|
|
131
139
|
};
|
|
132
140
|
|
|
133
141
|
type Resources = {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-base.d.ts","sourceRoot":"","sources":["../../src/commands/build-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,wBAA8B,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,iBAG/F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-base.js","sourceRoot":"","sources":["../../src/commands/build-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,MAAM,CAAC,MAA2D;IAC9F,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACnC,OAAO,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-esbuild.d.ts","sourceRoot":"","sources":["../../src/commands/build-esbuild.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,SAQ9B;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,iBAkDvF"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
5
|
-
import {} from 'esbuild';
|
|
6
|
-
import { buildWithEsbuild } from '../lib/esbuild.js';
|
|
7
|
-
import { importK2Config } from '../lib/import.js';
|
|
8
|
-
import { getDefaultK2Config } from '../lib/k2.js';
|
|
9
|
-
import { buildTailwind } from './build-tailwind.js';
|
|
10
|
-
export default function command() {
|
|
11
|
-
program
|
|
12
|
-
.command('esbuild-build')
|
|
13
|
-
.option('-o, --outdir <outdir>', 'Output directory.', path.join(WORKSPACE_DIRECTORY, 'prod'))
|
|
14
|
-
.option('-i, --input <input>', 'Input directory.', path.join('src', 'apps'))
|
|
15
|
-
.option('--config <config>', 'k2 config file path')
|
|
16
|
-
.description("Build the project for production. (It's a wrapper of webpack build command.)")
|
|
17
|
-
.action(action);
|
|
18
|
-
}
|
|
19
|
-
export async function action(options) {
|
|
20
|
-
console.group('🍳 Build the project for production');
|
|
21
|
-
try {
|
|
22
|
-
const { outdir, input, config } = options;
|
|
23
|
-
const outDir = path.resolve(outdir);
|
|
24
|
-
if (!fs.existsSync(outDir)) {
|
|
25
|
-
fs.mkdirSync(outDir, { recursive: true });
|
|
26
|
-
}
|
|
27
|
-
const allProjects = fs.readdirSync(path.resolve(input));
|
|
28
|
-
const entryPoints = allProjects.reduce((acc, dir) => {
|
|
29
|
-
for (const filename of ['index.ts', 'index.js', 'index.mjs']) {
|
|
30
|
-
if (fs.existsSync(path.join(input, dir, filename))) {
|
|
31
|
-
return { ...acc, [dir]: path.join(input, dir, filename) };
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return acc;
|
|
35
|
-
}, {});
|
|
36
|
-
console.log(`📁 ${Object.keys(entryPoints).length} entry points`);
|
|
37
|
-
const k2Config = config ? await importK2Config(config) : getDefaultK2Config();
|
|
38
|
-
const fullConfig = { ...k2Config, outDir };
|
|
39
|
-
const results = await Promise.allSettled([
|
|
40
|
-
buildWithEsbuild({
|
|
41
|
-
entryPoints,
|
|
42
|
-
outdir,
|
|
43
|
-
sourcemap: false,
|
|
44
|
-
minify: true,
|
|
45
|
-
legalComments: 'none',
|
|
46
|
-
}),
|
|
47
|
-
buildTailwind(fullConfig),
|
|
48
|
-
]);
|
|
49
|
-
for (const result of results) {
|
|
50
|
-
if (result.status === 'rejected') {
|
|
51
|
-
throw result.reason;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
console.log('✨ Build success.');
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
finally {
|
|
60
|
-
console.groupEnd();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=build-esbuild.js.map
|
|
@@ -1 +0,0 @@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C,CAAC;QAEH,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBACjC,MAAM,MAAM,CAAC,MAAM,CAAC;YACtB,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-tailwind.d.ts","sourceRoot":"","sources":["../../src/commands/build-tailwind.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,WAAkB,EAAE,CAAC,UAAU,kBAexD,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import { esmImport } from '../lib/import.js';
|
|
3
|
-
import { outputCss } from '../lib/tailwind.js';
|
|
4
|
-
export const buildTailwind = async (config) => {
|
|
5
|
-
if (!config.tailwind?.css || !config.tailwind?.config) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
const tailwindConfig = (await esmImport(path.resolve(config.tailwind.config))).default;
|
|
9
|
-
const inputPath = path.resolve(config.tailwind.css);
|
|
10
|
-
await outputCss({
|
|
11
|
-
inputPath,
|
|
12
|
-
outputPath: path.join(config.outDir, 'tailwind.css'),
|
|
13
|
-
config: tailwindConfig,
|
|
14
|
-
minify: true,
|
|
15
|
-
});
|
|
16
|
-
console.log('✨ Built tailwind.css');
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=build-tailwind.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-tailwind.js","sourceRoot":"","sources":["../../src/commands/build-tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAqB,EAAE,EAAE;IAC3D,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACtD,OAAO;IACT,CAAC;IACD,MAAM,cAAc,GAAG,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAEvF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEpD,MAAM,SAAS,CAAC;QACd,SAAS;QACT,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;QACpD,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AACtC,CAAC,CAAC"}
|
package/dist/commands/build.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,OAAO,SAQ9B;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,iBAoCvF"}
|
package/dist/commands/build.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
5
|
-
import base from './build-base.js';
|
|
6
|
-
import { buildTailwind } from './build-tailwind.js';
|
|
7
|
-
import { importK2Config } from '../lib/import.js';
|
|
8
|
-
import { getDefaultK2Config } from '../lib/k2.js';
|
|
9
|
-
export default function command() {
|
|
10
|
-
program
|
|
11
|
-
.command('build')
|
|
12
|
-
.option('-o, --outdir <outdir>', 'Output directory.', path.join(WORKSPACE_DIRECTORY, 'prod'))
|
|
13
|
-
.option('-i, --input <input>', 'Input directory.', path.join('src', 'apps'))
|
|
14
|
-
.option('--config <config>', 'k2 config file path')
|
|
15
|
-
.description("Build the project for production. (It's a wrapper of webpack build command.)")
|
|
16
|
-
.action(action);
|
|
17
|
-
}
|
|
18
|
-
export async function action(options) {
|
|
19
|
-
console.group('🍳 Build the project for production');
|
|
20
|
-
try {
|
|
21
|
-
const { outdir, input, config } = options;
|
|
22
|
-
const outDir = path.resolve(outdir);
|
|
23
|
-
const allProjects = fs.readdirSync(path.resolve(input));
|
|
24
|
-
const entries = allProjects.reduce((acc, dir) => {
|
|
25
|
-
for (const filename of ['index.ts', 'index.js', 'index.mjs']) {
|
|
26
|
-
if (fs.existsSync(path.join(input, dir, filename))) {
|
|
27
|
-
return { ...acc, [dir]: path.join(input, dir, filename) };
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return acc;
|
|
31
|
-
}, {});
|
|
32
|
-
const k2Config = config ? await importK2Config(config) : getDefaultK2Config();
|
|
33
|
-
const fullConfig = { ...k2Config, outDir };
|
|
34
|
-
const results = await Promise.allSettled([
|
|
35
|
-
base({ entries, outDir }),
|
|
36
|
-
buildTailwind(fullConfig),
|
|
37
|
-
]);
|
|
38
|
-
for (const result of results) {
|
|
39
|
-
if (result.status === 'rejected') {
|
|
40
|
-
throw result.reason;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
console.log('✨ Build success.');
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
throw error;
|
|
47
|
-
}
|
|
48
|
-
finally {
|
|
49
|
-
console.groupEnd();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=build.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,MAAM,CAAC,uBAAuB,EAAE,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;SAC5F,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC3E,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC;SAClD,WAAW,CAAC,8EAA8E,CAAC;SAC3F,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAA2D;IACtF,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAErD,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAC1C,MAAM,MAAM,GAAG,IAAI,CA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CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/index.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,OAAO,SAU9B;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,iBAyBA"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import {} from 'esbuild';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { CONFIG_FILE_NAME, DEFAULT_PORT, DEVELOPMENT_DIRECTORY, WORKSPACE_DIRECTORY, } from '../../lib/constants.js';
|
|
6
|
-
import base from '../dev-base-esbuild.js';
|
|
7
|
-
import { importK2Config } from '../../lib/import.js';
|
|
8
|
-
import { watchCss } from './tailwind.js';
|
|
9
|
-
export default function command() {
|
|
10
|
-
program
|
|
11
|
-
.command('dev')
|
|
12
|
-
.description('Start development server.')
|
|
13
|
-
.option('-i, --input <input>', 'Input directory', 'src/apps')
|
|
14
|
-
.option('-o, --outdir <outdir>', 'Output directory.', DEVELOPMENT_DIRECTORY)
|
|
15
|
-
.option('-c, --certdir <certdir>', 'Certificate directory', WORKSPACE_DIRECTORY)
|
|
16
|
-
.option('--config <config>', 'k2 config file path')
|
|
17
|
-
.option('-p, --port <port>', 'Port number')
|
|
18
|
-
.action(action);
|
|
19
|
-
}
|
|
20
|
-
export async function action(options) {
|
|
21
|
-
const { certdir, outdir, config, port: specifiedPort, input } = options;
|
|
22
|
-
console.group('🍳 Start development server');
|
|
23
|
-
try {
|
|
24
|
-
console.log(`📂 Output directory: ${outdir}`);
|
|
25
|
-
console.log(`🔑 Certificate directory: ${certdir}`);
|
|
26
|
-
let k2Config = null;
|
|
27
|
-
try {
|
|
28
|
-
k2Config = await importK2Config(config);
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
console.log(`⚙ ${CONFIG_FILE_NAME} not found. use default settings.`);
|
|
32
|
-
}
|
|
33
|
-
const port = Number(specifiedPort ?? k2Config?.server?.port ?? DEFAULT_PORT);
|
|
34
|
-
await Promise.all([
|
|
35
|
-
build({ certdir, outdir, port, input }),
|
|
36
|
-
watchCss({ k2Config: k2Config ?? {}, outdir }),
|
|
37
|
-
]);
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
throw error;
|
|
41
|
-
}
|
|
42
|
-
finally {
|
|
43
|
-
console.groupEnd();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const build = async (params) => {
|
|
47
|
-
const { outdir, certdir, port, input } = params;
|
|
48
|
-
const srcDir = path.resolve(input);
|
|
49
|
-
const dirs = fs.readdirSync(srcDir);
|
|
50
|
-
const entryPoints = dirs.reduce((acc, dir) => {
|
|
51
|
-
for (const filename of ['index.ts', 'index.js', 'index.mjs']) {
|
|
52
|
-
if (fs.existsSync(path.join(srcDir, dir, filename))) {
|
|
53
|
-
return [...acc, { in: path.join(srcDir, dir, filename), out: dir }];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return acc;
|
|
57
|
-
}, []);
|
|
58
|
-
return base({ port, entryPoints, certDir: certdir, staticDir: outdir });
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/dev/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OA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M,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;IAEF,OAAO,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/tailwind.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,WAAkB;IAAE,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,sDA8B7E,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { getTailwindConfigFromK2Config, watchTailwindCSS } from '../../lib/tailwind.js';
|
|
4
|
-
import fs from 'fs-extra';
|
|
5
|
-
export const watchCss = async (params) => {
|
|
6
|
-
const { k2Config, outdir } = params;
|
|
7
|
-
if (!k2Config.tailwind?.css || !k2Config.tailwind?.config) {
|
|
8
|
-
console.log('🚫 missing tailwind config. Skip watching css.');
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const tailwindConfig = await getTailwindConfigFromK2Config(k2Config.tailwind);
|
|
12
|
-
const input = path.resolve(k2Config.tailwind.css);
|
|
13
|
-
const output = path.join(outdir, 'tailwind.css');
|
|
14
|
-
if (!(await fs.pathExists(output))) {
|
|
15
|
-
await fs.outputFile(output, '');
|
|
16
|
-
}
|
|
17
|
-
return watchTailwindCSS({
|
|
18
|
-
input,
|
|
19
|
-
output: path.join(outdir, 'tailwind.css'),
|
|
20
|
-
config: tailwindConfig,
|
|
21
|
-
onChanges: ({ output, type }) => {
|
|
22
|
-
const outputFileName = path.basename(output);
|
|
23
|
-
console.log(chalk.hex('#e5e7eb')(`${new Date().toLocaleTimeString()} `) +
|
|
24
|
-
chalk.cyan(`[css] `) +
|
|
25
|
-
outputFileName +
|
|
26
|
-
(type === 'init' ? ' init' : ` rebuilt(${type})`));
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=tailwind.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.js","sourceRoot":"","sources":["../../../src/commands/dev/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,MAA+C,EAAE,EAAE;IAChF,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACpC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAC9D,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,6BAA6B,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE9E,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAEjD,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACnC,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,gBAAgB,CAAC;QACtB,KAAK;QACL,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC;QACzC,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9B,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC7C,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,GAAG,CAAC;gBACzD,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACpB,cAAc;gBACd,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,GAAG,CAAC,CACpD,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-base-esbuild.d.ts","sourceRoot":"","sources":["../../src/commands/dev-base-esbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,wBAA8B,MAAM,CAAC,MAAM,EAAE;IAC3C,WAAW,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,iBAgBA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {} from 'esbuild';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { getEsbuildContext } from '../lib/esbuild.js';
|
|
4
|
-
export default async function action(params) {
|
|
5
|
-
const { entryPoints, staticDir: outdir, certDir, port } = params;
|
|
6
|
-
const context = await getEsbuildContext({ sourcemap: 'inline', entryPoints, outdir });
|
|
7
|
-
const [_, serveResult] = await Promise.all([
|
|
8
|
-
context.watch(),
|
|
9
|
-
context.serve({
|
|
10
|
-
port,
|
|
11
|
-
keyfile: path.join(certDir, 'localhost-key.pem'),
|
|
12
|
-
certfile: path.join(certDir, 'localhost-cert.pem'),
|
|
13
|
-
servedir: outdir,
|
|
14
|
-
}),
|
|
15
|
-
]);
|
|
16
|
-
console.log(`🚀 Start development server at https://localhost:${serveResult.port}`);
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=dev-base-esbuild.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-base-esbuild.js","sourceRoot":"","sources":["../../src/commands/dev-base-esbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,MAAM,CAAC,MAKpC;IACC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAEjE,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtF,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACzC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,KAAK,CAAC;YACZ,IAAI;YACJ,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC;YAChD,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC;YAClD,QAAQ,EAAE,MAAM;SACjB,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,oDAAoD,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"genkey-base.d.ts","sourceRoot":"","sources":["../../src/commands/genkey-base.ts"],"names":[],"mappings":"AAEA,wBAA8B,MAAM,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,iBAe/D"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { generateCert } from '../lib/cert.js';
|
|
2
|
-
export default async function action(options) {
|
|
3
|
-
const { output } = options;
|
|
4
|
-
console.group('🍳 Generate SSL key for localhost');
|
|
5
|
-
try {
|
|
6
|
-
const { stdout } = await generateCert(output);
|
|
7
|
-
if (stdout) {
|
|
8
|
-
console.log(stdout);
|
|
9
|
-
}
|
|
10
|
-
console.log(`🔑 key generation success. Output to ./${output}`);
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
throw error;
|
|
14
|
-
}
|
|
15
|
-
finally {
|
|
16
|
-
console.groupEnd();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=genkey-base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"genkey-base.js","sourceRoot":"","sources":["../../src/commands/genkey-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,MAAM,CAAC,OAA2B;IAC9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACnD,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,0CAA0C,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"genkey.d.ts","sourceRoot":"","sources":["../../src/commands/genkey.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,SAM9B;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,iBAEvD"}
|
package/dist/commands/genkey.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import base from './genkey-base.js';
|
|
3
|
-
import { WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
4
|
-
export default function command() {
|
|
5
|
-
program
|
|
6
|
-
.command('genkey')
|
|
7
|
-
.description('Generate SSL key for localhost. (Require mkcert)')
|
|
8
|
-
.option('-o, --output <output>', 'Output directory.', WORKSPACE_DIRECTORY)
|
|
9
|
-
.action(action);
|
|
10
|
-
}
|
|
11
|
-
export async function action(options) {
|
|
12
|
-
await base(options);
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=genkey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"genkey.js","sourceRoot":"","sources":["../../src/commands/genkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,uBAAuB,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;SACzE,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAA2B;IACtD,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC"}
|
package/dist/commands/lint.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,OAAO,SAM9B;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,iBAOA"}
|
package/dist/commands/lint.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import { lint } from '../lib/lint.js';
|
|
3
|
-
export default function command() {
|
|
4
|
-
program
|
|
5
|
-
.command('lint')
|
|
6
|
-
.description('Lint source files')
|
|
7
|
-
.option('-c, --config <config>', 'Config file path')
|
|
8
|
-
.action(action);
|
|
9
|
-
}
|
|
10
|
-
export async function action(options) {
|
|
11
|
-
try {
|
|
12
|
-
lint();
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
throw error;
|
|
16
|
-
}
|
|
17
|
-
finally {
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=lint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,mBAAmB,CAAC;SAChC,MAAM,CAAC,uBAAuB,EAAE,kBAAkB,CAAC;SACnD,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAK5B;IACC,IAAI,CAAC;QACH,IAAI,EAAE,CAAC;IACT,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/manifest/index.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,IAAI,CAKtC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import { outputManifest } from '../../lib/plugin-manifest.js';
|
|
3
|
-
import { copyPluginContents } from '../../lib/plugin-contents.js';
|
|
4
|
-
export default function command() {
|
|
5
|
-
program
|
|
6
|
-
.command('manifest')
|
|
7
|
-
.option('-e, --env <env>', 'create manifest', 'prod')
|
|
8
|
-
.action(action);
|
|
9
|
-
}
|
|
10
|
-
async function action(options) {
|
|
11
|
-
console.group('🚀 Executing manifest generation');
|
|
12
|
-
try {
|
|
13
|
-
const { env } = options;
|
|
14
|
-
if (env !== 'prod' && env !== 'dev' && env !== 'standalone') {
|
|
15
|
-
throw new Error('Invalid environment');
|
|
16
|
-
}
|
|
17
|
-
await copyPluginContents();
|
|
18
|
-
console.log('📁 contents copied');
|
|
19
|
-
await outputManifest(env);
|
|
20
|
-
console.log(`📝 manifest.json generated (${env})`);
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
throw error;
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
console.groupEnd();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,CAAC;SACpD,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,OAAwB;IAC5C,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAClD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACxB,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,YAAY,EAAE,CAAC;YAC5D,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,kBAAkB,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAElC,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,+BAA+B,GAAG,GAAG,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-build.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-build.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,SAK9B;AAED,wBAAsB,MAAM,kBAiD3B"}
|