Skip to content

Commit 762ab66

Browse files
committed
chore: add getting started
1 parent 331b22f commit 762ab66

2 files changed

Lines changed: 53 additions & 15 deletions

File tree

packages/mpx/README.md

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,60 @@
22

33
Building widgets with rolldown
44

5+
> NOTE: This tool in alpha
6+
7+
## Getting started
8+
9+
### 1. Create tarball
10+
11+
Let's assume you cloned this repo to `~/code/widgets-tools`
12+
13+
1. `$ cd ~/code/widgets-tools/packages/mpx`
14+
2. `$ pnpm install`
15+
3. `$ pnpm pack` to create tarball
16+
17+
### 2. Install to widget
18+
19+
with `npm`
20+
21+
> `$ npm install ~/code/mpx/mendix-mpx-0-y-z.tgz`
22+
23+
with `pnpm`
24+
25+
> `pnpm install <path>/mpx/mendix-mpx-0-y-z.tgz`
26+
27+
### 3. Change scripts
28+
29+
In your `package.json`
30+
31+
```diff
32+
- "build": "pluggable-widgets-tools build:web"
33+
+ "build": "mpx"
34+
```
35+
36+
and
37+
38+
```diff
39+
- "start": "pluggable-widgets-tools start:server"
40+
+ "start": "mpx -w"
41+
```
42+
43+
## Usage
44+
545
```
646
mpx/0.1.0
747
848
Usage:
9-
$ mpx <command> [options]
10-
11-
Commands:
12-
build [root] Build widget
49+
$ mpx [options] [dir]
1350
14-
For more info, run any command with the `--help` flag:
15-
$ mpx build --help
51+
Build the widget in the specified directory. If the directory is omitted, use the current directory.
1652
1753
Options:
18-
-h, --help Display this message
19-
-v, --version Display version number
20-
```
54+
-w, --watch watch for changes and rebuild (default: false)
55+
-m, --minify minify the output (this option is 'on' in CI environment) (default: false)
56+
-p, --platform <platform> build platform (web or node) (default: web)
57+
--show-config print project config and exit (default: false)
58+
-h, --help Display this message
59+
-v, --version Display version number
2160
2261
```
23-
TODO:
24-
- MPKOUTPUT
25-
- mpkName
26-
``
27-
```

packages/mpx/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
"bin": {
77
"mpx": "./bin/mpx.js"
88
},
9+
"files": [
10+
"bin",
11+
"dist"
12+
],
913
"scripts": {
1014
"test": "echo 'test is missing'",
1115
"dev": "premove dist && rolldown -c rolldown.config.ts -w",
1216
"build": "premove dist && rolldown -c rolldown.config.ts",
13-
"postinstall": "pnpm build"
17+
"prepack": "pnpm build"
1418
},
1519
"keywords": [
1620
"mendix",

0 commit comments

Comments
 (0)