@konomi-app/k2 1.11.0 → 1.12.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/dist/commands/build-base.d.ts +6 -0
- package/dist/commands/build-base.d.ts.map +1 -0
- package/dist/commands/build-base.js +7 -0
- package/dist/commands/build-base.js.map +1 -0
- package/dist/commands/build-esbuild.d.ts +7 -0
- package/dist/commands/build-esbuild.d.ts.map +1 -0
- package/dist/commands/build-esbuild.js +63 -0
- package/dist/commands/build-esbuild.js.map +1 -0
- package/dist/commands/build-tailwind.d.ts +2 -0
- package/dist/commands/build-tailwind.d.ts.map +1 -0
- package/dist/commands/build-tailwind.js +19 -0
- package/dist/commands/build-tailwind.js.map +1 -0
- package/dist/commands/build.d.ts +7 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +52 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/dev/index.d.ts +9 -0
- package/dist/commands/dev/index.d.ts.map +1 -0
- package/dist/commands/dev/index.js +60 -0
- package/dist/commands/dev/index.js.map +1 -0
- package/dist/commands/dev/tailwind.d.ts +5 -0
- package/dist/commands/dev/tailwind.d.ts.map +1 -0
- package/dist/commands/dev/tailwind.js +30 -0
- package/dist/commands/dev/tailwind.js.map +1 -0
- package/dist/commands/dev-base-esbuild.d.ts +8 -0
- package/dist/commands/dev-base-esbuild.d.ts.map +1 -0
- package/dist/commands/dev-base-esbuild.js +18 -0
- package/dist/commands/dev-base-esbuild.js.map +1 -0
- package/dist/commands/genkey-base.d.ts +4 -0
- package/dist/commands/genkey-base.d.ts.map +1 -0
- package/dist/commands/genkey-base.js +19 -0
- package/dist/commands/genkey-base.js.map +1 -0
- package/dist/commands/genkey.d.ts +5 -0
- package/dist/commands/genkey.d.ts.map +1 -0
- package/dist/commands/genkey.js +14 -0
- package/dist/commands/genkey.js.map +1 -0
- package/dist/commands/lint.d.ts +8 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +20 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/manifest/index.d.ts +2 -0
- package/dist/commands/manifest/index.d.ts.map +1 -0
- package/dist/commands/manifest/index.js +29 -0
- package/dist/commands/manifest/index.js.map +1 -0
- package/dist/commands/plugin-build.d.ts +3 -0
- package/dist/commands/plugin-build.d.ts.map +1 -0
- package/dist/commands/plugin-build.js +60 -0
- package/dist/commands/plugin-build.js.map +1 -0
- package/dist/commands/plugin-dev/create-manifest.d.ts +5 -0
- package/dist/commands/plugin-dev/create-manifest.d.ts.map +1 -0
- package/dist/commands/plugin-dev/create-manifest.js +30 -0
- package/dist/commands/plugin-dev/create-manifest.js.map +1 -0
- package/dist/commands/plugin-dev/index.d.ts +6 -0
- package/dist/commands/plugin-dev/index.d.ts.map +1 -0
- package/dist/commands/plugin-dev/index.js +50 -0
- package/dist/commands/plugin-dev/index.js.map +1 -0
- package/dist/commands/plugin-dev/tailwind.d.ts +2 -0
- package/dist/commands/plugin-dev/tailwind.d.ts.map +1 -0
- package/dist/commands/plugin-dev/tailwind.js +42 -0
- package/dist/commands/plugin-dev/tailwind.js.map +1 -0
- package/dist/commands/plugin-dev/upload.d.ts +5 -0
- package/dist/commands/plugin-dev/upload.d.ts.map +1 -0
- package/dist/commands/plugin-dev/upload.js +58 -0
- package/dist/commands/plugin-dev/upload.js.map +1 -0
- package/dist/commands/plugin-esbuild.d.ts +3 -0
- package/dist/commands/plugin-esbuild.d.ts.map +1 -0
- package/dist/commands/plugin-esbuild.js +66 -0
- package/dist/commands/plugin-esbuild.js.map +1 -0
- package/dist/commands/plugin-genkey.d.ts +3 -0
- package/dist/commands/plugin-genkey.d.ts.map +1 -0
- package/dist/commands/plugin-genkey.js +13 -0
- package/dist/commands/plugin-genkey.js.map +1 -0
- package/dist/commands/plugin-init.d.ts +3 -0
- package/dist/commands/plugin-init.d.ts.map +1 -0
- package/dist/commands/plugin-init.js +45 -0
- package/dist/commands/plugin-init.js.map +1 -0
- package/dist/commands/plugin-tsup.d.ts +3 -0
- package/dist/commands/plugin-tsup.d.ts.map +1 -0
- package/dist/commands/plugin-tsup.js +65 -0
- package/dist/commands/plugin-tsup.js.map +1 -0
- package/dist/commands/plugin-zip.d.ts +2 -0
- package/dist/commands/plugin-zip.d.ts.map +1 -0
- package/dist/commands/plugin-zip.js +46 -0
- package/dist/commands/plugin-zip.js.map +1 -0
- package/dist/commands/test/index.d.ts +3 -0
- package/dist/commands/test/index.d.ts.map +1 -0
- package/dist/commands/test/index.js +17 -0
- package/dist/commands/test/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cert.d.ts +4 -0
- package/dist/lib/cert.d.ts.map +1 -0
- package/dist/lib/cert.js +16 -0
- package/dist/lib/cert.js.map +1 -0
- package/dist/lib/constants.d.ts +13 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +14 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/esbuild.d.ts +6 -0
- package/dist/lib/esbuild.d.ts.map +1 -0
- package/dist/lib/esbuild.js +39 -0
- package/dist/lib/esbuild.js.map +1 -0
- package/dist/lib/exec.d.ts +3 -0
- package/dist/lib/exec.d.ts.map +1 -0
- package/dist/lib/exec.js +4 -0
- package/dist/lib/exec.js.map +1 -0
- package/dist/lib/import.d.ts +4 -0
- package/dist/lib/import.d.ts.map +1 -0
- package/dist/lib/import.js +18 -0
- package/dist/lib/import.js.map +1 -0
- package/dist/lib/k2.d.ts +2 -0
- package/dist/lib/k2.d.ts.map +1 -0
- package/dist/lib/k2.js +9 -0
- package/dist/lib/k2.js.map +1 -0
- package/dist/lib/kintone-api-client.d.ts +57 -0
- package/dist/lib/kintone-api-client.d.ts.map +1 -0
- package/dist/lib/kintone-api-client.js +95 -0
- package/dist/lib/kintone-api-client.js.map +1 -0
- package/dist/lib/lint.d.ts +2 -0
- package/dist/lib/lint.d.ts.map +1 -0
- package/dist/lib/lint.js +28 -0
- package/dist/lib/lint.js.map +1 -0
- package/dist/lib/plugin-contents.d.ts +5 -0
- package/dist/lib/plugin-contents.d.ts.map +1 -0
- package/dist/lib/plugin-contents.js +28 -0
- package/dist/lib/plugin-contents.js.map +1 -0
- package/dist/lib/plugin-manifest.d.ts +4 -0
- package/dist/lib/plugin-manifest.d.ts.map +1 -0
- package/dist/lib/plugin-manifest.js +13 -0
- package/dist/lib/plugin-manifest.js.map +1 -0
- package/dist/lib/tailwind.d.ts +33 -0
- package/dist/lib/tailwind.d.ts.map +1 -0
- package/dist/lib/tailwind.js +91 -0
- package/dist/lib/tailwind.js.map +1 -0
- package/dist/lib/tsup.d.ts +3 -0
- package/dist/lib/tsup.d.ts.map +1 -0
- package/dist/lib/tsup.js +26 -0
- package/dist/lib/tsup.js.map +1 -0
- package/dist/lib/utils.d.ts +16 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +66 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/webpack.d.ts +6 -0
- package/dist/lib/webpack.d.ts.map +1 -0
- package/dist/lib/webpack.js +72 -0
- package/dist/lib/webpack.js.map +1 -0
- package/dist/lib/zip.d.ts +4 -0
- package/dist/lib/zip.d.ts.map +1 -0
- package/dist/lib/zip.js +65 -0
- package/dist/lib/zip.js.map +1 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +25 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +43 -43
- package/types/k2.d.ts +2 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { outputManifest } from '../../lib/plugin-manifest.js';
|
|
2
|
+
export const getManifest = async (params) => {
|
|
3
|
+
const { config, port } = params;
|
|
4
|
+
return outputManifest('dev', {
|
|
5
|
+
config: {
|
|
6
|
+
...config,
|
|
7
|
+
manifest: {
|
|
8
|
+
...config.manifest,
|
|
9
|
+
dev: {
|
|
10
|
+
config: {
|
|
11
|
+
...config.manifest?.dev?.config,
|
|
12
|
+
js: [`https://localhost:${port}/config.js`],
|
|
13
|
+
css: [`https://localhost:${port}/config.css`],
|
|
14
|
+
},
|
|
15
|
+
desktop: {
|
|
16
|
+
...config.manifest?.dev?.desktop,
|
|
17
|
+
js: [`https://localhost:${port}/desktop.js`],
|
|
18
|
+
css: [`https://localhost:${port}/desktop.css`],
|
|
19
|
+
},
|
|
20
|
+
mobile: {
|
|
21
|
+
...config.manifest?.dev?.mobile,
|
|
22
|
+
js: [`https://localhost:${port}/desktop.js`],
|
|
23
|
+
css: [`https://localhost:${port}/desktop.css`],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=create-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-manifest.js","sourceRoot":"","sources":["../../../src/commands/plugin-dev/create-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,MAAoD,EAAE,EAAE;IACxF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAChC,OAAO,cAAc,CAAC,KAAK,EAAE;QAC3B,MAAM,EAAE;YACN,GAAG,MAAM;YACT,QAAQ,EAAE;gBACR,GAAG,MAAM,CAAC,QAAQ;gBAClB,GAAG,EAAE;oBACH,MAAM,EAAE;wBACN,GAAG,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM;wBAC/B,EAAE,EAAE,CAAC,qBAAqB,IAAI,YAAY,CAAC;wBAC3C,GAAG,EAAE,CAAC,qBAAqB,IAAI,aAAa,CAAC;qBAC9C;oBACD,OAAO,EAAE;wBACP,GAAG,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO;wBAChC,EAAE,EAAE,CAAC,qBAAqB,IAAI,aAAa,CAAC;wBAC5C,GAAG,EAAE,CAAC,qBAAqB,IAAI,cAAc,CAAC;qBAC/C;oBACD,MAAM,EAAE;wBACN,GAAG,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM;wBAC/B,EAAE,EAAE,CAAC,qBAAqB,IAAI,aAAa,CAAC;wBAC5C,GAAG,EAAE,CAAC,qBAAqB,IAAI,cAAc,CAAC;qBAC/C;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin-dev/index.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,UAAU,OAAO,SAW9B;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,iBAyBrE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { program } from 'commander';
|
|
2
|
+
import {} from 'esbuild';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { DEFAULT_PORT, PLUGIN_DEVELOPMENT_DIRECTORY, PLUGIN_WORKSPACE_DIRECTORY, } from '../../lib/constants.js';
|
|
6
|
+
import { importK2PluginConfig } from '../../lib/import.js';
|
|
7
|
+
import base from '../dev-base-esbuild.js';
|
|
8
|
+
import { getManifest } from './create-manifest.js';
|
|
9
|
+
import { watchCss } from './tailwind.js';
|
|
10
|
+
import { watchContentsAndUploadZip } from './upload.js';
|
|
11
|
+
export default function command() {
|
|
12
|
+
program
|
|
13
|
+
.command('dev')
|
|
14
|
+
.option('-p, --ppk <ppk>', '.ppk file path', path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk'))
|
|
15
|
+
.option('-c, --cert-dir <certDir>', 'Certificate directory', PLUGIN_WORKSPACE_DIRECTORY)
|
|
16
|
+
.description('Start development server.')
|
|
17
|
+
.action(action);
|
|
18
|
+
}
|
|
19
|
+
export async function action(options) {
|
|
20
|
+
console.group('🍳 Start development server');
|
|
21
|
+
try {
|
|
22
|
+
const { ppk: ppkPath, certDir } = options;
|
|
23
|
+
const config = await importK2PluginConfig();
|
|
24
|
+
if (!fs.existsSync(PLUGIN_DEVELOPMENT_DIRECTORY)) {
|
|
25
|
+
await fs.mkdir(PLUGIN_DEVELOPMENT_DIRECTORY, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
const port = config.server?.port ?? DEFAULT_PORT;
|
|
28
|
+
const manifest = await getManifest({ config, port });
|
|
29
|
+
console.log(`📝 manifest.json generated`);
|
|
30
|
+
Promise.all([
|
|
31
|
+
watchContentsAndUploadZip({ manifest, ppkPath }),
|
|
32
|
+
watchCss(config),
|
|
33
|
+
build(port, certDir),
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
console.groupEnd();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function build(port, certDir = PLUGIN_WORKSPACE_DIRECTORY, staticDir = PLUGIN_DEVELOPMENT_DIRECTORY) {
|
|
44
|
+
const entryPoints = ['desktop', 'config'].map((dir) => ({
|
|
45
|
+
in: path.join('src', dir, 'index.ts'),
|
|
46
|
+
out: dir,
|
|
47
|
+
}));
|
|
48
|
+
base({ port, entryPoints, certDir, staticDir });
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/plugin-dev/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MA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D,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAE1C,OAAO,CAAC,GAAG,CAAC;YACV,yBAAyB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;YAChD,QAAQ,CAAC,MAAM,CAAC;YAChB,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;SACrB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,KAAK,CAClB,IAAY,EACZ,OAAO,GAAG,0BAA0B,EACpC,SAAS,GAAG,4BAA4B;IAExC,MAAM,WAAW,GAAgC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACnF,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC;QACrC,GAAG,EAAE,GAAG;KACT,CAAC,CAAC,CAAC;IAEJ,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin-dev/tailwind.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,QAAQ,GAAU,cAAc,MAAM,CAAC,IAAI,CAAC,MAAM,sFAqB9D,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import {} from 'tailwindcss';
|
|
3
|
+
import { PLUGIN_DEVELOPMENT_DIRECTORY } from '../../lib/constants.js';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { getTailwindConfig, getTailwindInputCss, watchTailwindCSS } from '../../lib/tailwind.js';
|
|
6
|
+
async function buildTailwindCSS(params) {
|
|
7
|
+
const { inputFile, outputFileName, config } = params;
|
|
8
|
+
const inputPath = path.resolve(inputFile);
|
|
9
|
+
const outputPath = path.join(PLUGIN_DEVELOPMENT_DIRECTORY, outputFileName);
|
|
10
|
+
return watchTailwindCSS({
|
|
11
|
+
input: inputPath,
|
|
12
|
+
output: outputPath,
|
|
13
|
+
config,
|
|
14
|
+
onChanges: ({ output, type }) => {
|
|
15
|
+
const outputFileName = path.basename(output);
|
|
16
|
+
console.log(chalk.hex('#e5e7eb')(`${new Date().toLocaleTimeString()} `) +
|
|
17
|
+
chalk.cyan(`[css] `) +
|
|
18
|
+
outputFileName +
|
|
19
|
+
(type === 'init' ? ' init' : ` rebuilt`));
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export const watchCss = async (pluginConfig) => {
|
|
24
|
+
if (!pluginConfig.tailwind?.css || !pluginConfig.tailwind?.config) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const tailwindConfig = await getTailwindConfig(pluginConfig.tailwind);
|
|
28
|
+
const inputFile = getTailwindInputCss(pluginConfig.tailwind);
|
|
29
|
+
return Promise.all([
|
|
30
|
+
buildTailwindCSS({
|
|
31
|
+
inputFile: inputFile.desktop,
|
|
32
|
+
outputFileName: 'desktop.css',
|
|
33
|
+
config: tailwindConfig.desktop,
|
|
34
|
+
}),
|
|
35
|
+
buildTailwindCSS({
|
|
36
|
+
inputFile: inputFile.config,
|
|
37
|
+
outputFileName: 'config.css',
|
|
38
|
+
config: tailwindConfig.config,
|
|
39
|
+
}),
|
|
40
|
+
]);
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=tailwind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind.js","sourceRoot":"","sources":["../../../src/commands/plugin-dev/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAA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CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEtE,MAAM,SAAS,GAAG,mBAAmB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAE7D,OAAO,OAAO,CAAC,GAAG,CAAC;QACjB,gBAAgB,CAAC;YACf,SAAS,EAAE,SAAS,CAAC,OAAO;YAC5B,cAAc,EAAE,aAAa;YAC7B,MAAM,EAAE,cAAc,CAAC,OAAO;SAC/B,CAAC;QACF,gBAAgB,CAAC;YACf,SAAS,EAAE,SAAS,CAAC,MAAM;YAC3B,cAAc,EAAE,YAAY;YAC5B,MAAM,EAAE,cAAc,CAAC,MAAM;SAC9B,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin-dev/upload.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,yBAAyB,GAAU,QAAQ;IACtD,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB,kBA6DA,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import packer from '@kintone/plugin-packer';
|
|
2
|
+
import { copyPluginContents } from '../../lib/plugin-contents.js';
|
|
3
|
+
import { getContentsZipBuffer, getZipFileNameSuffix, outputContentsZip } from '../../lib/zip.js';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { PLUGIN_WORKSPACE_DIRECTORY } from '../../lib/constants.js';
|
|
7
|
+
import { apiUploadZip } from '../../lib/utils.js';
|
|
8
|
+
import chokider from 'chokidar';
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
export const watchContentsAndUploadZip = async (params) => {
|
|
11
|
+
const { manifest, ppkPath } = params;
|
|
12
|
+
let initialScanComplete = false;
|
|
13
|
+
const contentsListener = async () => {
|
|
14
|
+
try {
|
|
15
|
+
if (!initialScanComplete) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
await copyPluginContents();
|
|
19
|
+
console.log(chalk.hex('#e5e7eb')(`${new Date().toLocaleTimeString()} `) +
|
|
20
|
+
chalk.cyan(`[contents] `) +
|
|
21
|
+
`updated`);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error('Error copying plugin contents:', error);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
await outputContentsZip(manifest);
|
|
29
|
+
const buffer = await getContentsZipBuffer();
|
|
30
|
+
const pluginPrivateKey = await fs.readFile(path.resolve(ppkPath), 'utf8');
|
|
31
|
+
const output = await packer(buffer, pluginPrivateKey);
|
|
32
|
+
const zipFileName = `plugin${getZipFileNameSuffix('dev')}.zip`;
|
|
33
|
+
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, zipFileName), output.plugin);
|
|
34
|
+
const { method } = await apiUploadZip({ env: 'dev', pluginId: output.id });
|
|
35
|
+
console.log(chalk.hex('#e5e7eb')(`${new Date().toLocaleTimeString()} `) +
|
|
36
|
+
chalk.cyan(`[upload] `) +
|
|
37
|
+
`uploaded ${method === 'POST' ? '(new)' : '(update)'}`);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.log(chalk.hex('#e5e7eb')(`${new Date().toLocaleTimeString()} `) +
|
|
41
|
+
chalk.cyan(`[upload] `) +
|
|
42
|
+
chalk.red(`failed`) +
|
|
43
|
+
chalk.hex('#e5e7eb')(`: ${error?.message ?? 'Unknown error'}`));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const contentsWatcher = chokider.watch(['src/contents/**/*'], {
|
|
47
|
+
ignored: /node_modules/,
|
|
48
|
+
persistent: true,
|
|
49
|
+
});
|
|
50
|
+
contentsWatcher.on('ready', () => {
|
|
51
|
+
initialScanComplete = true;
|
|
52
|
+
contentsListener();
|
|
53
|
+
});
|
|
54
|
+
contentsWatcher.on('change', contentsListener);
|
|
55
|
+
contentsWatcher.on('add', contentsListener);
|
|
56
|
+
contentsWatcher.on('unlink', contentsListener);
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/plugin-dev/upload.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAAE,MAG/C,EAAE,EAAE;IACH,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAErC,IAAI,mBAAmB,GAAG,KAAK,CAAC;IAEhC,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;QAClC,IAAI,CAAC;YACH,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBACzB,OAAO;YACT,CAAC;YACD,MAAM,kBAAkB,EAAE,CAAC;YAC3B,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,aAAa,CAAC;gBACzB,SAAS,CACZ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE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AG,CAAC,QAAQ,CAAC;gBACnB,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,CAAC,CACjE,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,mBAAmB,CAAC,EAAE;QAC5D,OAAO,EAAE,cAAc;QACvB,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IAEH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QAC/B,mBAAmB,GAAG,IAAI,CAAC;QAC3B,gBAAgB,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAC5C,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;AACjD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-esbuild.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-esbuild.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,SAK9B;AAED,wBAAsB,MAAM,kBAuD3B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { program } from 'commander';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { PLUGIN_CONTENTS_DIRECTORY } from '../lib/constants.js';
|
|
5
|
+
import { importK2PluginConfig } from '../lib/import.js';
|
|
6
|
+
import { getTailwindConfig, getTailwindInputCss, outputCss } from '../lib/tailwind.js';
|
|
7
|
+
import {} from 'esbuild';
|
|
8
|
+
import { buildWithEsbuild } from '../lib/esbuild.js';
|
|
9
|
+
import { lint } from '../lib/lint.js';
|
|
10
|
+
export default function command() {
|
|
11
|
+
program
|
|
12
|
+
.command('esbuild')
|
|
13
|
+
.description("Build the project for production. (It's a wrapper of webpack build command.)")
|
|
14
|
+
.action(action);
|
|
15
|
+
}
|
|
16
|
+
export async function action() {
|
|
17
|
+
console.group('🍳 Build the project for production');
|
|
18
|
+
try {
|
|
19
|
+
const config = await importK2PluginConfig();
|
|
20
|
+
if (config?.lint?.build) {
|
|
21
|
+
await lint();
|
|
22
|
+
console.log('✨ Lint success.');
|
|
23
|
+
}
|
|
24
|
+
if (!fs.existsSync(PLUGIN_CONTENTS_DIRECTORY)) {
|
|
25
|
+
await fs.mkdir(PLUGIN_CONTENTS_DIRECTORY, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
if (config.tailwind?.css && config.tailwind?.config) {
|
|
28
|
+
const tailwindConfig = await getTailwindConfig(config.tailwind);
|
|
29
|
+
const inputFile = getTailwindInputCss(config.tailwind);
|
|
30
|
+
await outputCss({
|
|
31
|
+
inputPath: inputFile.config,
|
|
32
|
+
outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'config.css'),
|
|
33
|
+
config: tailwindConfig.config,
|
|
34
|
+
minify: true,
|
|
35
|
+
});
|
|
36
|
+
console.log('✨ Built config.css');
|
|
37
|
+
await outputCss({
|
|
38
|
+
inputPath: inputFile.desktop,
|
|
39
|
+
outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'desktop.css'),
|
|
40
|
+
config: tailwindConfig.desktop,
|
|
41
|
+
minify: true,
|
|
42
|
+
});
|
|
43
|
+
console.log('✨ Built desktop.css');
|
|
44
|
+
}
|
|
45
|
+
const entryPoints = ['desktop', 'config'].map((dir) => ({
|
|
46
|
+
in: path.join('src', dir, 'index.ts'),
|
|
47
|
+
out: dir,
|
|
48
|
+
}));
|
|
49
|
+
await buildWithEsbuild({
|
|
50
|
+
entryPoints,
|
|
51
|
+
outdir: PLUGIN_CONTENTS_DIRECTORY,
|
|
52
|
+
minify: true,
|
|
53
|
+
sourcemap: false,
|
|
54
|
+
legalComments: 'none',
|
|
55
|
+
});
|
|
56
|
+
console.log('✨ Built desktop.js and config.js');
|
|
57
|
+
console.log('✨ Build success.');
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
console.groupEnd();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=plugin-esbuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-esbuild.js","sourceRoot":"","sources":["../../src/commands/plugin-esbuild.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,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,8EAA8E,CAAC;SAC3F,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAErD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAE5C,IAAI,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YACxB,MAAM,IAAI,EAAE,CAA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AC,CAAC,CAAC;QAEJ,MAAM,gBAAgB,CAAC;YACrB,WAAW;YACX,MAAM,EAAE,yBAAyB;YACjC,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,KAAK;YAChB,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-genkey.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-genkey.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,SAK9B;AAED,wBAAsB,MAAM,kBAE3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { program } from 'commander';
|
|
2
|
+
import base from './genkey-base.js';
|
|
3
|
+
import { PLUGIN_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
|
+
.action(action);
|
|
9
|
+
}
|
|
10
|
+
export async function action() {
|
|
11
|
+
await base({ output: PLUGIN_WORKSPACE_DIRECTORY });
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=plugin-genkey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-genkey.js","sourceRoot":"","sources":["../../src/commands/plugin-genkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,MAAM,IAAI,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-init.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-init.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,OAAO,SAE9B;AAED,wBAAsB,MAAM,kBAkC3B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { program } from 'commander';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import packer from '@kintone/plugin-packer';
|
|
5
|
+
import { outputManifest } from '../lib/plugin-manifest.js';
|
|
6
|
+
import { PLUGIN_WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
7
|
+
import { getContentsZipBuffer, outputContentsZip } from '../lib/zip.js';
|
|
8
|
+
import { copyPluginContents } from '../lib/plugin-contents.js';
|
|
9
|
+
export default function command() {
|
|
10
|
+
program.command('init').description('generate private.ppk and kitting config').action(action);
|
|
11
|
+
}
|
|
12
|
+
export async function action() {
|
|
13
|
+
console.group('🍳 Executing plugin initialization setup');
|
|
14
|
+
try {
|
|
15
|
+
const manifest = await outputManifest('dev');
|
|
16
|
+
console.log('📝 manifest.json generated');
|
|
17
|
+
await copyPluginContents();
|
|
18
|
+
console.log('📁 contents copied');
|
|
19
|
+
let privateKey;
|
|
20
|
+
const keyPath = path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk');
|
|
21
|
+
if (fs.existsSync(keyPath)) {
|
|
22
|
+
privateKey = await fs.readFile(keyPath, 'utf8');
|
|
23
|
+
}
|
|
24
|
+
await outputContentsZip(manifest);
|
|
25
|
+
const buffer = await getContentsZipBuffer();
|
|
26
|
+
const output = await packer(buffer, privateKey);
|
|
27
|
+
if (!privateKey) {
|
|
28
|
+
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk'), output.privateKey);
|
|
29
|
+
console.log('🔑 private.ppk generated');
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.log('🔑 private.ppk already exists. The existing private.ppk will be used.');
|
|
33
|
+
}
|
|
34
|
+
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, 'plugin.zip'), output.plugin);
|
|
35
|
+
console.log('📦 plugin.zip generated');
|
|
36
|
+
console.log('✨ Plugin initialization setup completed! zip file path is ./.plugin/plugin.zip');
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
console.groupEnd();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=plugin-init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-init.js","sourceRoot":"","sources":["../../src/commands/plugin-init.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,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO,CAAC,O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AC,MAAM,CAAC,CAAC;QACvF,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;IAChG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-tsup.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-tsup.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,SAK9B;AAED,wBAAsB,MAAM,kBA0D3B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { program } from 'commander';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { PLUGIN_CONTENTS_DIRECTORY } from '../lib/constants.js';
|
|
5
|
+
import { importK2PluginConfig } from '../lib/import.js';
|
|
6
|
+
import { lint } from '../lib/lint.js';
|
|
7
|
+
import { getTailwindConfig, getTailwindInputCss, outputCss } from '../lib/tailwind.js';
|
|
8
|
+
import { buildWithTsup } from '../lib/tsup.js';
|
|
9
|
+
export default function command() {
|
|
10
|
+
program
|
|
11
|
+
.command('tsup')
|
|
12
|
+
.description("Build the project for production. (It's a wrapper of webpack build command.)")
|
|
13
|
+
.action(action);
|
|
14
|
+
}
|
|
15
|
+
export async function action() {
|
|
16
|
+
console.group('🍳 Build the project for production');
|
|
17
|
+
try {
|
|
18
|
+
const config = await importK2PluginConfig();
|
|
19
|
+
if (config?.lint?.build) {
|
|
20
|
+
await lint();
|
|
21
|
+
console.log('✨ Lint success.');
|
|
22
|
+
}
|
|
23
|
+
if (!fs.existsSync(PLUGIN_CONTENTS_DIRECTORY)) {
|
|
24
|
+
await fs.mkdir(PLUGIN_CONTENTS_DIRECTORY, { recursive: true });
|
|
25
|
+
}
|
|
26
|
+
if (config.tailwind?.css && config.tailwind?.config) {
|
|
27
|
+
const tailwindConfig = await getTailwindConfig(config.tailwind);
|
|
28
|
+
const inputFile = getTailwindInputCss(config.tailwind);
|
|
29
|
+
await outputCss({
|
|
30
|
+
inputPath: inputFile.config,
|
|
31
|
+
outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'config.css'),
|
|
32
|
+
config: tailwindConfig.config,
|
|
33
|
+
minify: true,
|
|
34
|
+
});
|
|
35
|
+
console.log('✨ Built config.css');
|
|
36
|
+
await outputCss({
|
|
37
|
+
inputPath: inputFile.desktop,
|
|
38
|
+
outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'desktop.css'),
|
|
39
|
+
config: tailwindConfig.desktop,
|
|
40
|
+
minify: true,
|
|
41
|
+
});
|
|
42
|
+
console.log('✨ Built desktop.css');
|
|
43
|
+
}
|
|
44
|
+
const entryPoints = ['desktop', 'config'].reduce((acc, dir) => ({
|
|
45
|
+
...acc,
|
|
46
|
+
[dir]: path.join('src', dir, 'index.ts'),
|
|
47
|
+
}), {});
|
|
48
|
+
await buildWithTsup({
|
|
49
|
+
entryPoints,
|
|
50
|
+
outDir: PLUGIN_CONTENTS_DIRECTORY,
|
|
51
|
+
minify: true,
|
|
52
|
+
treeshake: true,
|
|
53
|
+
sourcemap: false,
|
|
54
|
+
});
|
|
55
|
+
console.log('✨ Built desktop.js and config.js');
|
|
56
|
+
console.log('✨ Build success.');
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
console.groupEnd();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=plugin-tsup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-tsup.js","sourceRoot":"","sources":["../../src/commands/plugin-tsup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MA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 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-zip.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-zip.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,IAAI,CAWtC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { program } from 'commander';
|
|
2
|
+
import { outputManifest } from '../lib/plugin-manifest.js';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { PLUGIN_WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
6
|
+
import packer from '@kintone/plugin-packer';
|
|
7
|
+
import { getContentsZipBuffer, getZipFileNameSuffix, outputContentsZip } from '../lib/zip.js';
|
|
8
|
+
import { copyPluginContents } from '../lib/plugin-contents.js';
|
|
9
|
+
import { isEnv } from '../lib/utils.js';
|
|
10
|
+
export default function command() {
|
|
11
|
+
program
|
|
12
|
+
.command('zip')
|
|
13
|
+
.description('generate plugin zip')
|
|
14
|
+
.option('-e, --env <env>', 'plugin environment (dev, prod, standalone)', 'prod')
|
|
15
|
+
.option('-p, --ppk <ppk>', '.ppk file path', path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk'))
|
|
16
|
+
.action(action);
|
|
17
|
+
}
|
|
18
|
+
async function action(options) {
|
|
19
|
+
console.group('🍳 Executing plugin zip generation');
|
|
20
|
+
try {
|
|
21
|
+
const { env, ppk: ppkPath } = options;
|
|
22
|
+
if (!isEnv(env)) {
|
|
23
|
+
throw new Error('Invalid environment');
|
|
24
|
+
}
|
|
25
|
+
await copyPluginContents();
|
|
26
|
+
console.log('📁 contents copied');
|
|
27
|
+
const manifest = await outputManifest(env);
|
|
28
|
+
console.log(`📝 manifest.json generated (${env})`);
|
|
29
|
+
await outputContentsZip(manifest);
|
|
30
|
+
console.log('📦 contents.zip generated');
|
|
31
|
+
const buffer = await getContentsZipBuffer();
|
|
32
|
+
const privateKey = await fs.readFile(path.resolve(ppkPath), 'utf8');
|
|
33
|
+
const output = await packer(buffer, privateKey);
|
|
34
|
+
const zipFileName = `plugin${getZipFileNameSuffix(env)}.zip`;
|
|
35
|
+
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, zipFileName), output.plugin);
|
|
36
|
+
console.log('📦 plugin.zip generated');
|
|
37
|
+
console.log(`✨ Plugin zip generation completed! zip file path is ./.plugin/${zipFileName}`);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
console.groupEnd();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=plugin-zip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-zip.js","sourceRoot":"","sources":["../../src/commands/plugin-zip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,qBAAqB,CAAC;SAClC,MAAM,CAAC,iBAAiB,EAAE,4CAA4C,EAAE,MAAM,CAAC;SAC/E,MAAM,CACL,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,CAAC,IAAI,CAAC,0BAA0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;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/test/index.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,SAE9B;AAED,wBAAsB,MAAM,kBAU3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { program } from 'commander';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { esmImport } from '../../lib/import.js';
|
|
4
|
+
export default function command() {
|
|
5
|
+
program.command('test').description('test').action(action);
|
|
6
|
+
}
|
|
7
|
+
export async function action() {
|
|
8
|
+
console.group('package.json');
|
|
9
|
+
const packageJson = fs.readJSONSync('package.json');
|
|
10
|
+
console.log('package.json detected');
|
|
11
|
+
console.groupEnd();
|
|
12
|
+
console.group('Config');
|
|
13
|
+
const config = await esmImport('plugin.config.mjs');
|
|
14
|
+
console.log('plugin.config.mjs detected', config);
|
|
15
|
+
console.groupEnd();
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,OAAO,CAAC,QAAQ,EAAE,CAAC;IAEnB,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,mBAAmB,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,CAAC,QAAQ,EAAE,CAAC;AACrB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { program } from 'commander';
|
|
3
|
+
import build from './commands/build.js';
|
|
4
|
+
import dev from './commands/dev/index.js';
|
|
5
|
+
import genkey from './commands/genkey.js';
|
|
6
|
+
import esbuildBuild from './commands/build-esbuild.js';
|
|
7
|
+
import lint from './commands/lint.js';
|
|
8
|
+
program.name('k2').version('1.12.0').description('k2 - 🍳 kintone kitchen 🍳');
|
|
9
|
+
build();
|
|
10
|
+
esbuildBuild();
|
|
11
|
+
dev();
|
|
12
|
+
genkey();
|
|
13
|
+
lint();
|
|
14
|
+
program.parse(process.argv);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,GAAG,MAAM,yBAAyB,CAAC;AAC1C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;AAE/E,KAAK,EAAE,CAAC;AACR,YAAY,EAAE,CAAC;AACf,GAAG,EAAE,CAAC;AACN,MAAM,EAAE,CAAC;AACT,IAAI,EAAE,CAAC;AAEP,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cert.d.ts","sourceRoot":"","sources":["../../src/lib/cert.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,GAAU,QAAQ,MAAM;;EAWhD,CAAC"}
|