@konomi-app/k2 2.1.3 → 2.1.4

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.
Files changed (157) hide show
  1. package/dist/index.d.ts +0 -2
  2. package/dist/index.js +551 -13
  3. package/dist/index.js.map +1 -1
  4. package/dist/plugin.d.ts +0 -2
  5. package/dist/plugin.js +1086 -23
  6. package/dist/plugin.js.map +1 -1
  7. package/package.json +4 -4
  8. package/dist/commands/build-base.d.ts +0 -6
  9. package/dist/commands/build-base.d.ts.map +0 -1
  10. package/dist/commands/build-base.js +0 -7
  11. package/dist/commands/build-base.js.map +0 -1
  12. package/dist/commands/build-esbuild.d.ts +0 -7
  13. package/dist/commands/build-esbuild.d.ts.map +0 -1
  14. package/dist/commands/build-esbuild.js +0 -63
  15. package/dist/commands/build-esbuild.js.map +0 -1
  16. package/dist/commands/build-tailwind.d.ts +0 -2
  17. package/dist/commands/build-tailwind.d.ts.map +0 -1
  18. package/dist/commands/build-tailwind.js +0 -19
  19. package/dist/commands/build-tailwind.js.map +0 -1
  20. package/dist/commands/build.d.ts +0 -7
  21. package/dist/commands/build.d.ts.map +0 -1
  22. package/dist/commands/build.js +0 -52
  23. package/dist/commands/build.js.map +0 -1
  24. package/dist/commands/dev/index.d.ts +0 -9
  25. package/dist/commands/dev/index.d.ts.map +0 -1
  26. package/dist/commands/dev/index.js +0 -60
  27. package/dist/commands/dev/index.js.map +0 -1
  28. package/dist/commands/dev/tailwind.d.ts +0 -5
  29. package/dist/commands/dev/tailwind.d.ts.map +0 -1
  30. package/dist/commands/dev/tailwind.js +0 -30
  31. package/dist/commands/dev/tailwind.js.map +0 -1
  32. package/dist/commands/dev-base-esbuild.d.ts +0 -8
  33. package/dist/commands/dev-base-esbuild.d.ts.map +0 -1
  34. package/dist/commands/dev-base-esbuild.js +0 -18
  35. package/dist/commands/dev-base-esbuild.js.map +0 -1
  36. package/dist/commands/genkey-base.d.ts +0 -4
  37. package/dist/commands/genkey-base.d.ts.map +0 -1
  38. package/dist/commands/genkey-base.js +0 -19
  39. package/dist/commands/genkey-base.js.map +0 -1
  40. package/dist/commands/genkey.d.ts +0 -5
  41. package/dist/commands/genkey.d.ts.map +0 -1
  42. package/dist/commands/genkey.js +0 -14
  43. package/dist/commands/genkey.js.map +0 -1
  44. package/dist/commands/lint.d.ts +0 -8
  45. package/dist/commands/lint.d.ts.map +0 -1
  46. package/dist/commands/lint.js +0 -20
  47. package/dist/commands/lint.js.map +0 -1
  48. package/dist/commands/manifest/index.d.ts +0 -2
  49. package/dist/commands/manifest/index.d.ts.map +0 -1
  50. package/dist/commands/manifest/index.js +0 -29
  51. package/dist/commands/manifest/index.js.map +0 -1
  52. package/dist/commands/plugin-build.d.ts +0 -3
  53. package/dist/commands/plugin-build.d.ts.map +0 -1
  54. package/dist/commands/plugin-build.js +0 -60
  55. package/dist/commands/plugin-build.js.map +0 -1
  56. package/dist/commands/plugin-dev/create-manifest.d.ts +0 -5
  57. package/dist/commands/plugin-dev/create-manifest.d.ts.map +0 -1
  58. package/dist/commands/plugin-dev/create-manifest.js +0 -30
  59. package/dist/commands/plugin-dev/create-manifest.js.map +0 -1
  60. package/dist/commands/plugin-dev/index.d.ts +0 -6
  61. package/dist/commands/plugin-dev/index.d.ts.map +0 -1
  62. package/dist/commands/plugin-dev/index.js +0 -50
  63. package/dist/commands/plugin-dev/index.js.map +0 -1
  64. package/dist/commands/plugin-dev/tailwind.d.ts +0 -2
  65. package/dist/commands/plugin-dev/tailwind.d.ts.map +0 -1
  66. package/dist/commands/plugin-dev/tailwind.js +0 -42
  67. package/dist/commands/plugin-dev/tailwind.js.map +0 -1
  68. package/dist/commands/plugin-dev/upload.d.ts +0 -5
  69. package/dist/commands/plugin-dev/upload.d.ts.map +0 -1
  70. package/dist/commands/plugin-dev/upload.js +0 -58
  71. package/dist/commands/plugin-dev/upload.js.map +0 -1
  72. package/dist/commands/plugin-esbuild.d.ts +0 -3
  73. package/dist/commands/plugin-esbuild.d.ts.map +0 -1
  74. package/dist/commands/plugin-esbuild.js +0 -66
  75. package/dist/commands/plugin-esbuild.js.map +0 -1
  76. package/dist/commands/plugin-genkey.d.ts +0 -3
  77. package/dist/commands/plugin-genkey.d.ts.map +0 -1
  78. package/dist/commands/plugin-genkey.js +0 -13
  79. package/dist/commands/plugin-genkey.js.map +0 -1
  80. package/dist/commands/plugin-init.d.ts +0 -3
  81. package/dist/commands/plugin-init.d.ts.map +0 -1
  82. package/dist/commands/plugin-init.js +0 -45
  83. package/dist/commands/plugin-init.js.map +0 -1
  84. package/dist/commands/plugin-tsup.d.ts +0 -3
  85. package/dist/commands/plugin-tsup.d.ts.map +0 -1
  86. package/dist/commands/plugin-tsup.js +0 -65
  87. package/dist/commands/plugin-tsup.js.map +0 -1
  88. package/dist/commands/plugin-zip.d.ts +0 -2
  89. package/dist/commands/plugin-zip.d.ts.map +0 -1
  90. package/dist/commands/plugin-zip.js +0 -50
  91. package/dist/commands/plugin-zip.js.map +0 -1
  92. package/dist/commands/test/index.d.ts +0 -3
  93. package/dist/commands/test/index.d.ts.map +0 -1
  94. package/dist/commands/test/index.js +0 -17
  95. package/dist/commands/test/index.js.map +0 -1
  96. package/dist/index.d.ts.map +0 -1
  97. package/dist/lib/cert.d.ts +0 -4
  98. package/dist/lib/cert.d.ts.map +0 -1
  99. package/dist/lib/cert.js +0 -16
  100. package/dist/lib/cert.js.map +0 -1
  101. package/dist/lib/constants.d.ts +0 -13
  102. package/dist/lib/constants.d.ts.map +0 -1
  103. package/dist/lib/constants.js +0 -14
  104. package/dist/lib/constants.js.map +0 -1
  105. package/dist/lib/esbuild.d.ts +0 -6
  106. package/dist/lib/esbuild.d.ts.map +0 -1
  107. package/dist/lib/esbuild.js +0 -39
  108. package/dist/lib/esbuild.js.map +0 -1
  109. package/dist/lib/exec.d.ts +0 -3
  110. package/dist/lib/exec.d.ts.map +0 -1
  111. package/dist/lib/exec.js +0 -4
  112. package/dist/lib/exec.js.map +0 -1
  113. package/dist/lib/import.d.ts +0 -4
  114. package/dist/lib/import.d.ts.map +0 -1
  115. package/dist/lib/import.js +0 -18
  116. package/dist/lib/import.js.map +0 -1
  117. package/dist/lib/k2.d.ts +0 -2
  118. package/dist/lib/k2.d.ts.map +0 -1
  119. package/dist/lib/k2.js +0 -9
  120. package/dist/lib/k2.js.map +0 -1
  121. package/dist/lib/kintone-api-client.d.ts +0 -57
  122. package/dist/lib/kintone-api-client.d.ts.map +0 -1
  123. package/dist/lib/kintone-api-client.js +0 -95
  124. package/dist/lib/kintone-api-client.js.map +0 -1
  125. package/dist/lib/lint.d.ts +0 -2
  126. package/dist/lib/lint.d.ts.map +0 -1
  127. package/dist/lib/lint.js +0 -28
  128. package/dist/lib/lint.js.map +0 -1
  129. package/dist/lib/plugin-contents.d.ts +0 -5
  130. package/dist/lib/plugin-contents.d.ts.map +0 -1
  131. package/dist/lib/plugin-contents.js +0 -28
  132. package/dist/lib/plugin-contents.js.map +0 -1
  133. package/dist/lib/plugin-manifest.d.ts +0 -4
  134. package/dist/lib/plugin-manifest.d.ts.map +0 -1
  135. package/dist/lib/plugin-manifest.js +0 -13
  136. package/dist/lib/plugin-manifest.js.map +0 -1
  137. package/dist/lib/tailwind.d.ts +0 -33
  138. package/dist/lib/tailwind.d.ts.map +0 -1
  139. package/dist/lib/tailwind.js +0 -91
  140. package/dist/lib/tailwind.js.map +0 -1
  141. package/dist/lib/tsup.d.ts +0 -3
  142. package/dist/lib/tsup.d.ts.map +0 -1
  143. package/dist/lib/tsup.js +0 -26
  144. package/dist/lib/tsup.js.map +0 -1
  145. package/dist/lib/utils.d.ts +0 -16
  146. package/dist/lib/utils.d.ts.map +0 -1
  147. package/dist/lib/utils.js +0 -66
  148. package/dist/lib/utils.js.map +0 -1
  149. package/dist/lib/webpack.d.ts +0 -6
  150. package/dist/lib/webpack.d.ts.map +0 -1
  151. package/dist/lib/webpack.js +0 -72
  152. package/dist/lib/webpack.js.map +0 -1
  153. package/dist/lib/zip.d.ts +0 -4
  154. package/dist/lib/zip.d.ts.map +0 -1
  155. package/dist/lib/zip.js +0 -65
  156. package/dist/lib/zip.js.map +0 -1
  157. package/dist/plugin.d.ts.map +0 -1
@@ -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,5 +0,0 @@
1
- export default function command(): void;
2
- export declare function action(options: {
3
- output: string;
4
- }): Promise<void>;
5
- //# sourceMappingURL=genkey.d.ts.map
@@ -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"}
@@ -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"}
@@ -1,8 +0,0 @@
1
- export default function command(): void;
2
- export declare function action(options: {
3
- outdir: string;
4
- certdir: string;
5
- port: string;
6
- input: string;
7
- }): Promise<void>;
8
- //# sourceMappingURL=lint.d.ts.map
@@ -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"}
@@ -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,2 +0,0 @@
1
- export default function command(): void;
2
- //# sourceMappingURL=index.d.ts.map
@@ -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,3 +0,0 @@
1
- export default function command(): void;
2
- export declare function action(): Promise<void>;
3
- //# sourceMappingURL=plugin-build.d.ts.map
@@ -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"}
@@ -1,60 +0,0 @@
1
- import { program } from 'commander';
2
- import fs from 'fs-extra';
3
- import path from 'path';
4
- import {} from 'webpack';
5
- import { PLUGIN_CONTENTS_DIRECTORY } from '../lib/constants.js';
6
- import { importK2PluginConfig } from '../lib/import.js';
7
- import { getTailwindConfig, getTailwindInputCss, outputCss } from '../lib/tailwind.js';
8
- import base from './build-base.js';
9
- import { lint } from '../lib/lint.js';
10
- export default function command() {
11
- program
12
- .command('build')
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
- const entries = {
28
- desktop: path.join('src', 'desktop', 'index.ts'),
29
- config: path.join('src', 'config', 'index.ts'),
30
- };
31
- if (config.tailwind?.css && config.tailwind?.config) {
32
- const tailwindConfig = await getTailwindConfig(config.tailwind);
33
- const inputFile = getTailwindInputCss(config.tailwind);
34
- await outputCss({
35
- inputPath: inputFile.config,
36
- outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'config.css'),
37
- config: tailwindConfig.config,
38
- minify: true,
39
- });
40
- console.log('✨ Built config.css');
41
- await outputCss({
42
- inputPath: inputFile.desktop,
43
- outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'desktop.css'),
44
- config: tailwindConfig.desktop,
45
- minify: true,
46
- });
47
- console.log('✨ Built desktop.css');
48
- }
49
- await base({ entries, outDir: PLUGIN_CONTENTS_DIRECTORY });
50
- console.log('✨ Built desktop.js and config.js');
51
- console.log('✨ Build success.');
52
- }
53
- catch (error) {
54
- throw error;
55
- }
56
- finally {
57
- console.groupEnd();
58
- }
59
- }
60
- //# sourceMappingURL=plugin-build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-build.js","sourceRoot":"","sources":["../../src/commands/plugin-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,EAAsB,MAAM,SAAS,CAAC;AAC7C,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,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO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O,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAClC,MAAM,SAAS,CAAC;gBACd,SAAS,EAAE,SAAS,CAAC,OAAO;gBAC5B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,aAAa,CAAC;gBAC/D,MAAM,EAAE,cAAc,CAAC,OAAO;gBAC9B,MAAM,EAAE,IAAI;aACb,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACrC,CAAC;QAED,MAAM,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;QAC3D,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"}
@@ -1,5 +0,0 @@
1
- export declare const getManifest: (params: {
2
- config: Plugin.Meta.Config;
3
- port: number;
4
- }) => Promise<Plugin.Meta.Manifest>;
5
- //# sourceMappingURL=create-manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin-dev/create-manifest.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAU,QAAQ;IAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,kCA2BrF,CAAC"}
@@ -1,30 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,6 +0,0 @@
1
- export default function command(): void;
2
- export declare function action(options: {
3
- ppk: string;
4
- certDir: string;
5
- }): Promise<void>;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,50 +0,0 @@
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
@@ -1 +0,0 @@
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,MAAM,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,MAAM,CACL,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,aAAa,CAAC,CACrD;SACA,MAAM,CAAC,0BAA0B,EAAE,uBAA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,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"}
@@ -1,2 +0,0 @@
1
- export declare const watchCss: (pluginConfig: Plugin.Meta.Config) => Promise<[import("chokidar").FSWatcher, import("chokidar").FSWatcher] | undefined>;
2
- //# sourceMappingURL=tailwind.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,42 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwind.js","sourceRoot":"","sources":["../../../src/commands/plugin-dev/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAiC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEjG,KAAK,UAAU,gBAAgB,CAAC,MAI/B;IACC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACrD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC;IAE3E,OAAO,gBAAgB,CAAC;QACtB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,UAAU;QAClB,MAAM;QACN,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,UAAU,CAAC,CAC3C,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,YAAgC,EAAE,EAAE;IACjE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAClE,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,iBAAiB,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"}
@@ -1,5 +0,0 @@
1
- export declare const watchContentsAndUploadZip: (params: {
2
- manifest: Plugin.Meta.Manifest;
3
- ppkPath: string;
4
- }) => Promise<void>;
5
- //# sourceMappingURL=upload.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,58 +0,0 @@
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
@@ -1 +0,0 @@
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,CAA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AC,WAAW,CAAC;gBACvB,KAAK,CAAC,GAAG,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"}
@@ -1,3 +0,0 @@
1
- export default function command(): void;
2
- export declare function action(): Promise<void>;
3
- //# sourceMappingURL=plugin-esbuild.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,66 +0,0 @@
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
@@ -1 +0,0 @@
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,CAA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Promise<void>;
3
- //# sourceMappingURL=plugin-genkey.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,3 +0,0 @@
1
- export default function command(): void;
2
- export declare function action(): Promise<void>;
3
- //# sourceMappingURL=plugin-init.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,45 +0,0 @@
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