@wisemen/nestjs-async-api 0.0.5 → 0.1.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.
@@ -1,5 +1,7 @@
1
1
  import { globSync } from 'fs'
2
2
  import assert from 'assert'
3
+ import { pathToFileURL } from 'url'
4
+ import { resolve } from 'path'
3
5
  import YAML from 'yaml'
4
6
  import { SchemaObjectFactory } from '@nestjs/swagger/dist/services/schema-object-factory.js'
5
7
  import { ModelPropertiesAccessor } from '@nestjs/swagger/dist/services/model-properties-accessor.js'
@@ -23,7 +25,8 @@ export async function generateAsyncApiYaml (api: AsyncAPIDefinition): Promise<st
23
25
  const channels: Record<string, AsyncAPIChannelDefinition<string>> = {}
24
26
 
25
27
  for (const channelFile of channelFiles) {
26
- const moduleExports = await import('../../../../' + channelFile) as Record<string, object>
28
+ const absolutePath = pathToFileURL(resolve(process.cwd(), channelFile)).href
29
+ const moduleExports = await import(absolutePath) as Record<string, object>
27
30
 
28
31
  for (const exportedKey in moduleExports) {
29
32
  const exported = moduleExports[exportedKey]
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@wisemen/nestjs-async-api",
3
- "version": "0.0.5",
3
+ "version": "0.1.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "type": "module",
5
8
  "exports": {
6
9
  ".": "./dist/lib/index.js"
@@ -8,31 +11,30 @@
8
11
  "imports": {
9
12
  "#*": "./lib/*"
10
13
  },
11
- "scripts": {
12
- "prebuild": "rm -rf ./dist",
13
- "clean": "rm -rf ./dist",
14
- "build": "tsc",
15
- "pretest": "npm run clean && npm run build",
16
- "test": "node --env-file=.env.test --test ./**/*.test.js",
17
- "lint": "eslint --cache",
18
- "prerelease": "npm run build",
19
- "release": "pnpx release-it"
20
- },
21
14
  "dependencies": {
22
- "change-case": "^5.4.4",
23
- "@asyncapi/generator": "3.1.2",
15
+ "change-case": "5.4.4",
24
16
  "yaml": "2.8.2",
25
17
  "@nestjs/swagger": "11.2.6"
26
18
  },
27
19
  "devDependencies": {
28
- "@wisemen/eslint-config-nestjs": "^0.2.8",
29
20
  "eslint": "9.39.2",
30
- "typescript": "^5.9.3"
21
+ "typescript": ">=4.8.4 <=5.9.3",
22
+ "@wisemen/eslint-config-nestjs": "0.2.10"
31
23
  },
32
24
  "author": "Kobe Kwanten",
33
25
  "license": "GPL",
34
26
  "repository": {
35
27
  "type": "git",
36
28
  "url": "git@github.com:wisemen-digital/node-core.git"
29
+ },
30
+ "scripts": {
31
+ "prebuild": "rm -rf ./dist",
32
+ "clean": "rm -rf ./dist",
33
+ "build": "tsc",
34
+ "pretest": "npm run clean && npm run build",
35
+ "test": "node --env-file=.env.test --test ./**/*.test.js",
36
+ "lint": "eslint --cache",
37
+ "prerelease": "npm run build",
38
+ "release": "pnpx release-it"
37
39
  }
38
- }
40
+ }
package/.release-it.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "git": {
3
- "tagName": "nestjs-async-api@${version}",
4
- "commitMessage": "Release ${tagName}",
5
- "tagAnnotation": "Release ${tagName}"
6
- },
7
- "npm": {
8
- "publishArgs": [
9
- "--access",
10
- "public"
11
- ]
12
- }
13
- }