vls-openapi-generator 1.10.0 → 1.11.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.
@@ -8,6 +8,9 @@ on:
8
8
  branches:
9
9
  - main
10
10
 
11
+ permissions:
12
+ contents: write
13
+
11
14
  jobs:
12
15
  release:
13
16
  if: github.event_name == 'push'
@@ -38,12 +41,6 @@ jobs:
38
41
  - name: Build project
39
42
  run: npm run build
40
43
 
41
- - name: Check .git exists
42
- run: |
43
- echo "PWD: $PWD"
44
- ls -la
45
- ls -la .git || echo ".git not found"
46
-
47
44
  - name: Release with Semantic
48
45
  run: npx semantic-release
49
46
  env:
@@ -47,6 +47,13 @@ const HANDLERS_DIR = path.join(process.cwd(), 'dist', 'src', 'handlers');
47
47
  const SCHEMAS_DIR = path.join(process.cwd(), 'dist', 'src', 'schemas');
48
48
  const OUTPUT_FILE = path.join(process.cwd(), 'openapi.json');
49
49
  const generateOpenAPI = async () => {
50
+ await (0, util_1.promisify)(child_process_1.exec)('rm -rf ./dist');
51
+ await (0, util_1.promisify)(child_process_1.exec)('npx tsc');
52
+ const handlerFiles = await fs_1.promises.readdir(HANDLERS_DIR).catch(() => []);
53
+ if (handlerFiles.length === 0) {
54
+ console.log('No handler found in handlers folder.');
55
+ return;
56
+ }
50
57
  console.info('Generating Open API documentation...');
51
58
  const args = process.argv;
52
59
  const params = {};
@@ -65,9 +72,6 @@ const generateOpenAPI = async () => {
65
72
  i += 2;
66
73
  }
67
74
  }
68
- await (0, util_1.promisify)(child_process_1.exec)('rm -rf ./dist');
69
- await (0, util_1.promisify)(child_process_1.exec)('npx tsc');
70
- const handlerFiles = await fs_1.promises.readdir(HANDLERS_DIR);
71
75
  const existingOpenAPIFile = JSON.parse(await fs_1.promises.readFile(OPENAPI_FILE, 'utf-8'));
72
76
  existingOpenAPIFile.paths = {};
73
77
  for (const handler of handlerFiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vls-openapi-generator",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -19,6 +19,17 @@ const SCHEMAS_DIR = path.join(process.cwd(), 'dist', 'src', 'schemas');
19
19
  const OUTPUT_FILE = path.join(process.cwd(), 'openapi.json');
20
20
 
21
21
  export const generateOpenAPI = async (): Promise<void> => {
22
+ await promisify(exec)('rm -rf ./dist');
23
+ await promisify(exec)('npx tsc');
24
+
25
+ const handlerFiles = await fs.readdir(HANDLERS_DIR).catch(() => []);
26
+
27
+ if (handlerFiles.length === 0) {
28
+ console.log('No handler found in handlers folder.');
29
+
30
+ return;
31
+ }
32
+
22
33
  console.info('Generating Open API documentation...');
23
34
 
24
35
  const args = process.argv;
@@ -41,10 +52,6 @@ export const generateOpenAPI = async (): Promise<void> => {
41
52
  }
42
53
  }
43
54
 
44
- await promisify(exec)('rm -rf ./dist');
45
- await promisify(exec)('npx tsc');
46
-
47
- const handlerFiles = await fs.readdir(HANDLERS_DIR);
48
55
  const existingOpenAPIFile = JSON.parse(await fs.readFile(OPENAPI_FILE, 'utf-8')) as OpenAPI;
49
56
 
50
57
  existingOpenAPIFile.paths = {};