-
Notifications
You must be signed in to change notification settings - Fork 23
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
initial typescript support #468
initial typescript support #468
Conversation
@frol @elliotBraem any feedback on this? |
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.
Overall, looks great to me, though i feel we also need to add some watch-io script command to package.json, so during local development we don't need to manually rebuild after each edit.
…out of github action
…feature/456-move-to-typescript
@frol @elliotBraem @ailisp Thank you for the review. Which package are you referring to? I used watchman since I was already familiar with it. Let me know what you guys think! |
…e/456-move-to-typescript
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.
This PR is ready for review again. Yesterday I had issues with the watch script that it would hot reload 8 times on changes to Tag.tsx. Today these issues seem to be gone at my end. Could you thoroughly test this?
…e/456-move-to-typescript
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.
It looks good to me, but I have not tested it locally.
@Megha-Dev-19 Could you give it a try and see if it works as expected when you edit src/devhub/components/atom/Tag.tsx
? 🙏
hey @frol @Tguntenaar, I just tested it locally and the changes are reflected as expected. 👍 |
@Tguntenaar Can you resolve the conflict and we'll merge it! |
Waiting to resolve conflicts this last time then will merge |
…e/456-move-to-typescript
* initial typescript support (need to adjust github action) * fix: replace strings before bos-loader is called * remove dist * refac Tag to transpile to MainComponent * change transpiledPathPrefix to build/src * rename BaseProps to DevHubBaseProps * transpile to build/src * change REPL_DEVHUB_CONTRACT replacement back to devgovgigs.near * wip: move replacements to js script and out of dev.sh (mac only) and out of github action * lint * refac: remove include from history * refac: remove INCLUDE: and add autocomplete module * remove: unused legacy include.js * fix: deploy bos components from ./build working directory * feat: add watchman to build files on change * remove node package fb-watchman * fix: pipeline test issue caused by watchman * fix: move to watchman nodejs client * fix: instead of MainC.. use funcName after transpile * remove old comments * remove unused SIGNER_ID * added default account_id * fix: removed cause generated neardevhub-widgets * fix: buggy behaviour * change CONTRIBUTING.md * changed: use watcher instead of fb-watchman * remove fb-watch commands * added options to watch * blocked, running npm run watch from dev.sh rebuilds too often * feat: trap bos-loader and run watch parallel * update: contribution.md on the dev process * remove watchmanconfig * Update CONTRIBUTING.md zsh -> sh * update import statement * edit the CONTRIBUTING deploy preview steps * fmt
;; | ||
-n|--network) | ||
NETWORK_ENV="$2" | ||
ACCOUNT_ID="$2" |
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.
Getting rid of the custom contract and network has made the following command stop working:
npm run dev:testnet -- -a devhub-dev.testnet -c bodevhub.testnet -n dev
The account should be custom because it can either be devhubtest.testnet or devhub-dev.testnet (so package.json should not hardcode the account)
Contract needs to be custom, for example when using bo's contract for announcements
Network should be custom to follow contract and account
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.
Hey Elliot! Thank you for pointing this out. We should discuss this.
The replacement of those constants in now handled in replace.js instead.
The bos-loader only uses the the ACCOUNT_ID to deploy the widgets.
So when you want to change the account / contract / network this can be done by either editing the package.json or making use of the replacements.*.json files.
If we want npm run dev
to take those arguments we will have to pass it on to the npm run watch
script, which has to pass it to the npm run build
, which passes it to the replace... I thought this would be less optimal.
Btw this is because the watch has to rerun the replace script for every build.
"dev": "npm run dev:mainnet", | ||
"dev:mainnet": "./scripts/dev.sh -a devhub.near", | ||
"dev:testnet": "./scripts/dev.sh -a devhub.testnet", |
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.
Just "dev:testnet": "./scripts/dev.sh"
@@ -3,11 +3,10 @@ import path from "path"; | |||
|
|||
const args = process.argv.slice(2); | |||
|
|||
let NETWORK_ENV = "mainnet"; | |||
let NETWORK_ENV = "testnet"; |
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.
Is this right? I think this should maybe default to mainnet or be overriden from arguments
This reverts commit 8f28dbb.
* feat: Community Announcements Page (#567) * fix solution action * added community announcements UI * added compose field * minor css updates * use community data instead of dummy data * minor UI updates * add mentions notifications * remove unecessary code * remove hover effect * sets up for contract, adds admin check * fix: Fixed deposit error for grant_write_permissions call to social.near (#563) * add elliot and thomas to CODEOWNERS (#570) * Fix telegram string and array issue (#571) * fix solution action * fix telegram string and array issue * update telegram_handle * fix handle and URL * fix tests * prettier update * fix tests * prettier update * Bugfix/559 error flashes (#569) * fix: flash on home screen * fix: error flash on addon tabs * fix: telegram bug * test fix Tile error flash * fix: catch Tile error flash in every component it is used * remove console.log * Playwright test for input validatiojn (#577) * feature: Added input validation when creating and editing a community (#172) * feature: Added input validation when creating and editing a community * feature: Added input validation when creating and editing a community * feature: Added input validation when creating and editing a community * test: Added test for input validation * fix CI (#581) * fix the test case * Improve robustness of admin moderator tests * Clear draft changes after txn is approved (#588) * remove `onDraftStateChange` from editor * updated changes * move txn hash as props * update draft change --------- Co-authored-by: Elliot Braem <[email protected]> Co-authored-by: T guntenaar <[email protected]> Co-authored-by: Espen Simensen <[email protected]> * replacements for testnet * allow no communities found * attach 2N when creating a community * configures with updated function call * updated announcements UI (#606) Co-authored-by: Elliot Braem <[email protected]> * updates feed * working feed * show preview * fix testnet * Revert "initial typescript support (#468)" This reverts commit 8f28dbb. * Move community Github and Board widgets from devgogigs to devhub (#561) * fix solution action * added required components * remove unnecessary code * add hidden btn * update github configurator * prettier update * fix flash error issue * more improvements * prettier update * refactor code * add comment * added state for when no configurations exists * fix pagination error * handle error * fix map error * fix amount issue * updated UI * decoupled state * remove replace fn * remove title on new column --------- Co-authored-by: T guntenaar <[email protected]> * Kanban board UI enhancement (#620) * fix solution action * added required components * remove unnecessary code * add hidden btn * update github configurator * prettier update * fix flash error issue * more improvements * prettier update * refactor code * add comment * added state for when no configurations exists * fix pagination error * handle error * fix map error * fix amount issue * updated UI * decoupled state * added styling * added table view * updated UI for github * more style updates * added border to table * refactor code * cleaned UI * refactor code * added sorting mechanism * prettier update * reduce border size * remove table and few style updates * fix normalize error and suggestive UI changes * fix .map error * remove table view data * update to devhub.near * fix posts for devgovgigs.near * Points tests to devhub.near rather than devgovgigs.near (#595) * converts devgovgigs to devhub * fix: type * fix feeds * Announcements tests (#639) * added few announcements tests * hide card when no posts exists * add more tests and fix announcements UI * add feed tests * fixed UI * fix community tests * tests * format * working test * format * posts legacy --------- Co-authored-by: Megha-Dev-19 <[email protected]> Co-authored-by: T guntenaar <[email protected]> Co-authored-by: Espen Simensen <[email protected]>
Resolves #456
I've used this TS starter from @frol to support typescript in this repo. The process is as follows:
This way we don't have to move everything to typescript now but we can do it file by file