@wedgekit/scripts
Usage
npx @wedgekit/scripts <command>
MUST HAVE NODE v14+
Application vs Package Development
@wedgekit/scripts
can be used to develop both A2W applications and Wedgekit packages (libraries). The following commands are valid for both application and package development; they will have different effects depending on the type of development.
The default type of development is application development. To indicate you are using a package, use the -p
or --package
flag with any of the following commands. Alternatively, use the -s
or --script
flag with any of the following commands to indicate you are using a node script.
Commands
Tip: Typing -h
after either the application name or any of the commands will pull up a help menu*.
create
$ npx @wedgekit/scripts create <name>
/ $ wedgekit create <name>
Creates a new web application
Note: Currently create
is only configured for web applications. Package creation is coming someday*.
Subcommand | Required | Description |
---|---|---|
name | The web application name; a directory will be created with this name |
Option | Flag(s) | App/Package/Script | Example | Description |
---|---|---|---|---|
directory |
-d --dir
|
A/P/S | $ wedgekit create example-app -d test |
Defines the location of the application if different from <name>/
|
description | --desc |
A/P/S | $ wedgekit create example-app --desc "My App" |
Adds a description of the application/package |
template | --template |
A | $ wedgekit create example-app --template force |
Makes the created application with the specified template possible options are force and basic
|
build
$ npx @wedgekit/scripts build
/ $ wedgekit build
Build the src directory. Expects an src/index.ts
entry file.
Option | Flag(s) | App/Package/Script | Example | Description |
---|---|---|---|---|
clean |
-c --clean
|
P/S | $ wedgekit build -c |
Removes the dist/ directory before building package |
dev |
-d --dev
|
P/S | $ wedgekit build -d |
Builds with dev options set to true; used for local development |
types-only |
-t --types-only
|
P | $ wedgekit build -t |
Only builds type declaration files; used for type-only packages |
unbundled |
-u --unbundled
|
P | $ wedgekit build -u |
Distributes the unbundled files in addition to the ESM and CJS bundles |
watch |
-w --watch
|
P/S | $ wedgekit build -w |
Watches source files for changes that would invalidate the build and rebuilds |
start
$ npx @wedgekit/scripts start
/ $ wedgekit start
Starts a dev server for local app development if in app mode. Expects an index.html
in the current working directory. If in script mode, runs the script in src/index.ts
using ts-node
.
Note: start
is only intended for use with web applications and scripts. Package developers should use wedgekit build -w
instead.
Note: vite
flags will be applied to wedgekit start
. For a list type npx vite --h
Note: proxy
flag is necessary to use samesite cookies locally
Option | Flag(s) | App/Package/Script | Example | Description |
---|---|---|---|---|
graphql proxy | --graphql-proxy |
A | $wedgekit start --graphql-proxy https://develop.agility.dmsi.io/graphql |
Uses the Vite proxy middleware to proxy to the desired graphql environment |
rest proxy | --rest-proxy |
A | $wedgekit start --rest-proxy https://develop.agility.dmsi.io/rest |
Uses the Vite proxy middleware to proxy to the desired rest environment |
Definitions
someday - The long-promised day in which all prioritized features will be complete and developers can tackle long-delayed tech debt.
soon - As soon as all urgent work is complete, which is a state of existence which will surely be upon us any day now.