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

Use module/moduleResolution of 'nodenext' #92

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@metamask/utils": "^8.4.0",
"@metamask/superstruct": "^3.0.0",
"@metamask/utils": "^8.5.0",
"chalk": "^4.1.2",
"dependency-graph": "^0.11.0",
"execa": "^5.1.1",
"lodash": "^4.17.21",
"superstruct": "^1.0.3",
"yaml": "^2.4.1",
"yargs": "^17.7.2"
},
Expand Down
6 changes: 3 additions & 3 deletions src/misc-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as superstruct from '@metamask/superstruct';
import { writeFile } from '@metamask/utils/node';
import fs from 'fs';
import path from 'path';
import * as superstruct from 'superstruct';

import {
assertJsonMatchesStruct,
Expand All @@ -16,9 +16,9 @@ import {
import { withinSandbox } from '../tests/helpers';

// Clone the superstruct module so we can spy on its exports
jest.mock('superstruct', () => {
jest.mock('@metamask/superstruct', () => {
return {
...jest.requireActual('superstruct'),
...jest.requireActual('@metamask/superstruct'),
// eslint-disable-next-line @typescript-eslint/naming-convention
__esModule: true,
};
Expand Down
5 changes: 2 additions & 3 deletions src/misc-utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { StructError, assert } from '@metamask/superstruct';
import type { Struct, ObjectSchema } from '@metamask/superstruct';
import {
isErrorWithCode,
wrapError as originalWrapError,
} from '@metamask/utils/node';
import type { Json } from '@metamask/utils/node';
import fs from 'fs';
import path from 'path';
import { StructError, assert } from 'superstruct';
import type { Struct } from 'superstruct';
import type { ObjectSchema } from 'superstruct/dist/utils';

/**
* Represents a directory entry. Like fs.Dirent, but includes two additional
Expand Down
2 changes: 1 addition & 1 deletion src/repository-filesystem.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { integer, object, string } from '@metamask/superstruct';
import * as utils from '@metamask/utils/node';
import {
ensureDirectoryStructureExists,
Expand All @@ -6,7 +7,6 @@ import {
import fs from 'fs';
import { mock } from 'jest-mock-extended';
import path from 'path';
import { integer, object, string } from 'superstruct';
import { stringify } from 'yaml';

import { RepositoryFilesystem } from './repository-filesystem';
Expand Down
3 changes: 1 addition & 2 deletions src/repository-filesystem.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { Struct, ObjectSchema } from '@metamask/superstruct';
import type { Json } from '@metamask/utils/node';
import { readFile, readJsonFile } from '@metamask/utils/node';
import type fs from 'fs';
import path from 'path';
import type { Struct } from 'superstruct';
import type { ObjectSchema } from 'superstruct/dist/utils';
import { parse as yamlParse } from 'yaml';

import type { DirectoryEntry } from './misc-utils';
Expand Down
2 changes: 1 addition & 1 deletion src/rules/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type, string, record, array, boolean } from 'superstruct';
import { type, string, record, array, boolean } from '@metamask/superstruct';

/**
* All of the known rules.
Expand Down
7 changes: 2 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2020"],
"module": "CommonJS",
"moduleResolution": "node",
"module": "nodenext",
"moduleResolution": "nodenext",
"noEmit": true,
"noErrorTruncation": true,
"noUncheckedIndexedAccess": true,
"paths": {
"@metamask/utils/node": ["./node_modules/@metamask/utils/dist/types/node"]
},
"strict": true,
"target": "es2020"
},
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,8 @@ __metadata:
"@metamask/eslint-config-jest": ^12.0.0
"@metamask/eslint-config-nodejs": ^12.0.0
"@metamask/eslint-config-typescript": ^12.0.0
"@metamask/utils": ^8.4.0
"@metamask/superstruct": ^3.0.0
"@metamask/utils": ^8.5.0
"@swc/cli": ^0.1.62
"@swc/core": ^1.3.66
"@types/jest": ^28.1.6
Expand Down Expand Up @@ -1025,7 +1026,6 @@ __metadata:
rimraf: ^3.0.2
stdio-mock: ^1.2.0
strip-ansi: ^6.0.0
superstruct: ^1.0.3
ts-jest: ^28.0.7
ts-node: ^10.7.0
typedoc: ^0.23.15
Expand All @@ -1037,20 +1037,27 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/utils@npm:^8.4.0":
version: 8.4.0
resolution: "@metamask/utils@npm:8.4.0"
"@metamask/superstruct@npm:^3.0.0":
version: 3.0.0
resolution: "@metamask/superstruct@npm:3.0.0"
checksum: 667f8f2947186972516bb72b4ba215eaeede257c8beb0450583dd4c8b00c28729ff938267ca8804a3a351277fd627b8607cafeb71eb7045a2b6930639bb6a341
languageName: node
linkType: hard

"@metamask/utils@npm:^8.5.0":
version: 8.5.0
resolution: "@metamask/utils@npm:8.5.0"
dependencies:
"@ethereumjs/tx": ^4.2.0
"@metamask/superstruct": ^3.0.0
"@noble/hashes": ^1.3.1
"@scure/base": ^1.1.3
"@types/debug": ^4.1.7
debug: ^4.3.4
pony-cause: ^2.1.10
semver: ^7.5.4
superstruct: ^1.0.3
uuid: ^9.0.1
checksum: b0397e97bac7192f6189a8625a2dfcb56d3c2cf4dd2cb3d4e012a7e9786f04f59f6917805544bc131a6dacd2c8344e237ae43ad47429bb5eb35c6cf1248440b4
checksum: e8eac1c796c3f6b623be3c2736e8682248620f666b180f5c12ce56ee09587d4e28b6811862139a05c7a1bec91415f10ccf0516f3cdf342f88b0189d2a057c24b
languageName: node
linkType: hard

Expand Down Expand Up @@ -6648,13 +6655,6 @@ __metadata:
languageName: node
linkType: hard

"superstruct@npm:^1.0.3":
version: 1.0.3
resolution: "superstruct@npm:1.0.3"
checksum: 761790bb111e6e21ddd608299c252f3be35df543263a7ebbc004e840d01fcf8046794c274bcb351bdf3eae4600f79d317d085cdbb19ca05803a4361840cc9bb1
languageName: node
linkType: hard

"supports-color@npm:^5.3.0":
version: 5.5.0
resolution: "supports-color@npm:5.5.0"
Expand Down
Loading