Skip to content

Commit

Permalink
Revert "initial typescript support (#468)"
Browse files Browse the repository at this point in the history
This reverts commit 8f28dbb.
  • Loading branch information
elliotBraem committed Jan 9, 2024
1 parent 783b871 commit d81cfc5
Show file tree
Hide file tree
Showing 20 changed files with 5,415 additions and 515 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/deploy-dev-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@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
with:
node-version: 20
cache: "npm"
- run: |
npm install
npm run build
files: '**/*.jsx'
find: '${{ steps.set_replacements.outputs.replacements }}'
prefix: '(^|.*)'
suffix: '($|.*)'

- 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
19 changes: 11 additions & 8 deletions .github/workflows/deploy-prod-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@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
with:
node-version: 20
cache: "npm"
- run: |
npm install
npm run build
files: "**/*.jsx"
find: "${{ steps.set_replacements.outputs.replacements }}"
prefix: "(^|.*)"
suffix: "($|.*)"

- 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
54 changes: 11 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Contribution Guidelines for DevHub Repos

## Introduction

At DevHub, we value the contributions of each individual. This document provides an overview of the developer setup and deployment process to help you contribute to our project. We also recommend familiarizing yourself with [how we work](https://github.com/near/devgigsboard-widgets/blob/main/docs/how-we-work.md) to learn about our development process and enhance your contribution experience.

## Developer Setup
Expand Down Expand Up @@ -29,26 +28,12 @@ npm install

#### Run the dev script

To initiate the development environment, you can use the following script. This script will first check if bos-loader is installed and, if not, install it. Then, it will serve the default development environment and watch for changes inside `./src`.
To initiate the development environment, you can use the following script. This script will first check if bos-loader is installed and, if not, install it. Then, it will serve the default development environment.

```sh
npm run dev
```

This runs the bos-loader and the watcher together. You can also run testnet by running:

```sh
npm run dev:testnet
```

While testing the testnet, it's necessary to manually execute the watch script yourself to ensure that changes to files trigger the rebuilding process.

Open another terminal and run:

```sh
npm run watch
```

#### Customizing Creator ID, Contract ID, or Network

If you need to customize the account ID, override the contract ID, or specify a different network for your development environment, you can use the following flags:
Expand All @@ -59,26 +44,24 @@ If you need to customize the account ID, override the contract ID, or specify a

Here's how you can use these flags:

> [!IMPORTANT]
> You will have to change the replace script flags in package.json in order for the watch script to keep using the right flags.
```sh
npm run replace -a your_account_id -c your_contract_id -n your_network
npm run dev -a your_account_id -c your_contract_id -n your_network
```

For example:

```sh
npm run replace -a bob.near -c contract.bobs.near -n mainnet
npm run dev -a bob.near -c contract.bobs.near -n mainnet
```

By using these flags, you have the flexibility to customize the development environment according to your specific needs.


#### Developing across multiple environments

When referencing a component or any parameter that depends on the network, please use the placeholders defined in replacements.\*.json. There are three such files that correspond to different environments:
When referencing a component or any parameter that depends on the network, please use the placeholders defined in replacements.*.json. There are three such files that correspond to different environments:

`replacements.dev.json` - deploys the develop branch, to testnet @ test.beta.near.org
`replacements.dev.json` - deploys the develop branch, to testnet @ test.beta.near.org

`replacements.testnet.json` - deploys main branch, to testnet @ test.near.org

Expand All @@ -102,39 +85,25 @@ Currently, there is no local development environment, so we use [testnet NEAR So

Before deploying the widgets you need to make the needed replacements with references to the account that will host the widgets:

Edit the line in package.json that looks like this:

```json
"replace": "node ./scripts/replace.js -a devhub.near -c devgovgigs.near -n mainnet",
```

to something like this:

```json
"replace": "node ./scripts/replace.js -a devgovgigs.petersalomonsen.near -c devgovgigs.near -n mainnet",
```

Run:

```sh
npm run build
npm run build:preview -- -a devgovgigs.petersalomonsen.near -c devgovgigs.near
```

Then make sure you stay in the `build` directory when deploying

```sh
```
cd build
```

To deploy the widgets, we use [`bos` CLI](https://github.com/FroVolod/bos-cli-rs). Start with this command and follow the interactive questionnaire:

```sh
```
bos components deploy
```

After successful deployment, you will see a full command that could be used to re-deploy the widgets without interactive questionnaire, like this:

```sh
```
bos components deploy gigs.frol14.testnet sign-as gigs.frol14.testnet network-config testnet sign-with-macos-keychain send
```

Expand All @@ -154,7 +123,6 @@ There is GitHub Actions automation that deploys all the widgets to [`devgovgigs.
Thus, once a PR is merged, you should see the new version of the widgets on [DevHub](https://neardevhub.org) in less than 15 seconds.

### Before Publishing

Before publishing, make sure that you’ve go through this section.

#### Code Style and Formatting
Expand All @@ -179,4 +147,4 @@ Sometimes there is a need to deposit extra tokens to cover the widgets’ storag
bos social-db prepaid-storage deposit
```

NOTE: `bos` CLI will interactively ask all the rest of the details to prepare the transaction.
NOTE: `bos` CLI will interactively ask all the rest of the details to prepare the transaction.
21 changes: 0 additions & 21 deletions global.d.ts

This file was deleted.

Loading

0 comments on commit d81cfc5

Please sign in to comment.