Skip to content

Commit

Permalink
fix(tsconfig): set module resolution to nodenext
Browse files Browse the repository at this point in the history
  • Loading branch information
abichinger committed Oct 21, 2024
1 parent 46b3926 commit c37e49f
Show file tree
Hide file tree
Showing 14 changed files with 913 additions and 939 deletions.
2 changes: 1 addition & 1 deletion lib/default-options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { PluginConfig } from './types';
import { PluginConfig } from './types.js';

export class DefaultConfig {
config: PluginConfig;
Expand Down
6 changes: 3 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { prepare } from './prepare';
import { publish } from './publish';
import { verify } from './verify';
import { prepare } from './prepare.js';
import { publish } from './publish.js';
import { verify } from './verify.js';

export { prepare, publish, verify as verifyConditions };
10 changes: 5 additions & 5 deletions lib/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Options } from 'execa';
import fs from 'fs';
import os from 'os';
import path from 'path';
import type { Context } from './@types/semantic-release';
import { DefaultConfig } from './default-options';
import { PluginConfig } from './types';
import { normalizeVersion, pipe, setopt, spawn } from './util';
import { assertExitCode, isLegacyBuildInterface } from './verify';
import type { Context } from './@types/semantic-release/index.js';
import { DefaultConfig } from './default-options.js';
import { PluginConfig } from './types.js';
import { normalizeVersion, pipe, setopt, spawn } from './util.js';
import { assertExitCode, isLegacyBuildInterface } from './verify.js';

async function setVersionPy(setupPy: string, version: string) {
try {
Expand Down
8 changes: 4 additions & 4 deletions lib/publish.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Options, ResultPromise } from 'execa';
import type { Context } from './@types/semantic-release';
import { DefaultConfig } from './default-options';
import { createVenv } from './prepare';
import { PluginConfig } from './types';
import type { Context } from './@types/semantic-release/index.js';
import { DefaultConfig } from './default-options.js';
import { createVenv } from './prepare.js';
import { PluginConfig } from './types.js';
import { pipe, spawn } from './util.js';

function publishPackage(
Expand Down
6 changes: 3 additions & 3 deletions lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { execa, Options, ResultPromise } from 'execa';
import path from 'path';
import { Context } from './@types/semantic-release';
import { Context } from './@types/semantic-release/index.js';

async function normalizeVersion(
version: string,
Expand Down Expand Up @@ -38,8 +38,8 @@ function setopt(

function pipe(context: Context): Options {
return {
stdout: context.stdout,
stderr: context.stderr,
stdout: context.stdout as any,
stderr: context.stderr as any,
};
}

Expand Down
8 changes: 4 additions & 4 deletions lib/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import FormData from 'form-data';
import fs from 'fs';
import got from 'got';
import path from 'path';
import { Context } from './@types/semantic-release';
import { DefaultConfig } from './default-options';
import { PluginConfig } from './types';
import { pipe, spawn } from './util';
import { Context } from './@types/semantic-release/index.js';
import { DefaultConfig } from './default-options.js';
import { PluginConfig } from './types.js';
import { pipe, spawn } from './util.js';

function assertEnvVar(name: string) {
if (!process.env[name]) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"private": false,
"devDependencies": {
"@semantic-release/git": "^10.0.1",
"@types/node": "^22.7.7",
"@types/uuid": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
Expand All @@ -36,7 +37,7 @@
"dependencies": {
"execa": "^9.4.1",
"form-data": "^3.0.0",
"got": "^11.8.0"
"got": "^12.6.1"
},
"files": [
"dist/*",
Expand Down
8 changes: 5 additions & 3 deletions test/package.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { PassThrough } from 'stream';
import { expect, test } from 'vitest';
import { prepare, publish, verifyConditions } from '../lib/index';
import { genPackage, hasPackage } from './util';
import { prepare, publish, verifyConditions } from '../lib/index.js';
import { genPackage, hasPackage } from './util.js';

class EndlessPassThrough extends PassThrough {
end() {}
end(): this {
return this;
}
close() {
super.end();
}
Expand Down
8 changes: 4 additions & 4 deletions test/prepare.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
sDistPackage,
setVersionPy,
setVersionToml,
} from '../lib/prepare';
import { pipe, spawn } from '../lib/util';
import { assertPackage } from '../lib/verify';
import { genPackage } from './util';
} from '../lib/prepare.js';
import { pipe, spawn } from '../lib/util.js';
import { assertPackage } from '../lib/verify.js';
import { genPackage } from './util.js';

describe('prepare: build functions', () => {
const testCases = [
Expand Down
4 changes: 2 additions & 2 deletions test/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from 'vitest';
import { DefaultConfig } from '../lib/default-options';
import { normalizeVersion } from '../lib/util';
import { DefaultConfig } from '../lib/default-options.js';
import { normalizeVersion } from '../lib/util.js';

test('test DefaultConfig', async () => {
expect(new DefaultConfig({}).distDir).toBe('dist');
Expand Down
6 changes: 3 additions & 3 deletions test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import got from 'got';
import path from 'path';
import { v4 as uuidv4 } from 'uuid';
import { vi } from 'vitest';
import { Context } from '../lib/@types/semantic-release';
import { DefaultConfig } from '../lib/default-options';
import { PluginConfig } from '../lib/types';
import { Context } from '../lib/@types/semantic-release/index.js';
import { DefaultConfig } from '../lib/default-options.js';
import { PluginConfig } from '../lib/types.js';
class BuildInterface {
name: string;
version: string;
Expand Down
4 changes: 2 additions & 2 deletions test/verify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
verify,
verifyAuth,
verifySetupPy,
} from '../lib/verify';
import { genPackage, genPluginArgs } from './util';
} from '../lib/verify.js';
import { genPackage, genPluginArgs } from './util.js';

test('test assertEnvVar', async () => {
expect(assertEnvVar('PATH')).toBe(undefined);
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"module": "ESNext",
"module": "NodeNext",
"target": "ES2016",
"moduleResolution": "Bundler",
"moduleResolution": "NodeNext",
"declaration": true,
"strict": true,
"allowJs": true,
Expand Down
Loading

0 comments on commit c37e49f

Please sign in to comment.