2.0.37 • Published 7 months ago

@focuson-nw/cod v2.0.37

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months 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

9 months ago

2.0.29

9 months ago

2.0.37

7 months ago

2.0.35

9 months ago

2.0.36

7 months ago

2.0.33

9 months ago

2.0.34

9 months ago

2.0.31

9 months ago

2.0.32

9 months ago

2.0.30

9 months ago

2.0.26

10 months ago

2.0.27

10 months ago

2.0.24

10 months ago

2.0.25

10 months ago

2.0.23

10 months ago

2.0.17

1 year ago

2.0.18

1 year ago

2.0.16

1 year ago

2.0.22

1 year ago

2.0.20

1 year ago

2.0.21

1 year ago

2.0.15

1 year ago

2.0.13

1 year ago

2.0.5

1 year ago

2.0.14

1 year ago

2.0.4

1 year ago

2.0.11

1 year ago

2.0.7

1 year ago

2.0.12

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.8

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

1.44.0

1 year ago