-
Notifications
You must be signed in to change notification settings - Fork 598
chore(docs): update box readme, remove duplicated features, added box install to the docs #8254
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e02ed1d
chore(docs): update box readme, remove duplicated features, added box…
signorecello d14cf41
wip (tests)
signorecello ddba6bc
chore(boxes): add test for boxes
signorecello 72dc907
bumping playwright so it works with ubuntu 22.04, adding the missing …
signorecello 2c89e92
committing lockfile
signorecello 012e388
bumping playwright
signorecello 16007b4
yarn
signorecello da4522d
Merge branch 'master' into zpedro/boxes_readme
signorecello 421ae06
this idiot of yours had removed package.json from the wrong box...
signorecello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| import { parse } from "@iarna/toml"; | ||
| import axios from "axios"; | ||
| import { execSync } from "child_process"; | ||
| import fs from "fs/promises"; | ||
| import path from "path"; | ||
| import { describe, test, expect, beforeAll } from "vitest"; | ||
|
|
||
| const getLatestStable = async () => { | ||
| try { | ||
| const { data } = await axios.get( | ||
| `https://api.github.com/repos/AztecProtocol/aztec-packages/releases`, | ||
| ); | ||
| return data[0].tag_name.split("-v")[1]; | ||
| } catch (error) { | ||
| console.error("Error fetching latest stable version:", error); | ||
| return; | ||
| } | ||
| }; | ||
|
|
||
| const version = await getLatestStable(); | ||
| const tag = version.match(/^\d+\.\d+\.\d+$/) | ||
| ? `aztec-packages-v${version}` | ||
| : version; | ||
|
|
||
| describe("Token contract", () => { | ||
| beforeAll(() => { | ||
| try { | ||
| execSync("npx . new -d -t contract -n token_contract", { | ||
| stdio: "inherit", | ||
| }); | ||
| } catch (error) { | ||
| console.error("Error executing command:", error); | ||
| } | ||
| }); | ||
|
|
||
| test("Paths were updated correctly", async () => { | ||
| const replaces = []; | ||
| const findAndReplace = async (dir, prefix) => { | ||
| const files = await fs.readdir(dir, { | ||
| withFileTypes: true, | ||
| }); | ||
| files.forEach(async (file) => { | ||
| const filePath = path.join(dir, file.name); | ||
| if (file.isDirectory()) { | ||
| findAndReplace(filePath, prefix); // Recursively search subdirectories | ||
| } else if (file.name === "Nargo.toml") { | ||
| replaces.push( | ||
| new Promise(async (resolve, reject) => { | ||
| let content = parse(await fs.readFile(filePath, "utf8")); | ||
| if (!content.dependencies) return; | ||
| resolve( | ||
| Object.keys(content.dependencies) | ||
| .filter((dep) => dep.match("@aztec")) | ||
| .every( | ||
| (dep) => | ||
| content.dependencies[dep] === | ||
| JSON.stringify({ | ||
| git: `https://github.com/${AZTEC_REPO}/`, | ||
| tag, | ||
| directory: `${prefix}${directory}`, | ||
| }), | ||
| ), | ||
| ); | ||
| }), | ||
| ); | ||
| } else if (file.name === "package.json") { | ||
| replaces.push( | ||
| new Promise(async (resolve, reject) => { | ||
| let content = JSON.parse(await fs.readFile(filePath, "utf8")); | ||
| if (!content.dependencies) return; | ||
| resolve( | ||
| Object.keys(content.dependencies) | ||
| .filter((deps) => deps.match("@aztec")) | ||
| // "master" actually means "latest" for the npm release | ||
| .every( | ||
| (dep) => | ||
| content.dependencies[dep] === | ||
| `${version === "master" ? "latest" : `^${version}`}`, | ||
| ), | ||
| ); | ||
| }), | ||
| ); | ||
| } | ||
| }); | ||
| }; | ||
|
|
||
| await findAndReplace(path.resolve("./token_contract"), ""); | ||
| const res = await Promise.all(replaces); | ||
| expect(res).toEqual([true, true]); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.