@konomi-app/k2 0.4.1 → 0.4.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.
@@ -11,11 +11,16 @@ import packer from '@kintone/plugin-packer';
11
11
  import { uploadZip } from '../lib/utils.js';
12
12
  import base from './dev-base-esbuild.js';
13
13
  export default function command() {
14
- program.command('dev').description('Start development server.').action(action);
14
+ program
15
+ .command('dev')
16
+ .option('-p, --ppk <ppk>', '.ppk file path', path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk'))
17
+ .description('Start development server.')
18
+ .action(action);
15
19
  }
16
- export async function action() {
20
+ export async function action(options) {
17
21
  console.group('🍳 Start development server');
18
22
  try {
23
+ const { ppk: ppkPath } = options;
19
24
  const config = await importPluginConfig();
20
25
  const port = config.server?.port ?? DEFAULT_PORT;
21
26
  const manifest = await outputManifest('dev', {
@@ -63,10 +68,11 @@ export async function action() {
63
68
  watcher.on('unlink', contentsListener);
64
69
  await outputContentsZip(manifest);
65
70
  const buffer = await getContentsZipBuffer();
66
- const pluginPrivateKey = await fs.readFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk'), 'utf8');
71
+ const pluginPrivateKey = await fs.readFile(path.resolve(ppkPath), 'utf8');
67
72
  const output = await packer(buffer, pluginPrivateKey);
68
73
  const zipFileName = `plugin${getZipFileNameSuffix('dev')}.zip`;
69
74
  await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, zipFileName), output.plugin);
75
+ console.log(`📤 uploading ${zipFileName} to your kintone`);
70
76
  uploadZip('dev').then(({ stdout, stderr }) => {
71
77
  console.log(stdout);
72
78
  console.error(stderr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konomi-app/k2",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "kintone sdk",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -54,4 +54,4 @@
54
54
  "@types/html-minifier": "^4",
55
55
  "typescript": "*"
56
56
  }
57
- }
57
+ }