Skip to content
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

Merged
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e8d0e3d
initial typescript support (need to adjust github action)
Tguntenaar Nov 14, 2023
9d34288
fix: replace strings before bos-loader is called
Tguntenaar Nov 16, 2023
ed13d73
remove dist
Tguntenaar Nov 16, 2023
212141b
refac Tag to transpile to MainComponent
Tguntenaar Nov 16, 2023
cc3f945
change transpiledPathPrefix to build/src
Tguntenaar Nov 16, 2023
31fd311
rename BaseProps to DevHubBaseProps
Tguntenaar Nov 16, 2023
3f85dc2
transpile to build/src
Tguntenaar Nov 16, 2023
b389bee
change REPL_DEVHUB_CONTRACT replacement back to devgovgigs.near
Tguntenaar Nov 16, 2023
0fef9cc
wip: move replacements to js script and out of dev.sh (mac only) and …
Tguntenaar Nov 16, 2023
ff0d9cc
Merge branch 'main' of github.com:Tguntenaar/neardevhub-widgets into …
Tguntenaar Nov 19, 2023
7402aa4
lint
Tguntenaar Nov 19, 2023
7055b67
refac: remove include from history
Tguntenaar Nov 19, 2023
1a3095f
refac: remove INCLUDE: and add autocomplete module
Tguntenaar Nov 19, 2023
6cd31b9
remove: unused legacy include.js
Tguntenaar Nov 19, 2023
f7e935c
fix: deploy bos components from ./build working directory
Tguntenaar Nov 19, 2023
8401e47
feat: add watchman to build files on change
Tguntenaar Nov 19, 2023
c3a9b3e
remove node package fb-watchman
Tguntenaar Nov 19, 2023
61d8515
fix: pipeline test issue caused by watchman
Tguntenaar Nov 19, 2023
bdb785a
fix: move to watchman nodejs client
Tguntenaar Nov 20, 2023
5a8bb5f
fix: instead of MainC.. use funcName after transpile
Tguntenaar Nov 20, 2023
6b331b8
remove old comments
Tguntenaar Nov 20, 2023
f1dbdd3
remove unused SIGNER_ID
Tguntenaar Nov 20, 2023
d994616
added default account_id
Tguntenaar Nov 20, 2023
8ad6eb4
fix: removed cause generated neardevhub-widgets
Tguntenaar Nov 22, 2023
cd02863
fix: buggy behaviour
Tguntenaar Nov 22, 2023
6e18f6f
change CONTRIBUTING.md
Tguntenaar Nov 22, 2023
b16ed99
Merge branch 'main' into feature/456-move-to-typescript
Tguntenaar Nov 23, 2023
9124104
changed: use watcher instead of fb-watchman
Tguntenaar Dec 5, 2023
627e815
remove fb-watch commands
Tguntenaar Dec 11, 2023
38b8f33
added options to watch
Tguntenaar Dec 12, 2023
f632786
blocked, running npm run watch from dev.sh rebuilds too often
Tguntenaar Dec 12, 2023
b1234fb
Merge branch 'main' of github.com:near/neardevhub-widgets into featur…
Tguntenaar Dec 12, 2023
d3ddfb8
feat: trap bos-loader and run watch parallel
Tguntenaar Dec 13, 2023
0e1b8b6
update: contribution.md on the dev process
Tguntenaar Dec 13, 2023
4daba20
remove watchmanconfig
Tguntenaar Dec 13, 2023
ffd8467
Merge branch 'main' of github.com:near/neardevhub-widgets into featur…
Tguntenaar Dec 18, 2023
5d4f9fb
Update CONTRIBUTING.md zsh -> sh
Tguntenaar Dec 18, 2023
d040a65
Merge branch 'main' of github.com:near/neardevhub-widgets into featur…
Tguntenaar Dec 21, 2023
be0e662
update import statement
Tguntenaar Dec 21, 2023
01969d3
edit the CONTRIBUTING deploy preview steps
Tguntenaar Dec 21, 2023
9e1fb7c
Merge branch 'main' into feature/456-move-to-typescript
Tguntenaar Dec 29, 2023
ced9056
Merge branch 'main' of github.com:near/neardevhub-widgets into featur…
Tguntenaar Jan 4, 2024
e5559cd
fmt
Tguntenaar Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions .github/workflows/deploy-dev-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set replacements
id: set_replacements
run: |
echo "replacements=$(jq -r '[to_entries[] | .["find"] = "${" + .key + "}" | .["replace"] = .value | del(.key, .value)]' replacements.dev.json | tr -d "\n\r")" >> $GITHUB_OUTPUT

- name: Replace placeholders
uses: flcdrg/replace-multiple-action@v1
- name: Set up node
uses: actions/setup-node@v3
with:
files: '**/*.jsx'
find: '${{ steps.set_replacements.outputs.replacements }}'
prefix: '(^|.*)'
suffix: '($|.*)'
node-version: 20
cache: "npm"
- run: npm run build

- name: Install bos CLI
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.2/bos-cli-installer.sh | sh

- name: Deploy widgets
working-directory: ./build
run: |
which bos
echo $PATH
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/deploy-prod-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set replacements
id: set_replacements
run: |
echo "replacements=$(jq -r '[to_entries[] | .["find"] = "${" + .key + "}" | .["replace"] = .value | del(.key, .value)]' replacements.mainnet.json | tr -d "\n\r")" >> $GITHUB_OUTPUT

- name: Replace placeholders
uses: flcdrg/replace-multiple-action@v1
- name: Set up node
uses: actions/setup-node@v3
with:
files: "**/*.jsx"
find: "${{ steps.set_replacements.outputs.replacements }}"
prefix: "(^|.*)"
suffix: "($|.*)"
node-version: 20
cache: "npm"
- run: npm run build

- name: Install bos CLI
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.6/bos-cli-installer.sh | sh

- name: Deploy widgets
working-directory: ./build
run: |
bos components deploy "$NEAR_SOCIAL_DEPLOY_ID" sign-as "$NEAR_SOCIAL_ACCOUNT_ID" network-config mainnet sign-with-plaintext-private-key --signer-public-key "$NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY" --signer-private-key "$NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY" send
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"settle": 20
}
21 changes: 21 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
declare interface BosContext {
accountId?: string;
networkId: NetworkId;
props: object;
}

declare const Widget: (params: {
src: string;
props: object;
}) => React.ReactNode;

declare interface DevHubBaseProps {
page: any;
}

declare var styled = {
div,
a,
ul,
span,
};
46 changes: 0 additions & 46 deletions module/include.js

This file was deleted.

Loading
Loading