@konomi-app/k2 1.4.0 → 1.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.
@@ -20,6 +20,9 @@ export async function action(options) {
20
20
  try {
21
21
  const { outdir, input, config } = options;
22
22
  const outDir = path.resolve(outdir);
23
+ if (!fs.existsSync(outDir)) {
24
+ fs.mkdirSync(outDir, { recursive: true });
25
+ }
23
26
  const allProjects = fs.readdirSync(path.resolve(input));
24
27
  const entryPoints = allProjects.reduce((acc, dir) => {
25
28
  for (const filename of ['index.ts', 'index.js', 'index.mjs']) {
@@ -1,5 +1,6 @@
1
1
  import { pathToFileURL } from 'url';
2
2
  import { CONFIG_FILE_NAME, PLUGIN_CONFIG_FILE_NAME } from './constants.js';
3
+ import path from 'path';
3
4
  export const esmImport = (path) => {
4
5
  if (process.platform === 'win32') {
5
6
  return import(pathToFileURL(path).toString());
@@ -9,8 +10,8 @@ export const esmImport = (path) => {
9
10
  }
10
11
  };
11
12
  export const importK2Config = async (configFileName) => {
12
- return (await esmImport(configFileName ?? CONFIG_FILE_NAME)).default;
13
+ return (await esmImport(path.resolve(configFileName ?? CONFIG_FILE_NAME))).default;
13
14
  };
14
15
  export const importPluginConfig = async (configFileName) => {
15
- return (await esmImport(configFileName ?? PLUGIN_CONFIG_FILE_NAME)).default;
16
+ return (await esmImport(path.resolve(configFileName ?? PLUGIN_CONFIG_FILE_NAME))).default;
16
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konomi-app/k2",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "kintone sdk",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -67,4 +67,4 @@
67
67
  "@types/html-minifier": "^4",
68
68
  "typescript": "*"
69
69
  }
70
- }
70
+ }