Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Feb 22, 2024
1 parent 253291a commit 6ba5a4a
Show file tree
Hide file tree
Showing 45 changed files with 48 additions and 47 deletions.
2 changes: 1 addition & 1 deletion packages/create-snap/src/cmds/init/initHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
readJsonFile,
createSnapManifest,
logInfo,
} from '@metamask/snaps-utils';
} from '@metamask/snaps-utils/node';
import type { SemVerRange, SemVerVersion } from '@metamask/utils';
import { satisfiesVersionRange } from '@metamask/utils';
import { promises as fs } from 'fs';
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/bip32/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "AaLbshZePKcSV2NORnmd5AjzkX5vNQToD3PaE4YpUUQ=",
"shasum": "GHRzqflZym3SPlVeCxzScAIEaSFxNhjnwa4kpMxFeFg=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/bip44/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "q5WeZJXrE5mgP2Z6Fo/aJrVuspPsQgsUn3/SmHuwsGY=",
"shasum": "lVRDLNksOgfZVJGjbK+s1LTow+4dMEZqTHGUL9xOw+0=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/cronjobs/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "wXAAi/QR4BT1Gp6OiSqCpq+3U7pyRtMQ/LP9LeWwEPk=",
"shasum": "ECHg48b4/C0LiT7ztwfGYRan4QteV6Qudzp2/jQpSRI=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/dialogs/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "EepV6igtZ0ZCX579Ws6f9u0/kYnp65+6OK1SgzCm9Dg=",
"shasum": "7G6c6lcj4N7eip21R2inwtLZpx+VB62zTtcSZ8pqRl8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/ethers-js/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "AjzlrjmJQTKwGM77EXcpEzjF9bsKK7up36BSA4qhasU=",
"shasum": "6c7lFhYNu3EgLQcnEPEicCYpCGyFTtcourWwPRcTYQo=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/get-entropy/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "9jRaEw4/0RCp3b3oAI+PK2zcgwupdOnBhaL4zX4pKRg=",
"shasum": "aAeCBgJejxBjXg2v/SVChTxQKpgxY7Jic60HtuJdxlY=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/home-page/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "4LSF+30bmPlizM/wYBrq4dp72wkcca9rwYyqkz7ZPvY=",
"shasum": "rE1Oc5DDk8Z3DDw9SfgLPSVSZO3W4qTjvPYs2qk7jyQ=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/images/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "v2cJ3d1fomwpUzSR+XZCLF88e5k0NOm5aVo8dftKKSU=",
"shasum": "tkZ42aamvqeYMwzCCu5UXgUo4krMU7vNshBQUsbSTmY=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "sKqHlIDCKGyzDhV7wlJTv7RR6m6lrJF4KgyoTacwYao=",
"shasum": "/wAEme4fXDW4C2mJ+eqPYvbOpe+oTNP4VO5n4Ku/hC8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "ojUZu1+nqCNBVoWHAaDkNRqWx+JVQfaKTOcyGDFD2Wg=",
"shasum": "LKYOTI3wR2ARS0zHFBW1h6uF1Fei6iQPUxLr0/86kRs=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "cyr+aslb2DLAQOj2fs5pBwp3l1WKZU6muxrmhsbAtks=",
"shasum": "n4IS5lq5sO6odkmWV+4wpSn32RSfFRf1lyLtKvJUr2Y=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "cn53UKSOkd/fFq93Nwl2DBkMartFXwyyeoArG9Zxp8w=",
"shasum": "V4uDvqnGNvhekmL35/vqafgbnYQ3bOincBpaHEYKYaU=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "fT6pbcejyNwb8cjgHPXgFWhpzCNYFuWUIrkuqLP70vU=",
"shasum": "yx3LFyPIvjAmf6eoYCIqgWZUiWm0im8CanzD0o3f8uE=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-browserify-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { PostProcessOptions } from '@metamask/snaps-utils';
import type { PostProcessOptions } from '@metamask/snaps-utils/node';
import {
checkManifest,
evalBundle,
logWarning,
postProcessBundle,
useTemporaryFile,
} from '@metamask/snaps-utils';
} from '@metamask/snaps-utils/node';
import type { BrowserifyObject } from 'browserify';
import { fromSource } from 'convert-source-map';
import pathUtils from 'path';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/commands/build/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFile } from '@metamask/snaps-utils';
import { isFile } from '@metamask/snaps-utils/node';
import { resolve as pathResolve } from 'path';

import type { ProcessedConfig, ProcessedWebpackConfig } from '../../config';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/commands/eval/eval.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFile } from '@metamask/snaps-utils';
import { isFile } from '@metamask/snaps-utils/node';
import { resolve } from 'path';

import type { ProcessedConfig } from '../../config';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/commands/eval/implementation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { evalBundle, SnapEvalError, indent } from '@metamask/snaps-utils';
import { evalBundle, SnapEvalError, indent } from '@metamask/snaps-utils/node';
import { red } from 'chalk';

import { CommandError } from '../../errors';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/commands/manifest/implementation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkManifest, indent } from '@metamask/snaps-utils';
import { checkManifest, indent } from '@metamask/snaps-utils/node';
import { red, yellow } from 'chalk';
import type { Ora } from 'ora';
import { dirname } from 'path';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/commands/manifest/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFile } from '@metamask/snaps-utils';
import { isFile } from '@metamask/snaps-utils/node';

import type { ProcessedConfig } from '../../config';
import { CommandError } from '../../errors';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/commands/watch/watch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFile } from '@metamask/snaps-utils';
import { isFile } from '@metamask/snaps-utils/node';

import type { ProcessedConfig, ProcessedWebpackConfig } from '../../config';
import { CommandError } from '../../errors';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
isFile,
SnapsStructError,
named,
} from '@metamask/snaps-utils';
} from '@metamask/snaps-utils/node';
import { hasProperty } from '@metamask/utils';
import { transform } from '@swc/core';
import type { BrowserifyObject } from 'browserify';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-cli/src/webpack/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
logError,
NpmSnapFileNames,
readJsonFile,
} from '@metamask/snaps-utils';
} from '@metamask/snaps-utils/node';
import type { IncomingMessage, Server, ServerResponse } from 'http';
import { createServer } from 'http';
import type { AddressInfo } from 'net';
Expand Down
12 changes: 6 additions & 6 deletions packages/snaps-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"types": "./dist/types/index.d.ts"
},
"./node": {
"import": "./dist/index.node.mjs",
"require": "./dist/index.node.js",
"types": "./dist/types/index.node.d.ts"
"import": "./dist/node.mjs",
"require": "./dist/node.js",
"types": "./dist/types/node.d.ts"
},
"./react-native": {
"import": "./dist/index.react-native.mjs",
"require": "./dist/index.react-native.js",
"types": "./dist/types/index.react-native.d.ts"
"import": "./dist/react-native.mjs",
"require": "./dist/react-native.js",
"types": "./dist/types/react-native.d.ts"
},
"./package.json": "./package.json"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable import/export */

export * from '.';
export * from './services/index.node';
export * from './services/node';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable import/export */

export * from '.';
export * from './services/index.react-native';
export * from './services/react-native';
2 changes: 0 additions & 2 deletions packages/snaps-controllers/src/services/index.node.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/snaps-controllers/src/services/node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '.';
export * from './node-js';
2 changes: 1 addition & 1 deletion packages/snaps-jest/src/internals/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assertIsSnapManifest,
isDirectory,
isFile,
} from '@metamask/snaps-utils';
} from '@metamask/snaps-utils/node';
import { createModuleLogger } from '@metamask/utils';
import express from 'express';
import { promises as fs } from 'fs';
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-jest/src/internals/simulation/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
detectSnapLocation,
NodeThreadExecutionService,
setupMultiplex,
} from '@metamask/snaps-controllers';
} from '@metamask/snaps-controllers/node';
import { getEncryptionKey } from '@metamask/snaps-rpc-methods';
import type {
SnapId,
Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-rollup-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { PostProcessOptions } from '@metamask/snaps-utils';
import type { PostProcessOptions } from '@metamask/snaps-utils/node';
import {
checkManifest,
evalBundle,
postProcessBundle,
} from '@metamask/snaps-utils';
} from '@metamask/snaps-utils/node';
import { promises as fs } from 'fs';
import pathUtils from 'path';
// eslint-disable-next-line @typescript-eslint/no-shadow
Expand Down
6 changes: 3 additions & 3 deletions packages/snaps-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"types": "./dist/types/index.d.ts"
},
"./node": {
"import": "./dist/index.node.mjs",
"require": "./dist/index.node.js",
"types": "./dist/types/index.node.d.ts"
"import": "./dist/node.mjs",
"require": "./dist/node.js",
"types": "./dist/types/node.d.ts"
},
"./test-utils": {
"import": "./dist/test-utils/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-utils/src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import pathUtils from 'path';

import { parseJson } from './json';
import type { VirtualFile } from './virtual-file';
import { readVirtualFile } from './virtual-file';
import { readVirtualFile } from './virtual-file/node';

/**
* Checks whether the given path string resolves to an existing directory, and
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-utils/src/manifest/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '../snaps';
import type { SnapFiles, UnvalidatedSnapFiles } from '../types';
import { NpmSnapFileNames, SnapValidationFailureReason } from '../types';
import { readVirtualFile, VirtualFile } from '../virtual-file';
import { readVirtualFile, VirtualFile } from '../virtual-file/node';
import type { SnapManifest } from './validation';

const MANIFEST_SORT_ORDER: Record<keyof SnapManifest, number> = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
export * from '.';
export * from './eval';
export * from './fs';
export * from './manifest/index.node';
export * from './manifest/node';
export * from './mock';
export * from './npm';
export * from './post-process';
export * from './virtual-file/index.node';
export * from './virtual-file/node';
4 changes: 2 additions & 2 deletions packages/snaps-webpack-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { getErrorMessage } from '@metamask/snaps-sdk';
import type { PostProcessOptions, SourceMap } from '@metamask/snaps-utils';
import {
checkManifest,
evalBundle,
postProcessBundle,
useTemporaryFile,
} from '@metamask/snaps-utils';
} from '@metamask/snaps-utils/node';
import type { PostProcessOptions, SourceMap } from '@metamask/snaps-utils/node';
import { assert } from '@metamask/utils';
import pathUtils from 'path';
import { promisify } from 'util';
Expand Down
1 change: 1 addition & 0 deletions tsconfig.packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"moduleResolution": "node",
"paths": {
"@metamask/*/test-utils": ["../*/src/test-utils"],
"@metamask/*/node": ["../*/src/node"],
"@metamask/*": ["../*/src"]
},
"resolveJsonModule": true,
Expand Down

0 comments on commit 6ba5a4a

Please sign in to comment.