@konomi-app/k2 1.4.4 → 1.4.6

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.
@@ -7,10 +7,12 @@ export const copyPluginContents = async (params = {}) => {
7
7
  if (!fs.existsSync(inputDir)) {
8
8
  await fs.mkdir(inputDir, { recursive: true });
9
9
  }
10
- await fs.copy(inputDir, path.join(outputDir), {
11
- overwrite: true,
12
- });
13
- const html = await fs.readFile(path.join(outputDir, 'config.html'), 'utf8');
10
+ await fs.copy(inputDir, outputDir, { overwrite: true });
11
+ const configHtmlPath = path.join(outputDir, 'config.html');
12
+ if (!fs.existsSync(configHtmlPath)) {
13
+ throw new Error(`Plugin HTML file not found. Create "config.html" in ${inputDir}.`);
14
+ }
15
+ const html = await fs.readFile(configHtmlPath, 'utf8');
14
16
  const minified = htmlMinifier.minify(html, {
15
17
  minifyCSS: true,
16
18
  collapseWhitespace: true,
@@ -21,5 +23,5 @@ export const copyPluginContents = async (params = {}) => {
21
23
  removeTagWhitespace: true,
22
24
  useShortDoctype: true,
23
25
  });
24
- await fs.writeFile(path.join(outputDir, 'config.html'), minified);
26
+ await fs.writeFile(configHtmlPath, minified);
25
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konomi-app/k2",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "kintone sdk",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",