-
Notifications
You must be signed in to change notification settings - Fork 26
Fix exports by removing hbs Prettier formatting #373
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
4 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| **/src/api/apollo/generated | ||
| **/src/api/apollo/generated | ||
| *.hbs |
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 |
|---|---|---|
| @@ -1,28 +1,36 @@ | ||
| # | ||
| {{projectTitle}} | ||
|
|
||
| ## Description | ||
| {{projectDescription}} | ||
|
|
||
| ## Readme | ||
| {{projectReadme}} | ||
|
|
||
| ## About Playground Export This project was generated from Playground living | ||
| here: [{{projectLink}}]({{projectLink}}) We have added some basics tests, which | ||
| you can run using Node, Flow Emulator and Flow JS Testing Framework. ## | ||
| Installation ### Node *(optional if you have it installed already)* Please | ||
| follow instructions on NodeJS download page and install latest version of NodeJS | ||
| software: https://nodejs.org/en/download/ ### Flow Emulator *(optional if you | ||
| have it installed already)* Flow Emulator is bundled with Flow CLI. You can find | ||
| instructions on how to install it on Flow Docs site: | ||
| https://docs.onflow.org/flow-cli/ ### Flow JS Testing Framework All the | ||
| necessary files will be installed if you run `npm install` inside `test` folder. | ||
| For documentations on how to use the framework you can consult package | ||
| repository | ||
| [https://github.com/onflow/flow-js-testing](https://github.com/onflow/flow-js-testing) | ||
| ### Next Step When all the above tools would be installed you will need to init | ||
| Flow Emulator with `flow init` command from within `test` folder. This will | ||
| create `flow.json` file in the folder, which is necessary for emulator to | ||
| operate properly. Then you can proceed running the tests. We encourage you to | ||
| run "Create Accounts" suit first, followed by "Deployment" and then transactions | ||
| and scripts. ### Afterword Good luck and happy hacking! :) | ||
| # {{projectTitle}} | ||
|
|
||
| ## Description | ||
| {{ projectDescription }} | ||
|
|
||
| ## Readme | ||
| {{ projectReadme }} | ||
|
|
||
| ## About Playground Export | ||
| This project was generated from Playground living here: | ||
| [{{projectLink}}]({{projectLink}}) | ||
|
|
||
| We have added some basics tests, which you can run using Node, Flow Emulator and Flow JS Testing Framework. | ||
|
|
||
| ## Installation | ||
| ### Node *(optional if you have it installed already)* | ||
| Please follow instructions on NodeJS download page and install latest version of NodeJS software: | ||
| https://nodejs.org/en/download/ | ||
|
|
||
| ### Flow Emulator *(optional if you have it installed already)* | ||
| Flow Emulator is bundled with Flow CLI. You can find instructions on how to install it on Flow Docs site: | ||
| https://docs.onflow.org/flow-cli/ | ||
|
|
||
| ### Flow JS Testing Framework | ||
| All the necessary files will be installed if you run `npm install` inside `test` folder. For documentations on how to use | ||
| the framework you can consult package repository [https://github.com/onflow/flow-js-testing](https://github.com/onflow/flow-js-testing) | ||
|
|
||
| ### Next Step | ||
| When all the above tools would be installed you will need to init Flow Emulator with `flow init` command from within | ||
| `test` folder. This will create `flow.json` file in the folder, which is necessary for emulator to operate properly. | ||
|
|
||
| Then you can proceed running the tests. We encourage you to run "Create Accounts" suit first, followed by "Deployment" and then | ||
| transactions and scripts. | ||
|
|
||
| ### Afterword | ||
| Good luck and happy hacking! :) | ||
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 |
|---|---|---|
| @@ -1 +1,12 @@ | ||
| { "presets": [ [ "@babel/preset-env", { "targets": { "node": "current" } } ] ] } | ||
| { | ||
| "presets": [ | ||
| [ | ||
| "@babel/preset-env", | ||
| { | ||
| "targets": { | ||
| "node": "current" | ||
| } | ||
| } | ||
| ] | ||
| ] | ||
| } |
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 |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| module.exports = { "testEnvironment": "node", "verbose": true, | ||
| "coveragePathIgnorePatterns": ["/node_modules/"], }; | ||
| module.exports = { | ||
| "testEnvironment": "node", | ||
| "verbose": true, | ||
| "coveragePathIgnorePatterns": ["/node_modules/"], | ||
| }; |
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 |
|---|---|---|
| @@ -1,5 +1,21 @@ | ||
| { "name": "{{name}}", "version": "0.0.0", "main": "index.js", "license": "MIT", | ||
| "scripts": { "init-flow": "flow init", "start-emulator": "flow emulator -v" }, | ||
| "dependencies": { "@babel/core": "^7.12.10", "@babel/preset-env": "^7.12.11", | ||
| "@onflow/types": "^0.0.4", "babel-jest": "^26.6.3", "flow-js-testing": "~0.1.7", | ||
| "jest": "^26.6.3" }, "devDependencies": { "prettier": "^2.2.1" } } | ||
| { | ||
| "name": "{{name}}", | ||
| "version": "0.0.0", | ||
| "main": "index.js", | ||
| "license": "MIT", | ||
| "scripts": { | ||
| "init-flow": "flow init", | ||
| "start-emulator": "flow emulator -v" | ||
| }, | ||
| "dependencies": { | ||
| "@babel/core": "^7.12.10", | ||
| "@babel/preset-env": "^7.12.11", | ||
| "@onflow/types": "^0.0.4", | ||
| "babel-jest": "^26.6.3", | ||
| "flow-js-testing": "~0.1.7", | ||
| "jest": "^26.6.3" | ||
| }, | ||
| "devDependencies": { | ||
| "prettier": "^2.2.1" | ||
| } | ||
| } |
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 |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| {{#if signers~}} | ||
| // Set transaction signers const signers = [ | ||
| {{#each signers~}} | ||
| {{this}}, | ||
| {{/each}} | ||
| ] | ||
| {{/if}} | ||
| {{#if signers ~}} | ||
| // Set transaction signers | ||
| const signers = [ | ||
| {{#each signers ~}} | ||
| {{this}}, | ||
| {{/each}} | ||
| ] | ||
| {{/if}} |
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 |
|---|---|---|
| @@ -1,14 +1,13 @@ | ||
| {{#if imports~}} | ||
| // Generate addressMap from import statements | ||
| {{#each imports~}} | ||
| const | ||
| {{name}} | ||
| = await getContractAddress("{{name}}") | ||
| {{/each}} | ||
|
|
||
| const addressMap = { | ||
| {{#each imports~}} | ||
| {{name}}, | ||
| {{/each}} | ||
| } | ||
| {{/if}} | ||
| {{#if imports ~}} | ||
| // Generate addressMap from import statements | ||
| {{#each imports ~}} | ||
| const {{name}} = await getContractAddress("{{name}}") | ||
| {{/each}} | ||
|
|
||
| const addressMap = { | ||
| {{#each imports ~}} | ||
| {{name}}, | ||
| {{/each}} | ||
| } | ||
| {{/if}} | ||
|
|
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 |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| {{#if accounts~}} | ||
| // pass corrected addressed to getAccount calls code = | ||
| code.replace(/(?:getAccount\(\s*)(0x.*)(?:\s*\))/g, (_, match) => { const | ||
| accounts = { | ||
| {{#each accounts}} | ||
| "{{this}}" : | ||
| {{getNameByAddress this}}, | ||
| {{/each}} | ||
| } const name = accounts[match] return `getAccount(${name})`; }); | ||
| {{/if}} | ||
| {{#if accounts ~}} | ||
| // pass corrected addressed to getAccount calls | ||
| code = code.replace(/(?:getAccount\(\s*)(0x.*)(?:\s*\))/g, (_, match) => { | ||
| const accounts = { | ||
| {{#each accounts}} | ||
| "{{this}}" : {{getNameByAddress this}}, | ||
| {{/each}} | ||
| } | ||
| const name = accounts[match] | ||
| return `getAccount(${name})`; | ||
| }); | ||
| {{/if}} |
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 |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| {{#if accounts~}} | ||
| // Import participating accounts | ||
| {{#each accounts~}} | ||
| const | ||
| {{this}} | ||
| = await getAccountAddress("{{this}}") | ||
| {{/each}} | ||
| {{/if}} | ||
| {{#if accounts ~}} | ||
| // Import participating accounts | ||
| {{#each accounts ~}} | ||
| const {{this}} = await getAccountAddress("{{this}}") | ||
| {{/each}} | ||
| {{/if}} |
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| {{#if wrap}}"{{/if}}{{item}}{{#if wrap}}"{{/if}} | ||
| {{#if wrap}}"{{/if}}{{item}}{{#if wrap}}"{{/if}} | ||
alse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
|---|---|---|
| @@ -1,29 +1,52 @@ | ||
| import path from "path"; import * as types from "@onflow/types"; import { init, | ||
| sendTransaction, deployContractByName, getTransactionCode, } from | ||
| "flow-js-testing/dist"; import { getScriptCode } from | ||
| "flow-js-testing/dist/utils/file"; import { executeScript } from | ||
| "flow-js-testing/dist/utils/interaction"; import { getContractAddress } from | ||
| "flow-js-testing/dist/utils/contract"; import { getAccountAddress } from | ||
| "flow-js-testing/dist/utils/create-account"; const basePath = | ||
| path.resolve(__dirname, "../{{cadenceFolder}}"); beforeAll(() => { | ||
| init(basePath); }); describe("Replicate Playground Accounts", () => { | ||
| test("Create Accounts", async ()=>{ // Playground project support 4 accounts, | ||
| but nothing stops you from creating more by following the example laid out below | ||
| const Alice = await getAccountAddress("Alice") const Bob = await | ||
| getAccountAddress("Bob") const Charlie = await getAccountAddress("Charlie") | ||
| const Dave = await getAccountAddress("Dave") console.log("Four Playground | ||
| accounts were created with following addresses"); console.log("Alice:", Alice) | ||
| console.log("Bob:", Bob) console.log("Charlie:", Charlie) console.log("Dave:", | ||
| Dave) }) }) describe("Deployment", () => { | ||
| {{#each contractsUnitTests}} | ||
| {{{this}}} | ||
| {{/each}} | ||
| }) describe("Transactions", () => { | ||
| {{#each transactionsUnitTests}} | ||
| {{{this}}} | ||
| {{/each}} | ||
| }) describe("Scripts", () => { | ||
| {{#each scriptsUnitTests}} | ||
| {{{this}}} | ||
| {{/each}} | ||
| }) | ||
| import path from "path"; | ||
| import * as types from "@onflow/types"; | ||
| import { | ||
| init, | ||
| sendTransaction, | ||
| deployContractByName, | ||
| getTransactionCode, | ||
| } from "flow-js-testing/dist"; | ||
| import { getScriptCode } from "flow-js-testing/dist/utils/file"; | ||
| import { executeScript } from "flow-js-testing/dist/utils/interaction"; | ||
| import { getContractAddress } from "flow-js-testing/dist/utils/contract"; | ||
| import { getAccountAddress } from "flow-js-testing/dist/utils/create-account"; | ||
|
|
||
| const basePath = path.resolve(__dirname, "../{{cadenceFolder}}"); | ||
|
|
||
| beforeAll(() => { | ||
| init(basePath); | ||
| }); | ||
|
|
||
| describe("Replicate Playground Accounts", () => { | ||
| test("Create Accounts", async ()=>{ | ||
| // Playground project support 4 accounts, but nothing stops you from creating more by following the example laid out below | ||
| const Alice = await getAccountAddress("Alice") | ||
| const Bob = await getAccountAddress("Bob") | ||
| const Charlie = await getAccountAddress("Charlie") | ||
| const Dave = await getAccountAddress("Dave") | ||
|
|
||
| console.log("Four Playground accounts were created with following addresses"); | ||
| console.log("Alice:", Alice) | ||
| console.log("Bob:", Bob) | ||
| console.log("Charlie:", Charlie) | ||
| console.log("Dave:", Dave) | ||
| }) | ||
| }) | ||
|
|
||
| describe("Deployment", () => { | ||
| {{#each contractsUnitTests}} | ||
| {{{this}}} | ||
| {{/each}} | ||
| }) | ||
|
|
||
| describe("Transactions", () => { | ||
| {{#each transactionsUnitTests}} | ||
| {{{this}}} | ||
| {{/each}} | ||
| }) | ||
|
|
||
| describe("Scripts", () => { | ||
| {{#each scriptsUnitTests}} | ||
| {{{this}}} | ||
| {{/each}} | ||
| }) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add something about node v17?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added node 16 to the package.json engines