Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convert to ESM (breaking change) #856

Merged
merged 78 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d663e72
chore: drop module opts in test config
kanadgupta Jul 6, 2023
b59744d
Merge branch 'next' into esm-spike
kanadgupta Aug 9, 2023
535bf7f
feat: the epic renaming
kanadgupta Aug 9, 2023
7a14947
chore(deps): bump chalk to v5
kanadgupta Aug 9, 2023
6d24836
chore: lint
kanadgupta Aug 9, 2023
89056d4
chore: migrate a few more files that fell through the cracks
kanadgupta Aug 9, 2023
435de45
fix: asserted JSON import
kanadgupta Aug 9, 2023
eba0ba9
chore: rename config
kanadgupta Aug 9, 2023
cf824e3
chore: rename a bunch of bin files
kanadgupta Aug 9, 2023
749dc32
chore: lint
kanadgupta Aug 9, 2023
b7dbc25
chore: try this with jest
kanadgupta Aug 10, 2023
f1b1fd4
chore: more jest mess around
kanadgupta Aug 10, 2023
82ec893
fix: one more thing in an attempt to fix the build
kanadgupta Aug 10, 2023
d2b7e51
fix: wait is this really all it took
kanadgupta Aug 10, 2023
e3d2ccd
chore: update npmignore
kanadgupta Aug 10, 2023
eaf7824
Merge branch 'next' into esm-spike
kanadgupta Sep 2, 2023
365dbc3
chore: more extension fixes
kanadgupta Sep 2, 2023
b4ac068
ci: knip fix
kanadgupta Sep 2, 2023
829170c
refactor: enable node protocol
kanadgupta Sep 2, 2023
2f4a29d
Merge branch 'next' into esm-spike
kanadgupta Sep 7, 2023
b12f384
chore: lint
kanadgupta Sep 7, 2023
2f23937
chore: fix up some more extensions
kanadgupta Sep 7, 2023
35e1199
revert: rename file again
kanadgupta Sep 7, 2023
2b8cfc6
fix: another thing that fell through the cracks
kanadgupta Sep 7, 2023
6927124
chore: one more fix
kanadgupta Sep 7, 2023
b09e6e1
chore: bring in new eslint rule, fix up some more issues
kanadgupta Sep 11, 2023
aa22557
Merge branch 'next' into esm-spike
kanadgupta Sep 11, 2023
b6eaa4c
chore: bump oas and friends to get tests working
kanadgupta Sep 11, 2023
c7ba220
chore: ignore TS in a few places... why though
kanadgupta Sep 11, 2023
b3ed2fa
chore: more TS weirdness
kanadgupta Sep 11, 2023
b9f8d2f
chore: rebuild lockfile
kanadgupta Sep 11, 2023
1ce036e
refactor: remove moduleResolution
kanadgupta Sep 12, 2023
7ab41bd
chore: remove @ts-expect-error flags
kanadgupta Sep 12, 2023
ca96b4f
revert: broken oas-normalize state
kanadgupta Sep 12, 2023
afe8283
chore(deps): bump oas and oas-normalize
kanadgupta Sep 12, 2023
109ea0c
chore(deps): bump oas again
kanadgupta Sep 12, 2023
53bdc6b
chore: disable test
kanadgupta Sep 12, 2023
2c133ad
ci: stop running tests against node 14/16
kanadgupta Sep 12, 2023
618b29e
test: get test working again
kanadgupta Sep 12, 2023
eeeabd9
refactor: hide node warnings
kanadgupta Sep 12, 2023
64df501
Merge branch 'next' into esm-spike
kanadgupta Sep 13, 2023
002fd84
chore: bad merges
kanadgupta Sep 13, 2023
09f6e23
revert: bring back node warnings lol
kanadgupta Sep 13, 2023
62d967a
chore: fix assertion
kanadgupta Sep 13, 2023
5a9c816
refactor: use new eslint config, get rid of cjs files
kanadgupta Sep 13, 2023
0997ba0
test: fix outdated config usage
kanadgupta Sep 13, 2023
9c9fb68
chore: tiny formatting fix
kanadgupta Sep 13, 2023
d26d72a
chore: refine eslint extensions
kanadgupta Sep 13, 2023
4067c02
docs: make sure it references bin/rdme.js
kanadgupta Sep 13, 2023
52d9dd0
fix: attempt to get docker build working
kanadgupta Sep 13, 2023
eda22d2
fix: use node 18
kanadgupta Sep 13, 2023
0b0fed0
chore: try bumping node-fetch
kanadgupta Sep 13, 2023
f237245
fix: set rollup config flag
kanadgupta Sep 13, 2023
6cfe6b1
test: fix some fetch tests
kanadgupta Sep 13, 2023
e39282c
chore: lint
kanadgupta Sep 13, 2023
d101dea
test: more test fixes
kanadgupta Sep 13, 2023
dcc685f
fix: swap out form-data with formdata-node
kanadgupta Sep 13, 2023
48c77ba
chore(deps): does it work to bump the rest of the deps?
kanadgupta Sep 13, 2023
3d493b7
Revert "chore(deps): does it work to bump the rest of the deps?"
kanadgupta Sep 13, 2023
f6939c5
chore(temp): see if colors are supported in GHA
kanadgupta Sep 13, 2023
8b2b69d
Revert "chore(temp): see if colors are supported in GHA"
kanadgupta Sep 13, 2023
2f8bdc6
chore: add dists to ignore files, clean up
kanadgupta Sep 13, 2023
fe973a2
chore: add debug to pkg
kanadgupta Sep 13, 2023
5a376b6
chore(deps): bump the deps that i can
kanadgupta Sep 13, 2023
840895d
chore: update dependabot file yay
kanadgupta Sep 13, 2023
5ac11b1
Merge branch 'next' into esm-spike
kanadgupta Sep 13, 2023
827d1fd
chore: fix up ignore files again
kanadgupta Sep 13, 2023
380ca23
chore: comment
kanadgupta Sep 14, 2023
07ba2f6
chore: one of these days i'll be content with my ignore file formatting
kanadgupta Sep 14, 2023
a6ba541
Merge branch 'next' into esm-spike
kanadgupta Sep 14, 2023
43e0a66
chore(deps): bump headers-polyfill
kanadgupta Sep 14, 2023
bc99152
refactor: hide rollup output in dist
kanadgupta Sep 14, 2023
e83b2e6
revert: remove unused debug flag
kanadgupta Sep 14, 2023
4827139
Merge branch 'next' into esm-spike
kanadgupta Sep 14, 2023
5a2a9e3
chore: swap out headers-polyfill type for node-fetch
kanadgupta Sep 14, 2023
4a4c852
Merge branch 'next' into esm-spike
kanadgupta Sep 14, 2023
d758dd5
chore: lint
kanadgupta Sep 14, 2023
13fa09f
fix: type fixes
kanadgupta Sep 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
coverage/
dist/
!.alexrc.js
exe/
14 changes: 9 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"extends": ["@readme/eslint-config", "@readme/eslint-config/typescript"],
"extends": ["@readme/eslint-config", "@readme/eslint-config/typescript", "@readme/eslint-config/esm"],
"root": true,
"parserOptions": {
"ecmaVersion": 2020
},
"overrides": [
{
"files": ["bin/*.js"],
Expand All @@ -12,6 +9,13 @@
}
}
],
"env": {
"es2021": true,
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
"@typescript-eslint/ban-types": [
"error",
Expand All @@ -37,7 +41,7 @@
* console.log() calls, hurting our ability to write resilient tests and easily debug issues.
*
* We should be returning Promise-wrapped values in our main command functions
* so we can write robust tests and take advantage of `bin/rdme`,
* so we can write robust tests and take advantage of `bin/rdme.js`,
* which we use for printing function outputs and returning correct exit codes.
*
* Furthermore, we should also be using our custom loggers (see src/lib/logger.js)
Expand Down
16 changes: 2 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,7 @@ updates:
prefix: chore(deps)
prefix-development: chore(deps-dev)
ignore:
# All of these packages are now ESM-only and can't be used here without a rewrite.
- dependency-name: chalk
versions:
- '>= 5'
- dependency-name: configstore
versions:
- '>= 6'
- dependency-name: node-fetch
versions:
- '>= 3'
- dependency-name: open
versions:
- '>= 9'
# See https://github.com/sindresorhus/ora/issues/229
- dependency-name: ora
versions:
- '>= 6'
- '>= 7'
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
fail-fast: false
matrix:
node-version:
- 14
- 16
Comment on lines -18 to -19
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this PR, we're technically requiring Node 18 and above but I'll make that official in a separate PR.

- 18
- 20

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.env
coverage/
dist/
.env
exe/
node_modules/
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ __tests__/
.github/
.husky/
.prettier*
bin/*.js
bin/**
coverage/
packages/
vitest.*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ __tests__/__fixtures__/invalid-json/yikes.json
CHANGELOG.md
coverage/
dist/
exe/
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Running Shell Commands Locally 🐚

To run test commands from within the repository, run the build and then run your commands from the root of the repository and use `./bin/rdme` instead of `rdme` so it properly points to the command executable, like so:
To run test commands from within the repository, run the build and then run your commands from the root of the repository and use `./bin/rdme.js` instead of `rdme` so it properly points to the command executable, like so:

```sh
npm run build
./bin/rdme openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
./bin/rdme.js openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
```

If you need to debug commands quicker and re-building TS everytime is becoming cumbersome, you can use the debug command, like so:
Expand Down Expand Up @@ -70,7 +70,7 @@ act -j simple

### Usage of `console`

As you'll learn in our commands logic (see [`bin/rdme`](bin/rdme) and the [`src/cmds`](src/cmds) directory), we wrap our command outputs in resolved/rejected [`Promise` objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) and use [`bin/rdme`](bin/rdme) file to log the results to the console and return the correct status code. This is so we can write more resilient tests, ensure that the proper exit codes are being returned, and make debugging easier.
As you'll learn in our commands logic (see [`bin/rdme.js`](bin/rdme.js) and the [`src/cmds`](src/cmds) directory), we wrap our command outputs in resolved/rejected [`Promise` objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) and use [`bin/rdme.js`](bin/rdme.js) file to log the results to the console and return the correct status code. This is so we can write more resilient tests, ensure that the proper exit codes are being returned, and make debugging easier.

When writing command logic, avoid using `console` statements (and correspondingly, avoid mocking `console` statements in tests) when possible.

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:16-alpine as builder
FROM node:18-alpine as builder

COPY . /rdme

RUN cd /rdme && npm ci && npm run build && npx pkg@5 . --target host --out-path exe
RUN cd /rdme && npm ci && npm run build:exe

FROM alpine:3.14

Expand Down
4 changes: 2 additions & 2 deletions __tests__/bin.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exec } from 'child_process';
import { exec } from 'node:child_process';

import { describe, it, expect } from 'vitest';

Expand All @@ -7,7 +7,7 @@ describe('bin', () => {
expect.assertions(1);

await new Promise(resolve => {
exec(`node ${__dirname}/../bin/rdme`, (error, stdout) => {
exec(`node ${__dirname}/../bin/rdme.js`, (error, stdout) => {
expect(stdout).toContain('a utility for interacting with ReadMe');
resolve(true);
});
Expand Down
4 changes: 2 additions & 2 deletions __tests__/cmds/categories/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterEach, it, expect, vi } from 'vitest';

import CategoriesCreateCommand from '../../../src/cmds/categories/create';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock';
import CategoriesCreateCommand from '../../../src/cmds/categories/create.js';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock.js';

const categoriesCreate = new CategoriesCreateCommand();

Expand Down
4 changes: 2 additions & 2 deletions __tests__/cmds/categories/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterEach, it, expect, vi } from 'vitest';

import CategoriesCommand from '../../../src/cmds/categories';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock';
import CategoriesCommand from '../../../src/cmds/categories/index.js';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock.js';

const categories = new CategoriesCommand();

Expand Down
12 changes: 6 additions & 6 deletions __tests__/cmds/changelogs/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, beforeEach, it, expect, vi } from 'vitest';

import ChangelogsCommand from '../../../src/cmds/changelogs';
import APIError from '../../../src/lib/apiError';
import getAPIMock from '../../helpers/get-api-mock';
import hashFileContents from '../../helpers/hash-file-contents';
import ChangelogsCommand from '../../../src/cmds/changelogs.js';
import APIError from '../../../src/lib/apiError.js';
import getAPIMock from '../../helpers/get-api-mock.js';
import hashFileContents from '../../helpers/hash-file-contents.js';

const changelogs = new ChangelogsCommand();

Expand Down
12 changes: 6 additions & 6 deletions __tests__/cmds/changelogs/single.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, beforeEach, it, expect, vi } from 'vitest';

import ChangelogsCommand from '../../../src/cmds/changelogs';
import APIError from '../../../src/lib/apiError';
import getAPIMock from '../../helpers/get-api-mock';
import hashFileContents from '../../helpers/hash-file-contents';
import ChangelogsCommand from '../../../src/cmds/changelogs.js';
import APIError from '../../../src/lib/apiError.js';
import getAPIMock from '../../helpers/get-api-mock.js';
import hashFileContents from '../../helpers/hash-file-contents.js';

const changelogs = new ChangelogsCommand();

Expand Down
12 changes: 6 additions & 6 deletions __tests__/cmds/custompages/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, beforeEach, it, expect, vi } from 'vitest';

import CustomPagesCommand from '../../../src/cmds/custompages';
import APIError from '../../../src/lib/apiError';
import getAPIMock from '../../helpers/get-api-mock';
import hashFileContents from '../../helpers/hash-file-contents';
import CustomPagesCommand from '../../../src/cmds/custompages.js';
import APIError from '../../../src/lib/apiError.js';
import getAPIMock from '../../helpers/get-api-mock.js';
import hashFileContents from '../../helpers/hash-file-contents.js';

const custompages = new CustomPagesCommand();

Expand Down
12 changes: 6 additions & 6 deletions __tests__/cmds/custompages/single.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, beforeEach, it, expect, vi } from 'vitest';

import CustomPagesCommand from '../../../src/cmds/custompages';
import APIError from '../../../src/lib/apiError';
import getAPIMock from '../../helpers/get-api-mock';
import hashFileContents from '../../helpers/hash-file-contents';
import CustomPagesCommand from '../../../src/cmds/custompages.js';
import APIError from '../../../src/lib/apiError.js';
import getAPIMock from '../../helpers/get-api-mock.js';
import hashFileContents from '../../helpers/hash-file-contents.js';

const custompages = new CustomPagesCommand();

Expand Down
8 changes: 4 additions & 4 deletions __tests__/cmds/docs/edit.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import fs from 'fs';
import fs from 'node:fs';

import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, beforeEach, afterEach, it, expect, vi } from 'vitest';

import DocsEditCommand from '../../../src/cmds/docs/edit';
import APIError from '../../../src/lib/apiError';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock';
import DocsEditCommand from '../../../src/cmds/docs/edit.js';
import APIError from '../../../src/lib/apiError.js';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock.js';

const docsEdit = new DocsEditCommand();

Expand Down
20 changes: 10 additions & 10 deletions __tests__/cmds/docs/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/* eslint-disable no-console */
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, beforeEach, afterEach, it, expect, vi } from 'vitest';

import DocsCommand from '../../../src/cmds/docs';
import GuidesCommand from '../../../src/cmds/guides';
import APIError from '../../../src/lib/apiError';
import configstore from '../../../src/lib/configstore';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock';
import { after, before } from '../../helpers/get-gha-setup';
import hashFileContents from '../../helpers/hash-file-contents';
import { after as afterGHAEnv, before as beforeGHAEnv } from '../../helpers/setup-gha-env';
import DocsCommand from '../../../src/cmds/docs/index.js';
import GuidesCommand from '../../../src/cmds/guides/index.js';
import APIError from '../../../src/lib/apiError.js';
import configstore from '../../../src/lib/configstore.js';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock.js';
import { after, before } from '../../helpers/get-gha-setup.js';
import hashFileContents from '../../helpers/hash-file-contents.js';
import { after as afterGHAEnv, before as beforeGHAEnv } from '../../helpers/setup-gha-env.js';

const docs = new DocsCommand();
const guides = new GuidesCommand();
Expand Down
6 changes: 3 additions & 3 deletions __tests__/cmds/docs/prune.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, it, expect, vi } from 'vitest';

import DocsPruneCommand from '../../../src/cmds/docs/prune';
import GuidesPruneCommand from '../../../src/cmds/guides/prune';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock';
import DocsPruneCommand from '../../../src/cmds/docs/prune.js';
import GuidesPruneCommand from '../../../src/cmds/guides/prune.js';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock.js';

const docsPrune = new DocsPruneCommand();
const guidesPrune = new GuidesPruneCommand();
Expand Down
14 changes: 7 additions & 7 deletions __tests__/cmds/docs/single.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, beforeEach, afterEach, it, expect, vi } from 'vitest';

import DocsCommand from '../../../src/cmds/docs';
import APIError from '../../../src/lib/apiError';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock';
import hashFileContents from '../../helpers/hash-file-contents';
import { after as afterGHAEnv, before as beforeGHAEnv } from '../../helpers/setup-gha-env';
import DocsCommand from '../../../src/cmds/docs/index.js';
import APIError from '../../../src/lib/apiError.js';
import getAPIMock, { getAPIMockWithVersionHeader } from '../../helpers/get-api-mock.js';
import hashFileContents from '../../helpers/hash-file-contents.js';
import { after as afterGHAEnv, before as beforeGHAEnv } from '../../helpers/setup-gha-env.js';

const docs = new DocsCommand();

Expand Down
8 changes: 4 additions & 4 deletions __tests__/cmds/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import nock from 'nock';
import prompts from 'prompts';
import { describe, beforeAll, afterAll, afterEach, it, expect } from 'vitest';

import Command from '../../src/cmds/login';
import APIError from '../../src/lib/apiError';
import configStore from '../../src/lib/configstore';
import getAPIMock from '../helpers/get-api-mock';
import Command from '../../src/cmds/login.js';
import APIError from '../../src/lib/apiError.js';
import configStore from '../../src/lib/configstore.js';
import getAPIMock from '../helpers/get-api-mock.js';

const cmd = new Command();

Expand Down
6 changes: 3 additions & 3 deletions __tests__/cmds/logout.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, afterEach, it, expect } from 'vitest';

import Command from '../../src/cmds/logout';
import config from '../../src/lib/config';
import configStore from '../../src/lib/configstore';
import Command from '../../src/cmds/logout.js';
import config from '../../src/lib/config.js';
import configStore from '../../src/lib/configstore.js';

const cmd = new Command();

Expand Down
10 changes: 5 additions & 5 deletions __tests__/cmds/open.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Version } from '../../src/cmds/versions';
import type { Version } from '../../src/cmds/versions/index.js';

import chalk from 'chalk';
import { describe, afterEach, it, expect } from 'vitest';

import Command from '../../src/cmds/open';
import config from '../../src/lib/config';
import configStore from '../../src/lib/configstore';
import getAPIMock from '../helpers/get-api-mock';
import Command from '../../src/cmds/open.js';
import config from '../../src/lib/config.js';
import configStore from '../../src/lib/configstore.js';
import getAPIMock from '../helpers/get-api-mock.js';

const cmd = new Command();

Expand Down
4 changes: 2 additions & 2 deletions __tests__/cmds/openapi/convert.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fs from 'fs';
import fs from 'node:fs';

import prompts from 'prompts';
import { describe, it, expect, vi } from 'vitest';

import OpenAPIConvertCommand from '../../../src/cmds/openapi/convert';
import OpenAPIConvertCommand from '../../../src/cmds/openapi/convert.js';

const convert = new OpenAPIConvertCommand();

Expand Down
Loading