0.10.77 • Published 3 months ago

image-bin v0.10.77

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

Getting Started with Create Blocklet

This project was bootstrapped with Create Blocklet.

This blocklet is a dapp project, which means this is a full-stack application. It's contained both server and client code.

File Structure

  • public/ - static files
    • favicon.ico - favicon
    • favicon.svg - favicon
    • index.html - main html file, template for react
  • screenshots/ - Screenshots
  • api/ - Api side code
    • hooks/ - blocklet lifecycle hooks
    • libs/ - Api side libraries
    • middlewares/ - Api side middlewares
    • routes/ - Api side routes
    • index.js - Api side entry point
  • src/ - Client side code (A standard react app structure)
  • .env - Environment variables
  • .env.local - Local environment variables
  • .eslintrc.js - ESLint configuration
  • .gitignore - Git ignore file
  • .prettierrc - Prettier configuration
  • blocklet.md - Blocklet README
  • blocklet.yml - Blocklet configuration
  • LICENSE - License file
  • logo.png - Blocklet logo file
  • Makefile - Makefile
  • package.json - Npm package file
  • README.md - A guide for this blocklet
  • version - Version file

Development

  1. Make sure you have @blocklet/cli installed

    Blocklet needs blocklet server as a dependency. So you need to install it first.
    npm install -g @blocklet/cli
    See details in https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#use-the-binary-distribution

  2. Init blocklet server & start blocklet server

    Before starting an blocklet server, you need to init blocklet server.
    blocklet server init --mode=debug
    blocklet server start
    See details in https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#configure-abt-node

  3. Go to the project directory cd [name]

  4. Install dependencies: pnpm install
  5. Start development server: blocklet dev

Bundle

After developing a blocklet, you may need to bundle it. Use npm run bundle command.

Deploy

  • If you want to deploy this blocklet to local blocklet server, you can use blocklet deploy .blocklet/bundle command(Make sure the blocklet is bundled before deployment).

    Or you can simply use npm run deploy command.

  • If you want to deploy this blocklet to remote blocklet server, you can use the command below.

    blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}

    Make sure the blocklet is bundled before deployment.

Upload to blocklet store

  • If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.

    Bump version at first.

    make bump-version

    Then config blocklet store url. You can use those store url in below.

    1. https://store.blocklet.dev/
    2. https://dev.store.blocklet.dev/
    3. A blocklet store started by yourself.

      Make sure you have installed a blocklet store on your own blocklet server. Check it on here: https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ

    blocklet config set store {store url}

    Get a accessToken by using this command.

    Why we need a accessToken?
    A accessToken is genrate by blocklet store, which help us upload our blocklet to any store.

    Set accessToken to blocklet config

    blocklet config set accessToken {accessToken}

    Upload a new version to a store.

    Make sure the blocklet is bundled before upload.

    blocklet upload

    Or you can simply use npm run upload command.

  • You also can upload a new version to a store by Github CI.
    Bump version at first.

    make bump-version

    Push your code to Github main/master branch, or make a pull request to the main/master branch.
    The CI workflow will automatically upload a new version to a store.

Q & A

  1. Q: How to change a blocklet's name?

    A: Change the name field in the package.json file, change the name field in the blocklet.yml file.

    You can also change the title field and description field in the blocklet.yml file.

    Run blocklet meta command, you will get a did config, copy the did value.

    Replace this command "bundle:client": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build", in package.json

    Replace did field in the blocklet.yml

  2. Q: How to change a blocklet's logo?

    Change the logo.png file root folder.

    Or you can change the logo field in the blocklet.yml file.

    Make sure you have added the logo path to the blocklet.yml file files field.

Learn More

License

The code is licensed under the Apache 2.0 license found in the LICENSE file.

0.10.77

3 months ago

0.10.75

3 months ago

0.10.76

3 months ago

0.10.74

3 months ago

0.10.72

4 months ago

0.10.73

4 months ago

0.10.71

4 months ago

0.10.65

4 months ago

0.10.66

4 months ago

0.10.62

4 months ago

0.10.63

4 months ago

0.10.64

4 months ago

0.10.61

4 months ago

0.10.58

4 months ago

0.10.59

4 months ago

0.10.60

4 months ago

0.10.56

5 months ago

0.10.54

5 months ago

0.10.50

5 months ago

0.10.51

5 months ago

0.10.30

6 months ago

0.10.53

5 months ago

0.10.31

6 months ago

0.10.36

6 months ago

0.10.37

6 months ago

0.10.38

6 months ago

0.10.39

6 months ago

0.10.32

6 months ago

0.10.33

6 months ago

0.10.34

6 months ago

0.10.40

6 months ago

0.10.41

6 months ago

0.10.29

6 months ago

0.10.48

5 months ago

0.10.49

5 months ago

0.10.28

6 months ago

0.10.45

5 months ago

0.10.46

5 months ago

0.10.9

8 months ago

0.10.18

8 months ago

0.10.14

8 months ago

0.10.15

8 months ago

0.10.16

8 months ago

0.10.17

8 months ago

0.10.4

8 months ago

0.10.10

8 months ago

0.10.11

8 months ago

0.10.6

8 months ago

0.10.12

8 months ago

0.10.7

8 months ago

0.10.13

8 months ago

0.10.8

8 months ago

0.10.20

8 months ago

0.10.25

7 months ago

0.10.26

7 months ago

0.10.27

7 months ago

0.10.21

7 months ago

0.10.22

7 months ago

0.10.23

7 months ago

0.10.3

8 months ago

0.10.2

8 months ago

0.10.1

8 months ago