Skip to content

Commit bc65737

Browse files
committed
fix: Consume github service as js module
Since we are using ncc to bundle the code. There is an issue when enabling `"allowImportingTsExtensions": true` in typescript config which won't recognize `noEmit:true` set and it will fail the boundling saying something in the lines of missing noEmit key. Therefore, there is a reason to back up on the allowImportingTsExtension and keep using the esm standard of import which will be by adding the js extension even though we are using ts.
1 parent c060837 commit bc65737

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

dist/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { setFailed, setOutput } from '@actions/core'
1+
import { info, setFailed, setOutput } from '@actions/core'
22
import { Arguments } from './args.js'
33
import { GitService } from './git.js'
44
import { GithubService } from './github.js'
55
import { ReleaseBuilder } from './release-builder.js'
6-
import type { Plugin, PluginVersion } from './jmeter-plugins.d.ts'
6+
import type { Plugin, PluginVersion } from './jmeter-plugins.d.js'
77
import { writeFileSync } from 'fs'
88

99
const REPOSITORY_NAME = 'jmeter-plugins'
@@ -51,6 +51,7 @@ export async function run(): Promise<void> {
5151
if (plugin) {
5252
plugin.versions[releaseVersion] = release
5353
writeFileSync(releaseFile, JSON.stringify(plugins, null, 2), 'utf-8')
54+
info(`Release Object: ${JSON.stringify(release)}`)
5455
return
5556
}
5657
throw Error(`The plugin id:"${pluginID}" was not found in ${releaseFile}`)

src/release-builder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Arguments } from './args.js'
22
import path from 'path'
33
import { readdir, readFile } from 'fs/promises'
4-
import type { Plugin, PluginVersion } from './jmeter-plugins.d.ts'
5-
import type { Asset } from './github.ts'
4+
import type { Plugin, PluginVersion } from './jmeter-plugins.d.js'
5+
import type { Asset } from './github.js'
66

77
export class ReleaseBuilder {
88
PLUGINS_REPOSITORY_FILE_PATH = 'jmeter-plugins/site/dat/repo/'

0 commit comments

Comments
 (0)