2.0.37 • Published 2 years ago

@focuson-nw/cod v2.0.37

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Code on Demand CLI

This is a cli tool to help with the Code On Demand project. It transpiles normal react components suitable for use as code on demand components

Installing

npm i --global  @focuson-nw/cod

To validate it worked: the following should give a 'usage message'

cod

Commands

Currently there is only cod build

cod build

Options:
  -src, --source <source>             directory having components to build (default: "src/render")
  -dsrc, --datasource <datasource>    directory having JSON data (default: "src/json")
  -dest, --destination <destination>  directory for saving files after build (default: "public/created")
  -d, --debug                         If specified some commands output more information about how they are working
                                      (default: false)
  -f, --force                         To create destination directory if not found
  • The components to be transpiled should be in the --source directory.
  • Any json files that will be used to load and display the componets are in the --datasource directory
  • The created files are put in the --destination directory

json syntax

If you have a file in src/render called 'Game.tsx' then the following will be replaced by the correct details for the Game component

{
  "_links":  {
    "game1": {"href": "created/gameJson1.json"}
  },
  "_render": {"_self": "#Game/render#"}
}
2.0.28

2 years ago

2.0.29

2 years ago

2.0.37

2 years ago

2.0.35

2 years ago

2.0.36

2 years ago

2.0.33

2 years ago

2.0.34

2 years ago

2.0.31

2 years ago

2.0.32

2 years ago

2.0.30

2 years ago

2.0.26

2 years ago

2.0.27

2 years ago

2.0.24

2 years ago

2.0.25

2 years ago

2.0.23

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

2.0.16

2 years ago

2.0.22

2 years ago

2.0.20

2 years ago

2.0.21

2 years ago

2.0.15

2 years ago

2.0.13

2 years ago

2.0.5

2 years ago

2.0.14

2 years ago

2.0.4

2 years ago

2.0.11

2 years ago

2.0.7

2 years ago

2.0.12

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

1.44.0

3 years ago