Skip to content

Rename Snap "name" property to "id" - #147

Merged
rekmarks merged 2 commits into
mainfrom
snapName-to-snapId
Dec 8, 2021
Merged

rekmarks merged 2 commits into
mainfrom
snapName-to-snapId

Conversation

@rekmarks

@rekmarks rekmarks commented Dec 8, 2021 •

Copy link
Copy Markdown
Contributor

In preparation for #140, renames the snap name property to id, and updates all variable names and comments to match. Also tweaks some docstrings.

@rekmarks
rekmarks merged commit 4631e97 into main Dec 8, 2021
@rekmarks
rekmarks deleted the snapName-to-snapId branch December 8, 2021 06:27
rekmarks added a commit that referenced this pull request Dec 9, 2021
This PR updates all skunkworks packages to match the [new Snaps publishing specification](https://github.com/MetaMask/specifications/blob/87f5e2a29235b174b897e002ca202a66fded9ddc/snaps/publishing.md). Changes are predominantly made in `/controllers` and `/snaps-cli`.

In broad strokes, we had to make the following changes to become compatible with the new publishing specification:
- Migrate from snap "names" to "ids" (#147)
- Handle the new Snap manifest file format
- Fetch Snaps from npm _or_ locally, via `localhost`

All fetching and manifest validation logic is implemented in `controllers/snaps/`, and relevant utilities are imported therefrom in `snaps-cli`. There are a number of utilities that should probably be migrated to their own package, but we will do that later.

Changes in detail:
- The `SnapController` changes are mostly isolated to the Snap installation functionality, namely `installSnaps`, `processRequestedSnap`, and `add`.
- `controllers/src/snaps/json-schemas` includes the JSON Schemas for Snap `package.json` and `snap.manifest.json` files.
  - We use `ajv` ("another json schema validator") to precompile validation functions that we use in production. This is done in a build step. Thanks to @shanejonas for suggesting this approach, which saved a ton of effort.
-  The `snaps-cli` changes are mostly isolated to `src/cmds/init` and `src/cmds/manifest`. Utilities are imported from `/controllers` whenever possible.

Closes: https://github.com/MetaMask/MetaMask-planning/issues/54
rekmarks added a commit that referenced this pull request Dec 10, 2021
This PR updates all skunkworks packages to match the [new Snaps publishing specification](https://github.com/MetaMask/specifications/blob/87f5e2a29235b174b897e002ca202a66fded9ddc/snaps/publishing.md). Changes are predominantly made in `/controllers` and `/snaps-cli`.

In broad strokes, we had to make the following changes to become compatible with the new publishing specification:
- Migrate from snap "names" to "ids" (#147)
- Handle the new Snap manifest file format
- Fetch Snaps from npm _or_ locally, via `localhost`

All fetching and manifest validation logic is implemented in `controllers/snaps/`, and relevant utilities are imported therefrom in `snaps-cli`. There are a number of utilities that should probably be migrated to their own package, but we will do that later.

Changes in detail:
- The `SnapController` changes are mostly isolated to the Snap installation functionality, namely `installSnaps`, `processRequestedSnap`, and `add`.
- `controllers/src/snaps/json-schemas` includes the JSON Schemas for Snap `package.json` and `snap.manifest.json` files.
  - We use `ajv` ("another json schema validator") to precompile validation functions that we use in production. This is done in a build step. Thanks to @shanejonas for suggesting this approach, which saved a ton of effort.
-  The `snaps-cli` changes are mostly isolated to `src/cmds/init` and `src/cmds/manifest`. Utilities are imported from `/controllers` whenever possible.

Closes: https://github.com/MetaMask/MetaMask-planning/issues/54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants