playroom 0.32.1 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +1 -1
- package/CHANGELOG.md +8 -0
- package/README.md +4 -0
- package/bin/{cli.js → cli.cjs} +5 -2
- package/package.json +8 -8
package/.eslintrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# playroom
|
|
2
2
|
|
|
3
|
+
## 0.33.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2d3571b: Add support for loading mjs config files
|
|
8
|
+
|
|
9
|
+
Consumers should now be able to write their configuration files using ES modules. By default Playroom will look for `playroom.config.js` with either a `.js`, `.mjs` or `.cjs` file extension.
|
|
10
|
+
|
|
3
11
|
## 0.32.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -194,6 +194,10 @@ module.exports = {
|
|
|
194
194
|
};
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
+
## ESM Support
|
|
198
|
+
|
|
199
|
+
Playroom supports loading [ESM](https://nodejs.org/api/esm.html#introduction) configuration files. By default, Playroom will look for a playroom config file with either a `.js`, `.mjs` or `.cjs` file extension.
|
|
200
|
+
|
|
197
201
|
## Storybook Integration
|
|
198
202
|
|
|
199
203
|
If you are interested in integrating Playroom into Storybook, check out [storybook-addon-playroom](https://github.com/rbardini/storybook-addon-playroom).
|
package/bin/{cli.js → cli.cjs}
RENAMED
|
@@ -53,7 +53,10 @@ const showUsage = () => {
|
|
|
53
53
|
const cwd = process.cwd();
|
|
54
54
|
const configPath = args.config
|
|
55
55
|
? path.resolve(cwd, args.config)
|
|
56
|
-
: await findUp(
|
|
56
|
+
: await findUp(
|
|
57
|
+
['playroom.config.js', 'playroom.config.mjs', 'playroom.config.cjs'],
|
|
58
|
+
{ cwd }
|
|
59
|
+
);
|
|
57
60
|
|
|
58
61
|
if (!configPath) {
|
|
59
62
|
console.error(
|
|
@@ -62,7 +65,7 @@ const showUsage = () => {
|
|
|
62
65
|
process.exit(1);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
const config =
|
|
68
|
+
const { default: config } = await import(configPath);
|
|
66
69
|
|
|
67
70
|
const playroom = lib({
|
|
68
71
|
cwd: path.dirname(configPath),
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playroom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Design with code, powered by your own component library",
|
|
5
5
|
"main": "utils/index.js",
|
|
6
6
|
"types": "utils/index.d.ts",
|
|
7
7
|
"bin": {
|
|
8
|
-
"playroom": "bin/cli.
|
|
8
|
+
"playroom": "bin/cli.cjs"
|
|
9
9
|
},
|
|
10
10
|
"lint-staged": {
|
|
11
11
|
"**/*.{js,ts,tsx}": [
|
|
@@ -111,14 +111,14 @@
|
|
|
111
111
|
"cypress": "start-server-and-test build-and-serve:all '9000|9001|9002' 'cypress run'",
|
|
112
112
|
"cypress:dev": "start-server-and-test start:all '9000|9001|9002' 'cypress open --browser chrome --e2e'",
|
|
113
113
|
"cypress:verify": "cypress verify",
|
|
114
|
-
"start:basic": "./bin/cli.
|
|
115
|
-
"build:basic": "./bin/cli.
|
|
114
|
+
"start:basic": "./bin/cli.cjs start --config cypress/projects/basic/playroom.config.js",
|
|
115
|
+
"build:basic": "./bin/cli.cjs build --config cypress/projects/basic/playroom.config.js",
|
|
116
116
|
"serve:basic": "PORT=9000 serve --no-request-logging cypress/projects/basic/dist",
|
|
117
|
-
"start:themed": "./bin/cli.
|
|
118
|
-
"build:themed": "./bin/cli.
|
|
117
|
+
"start:themed": "./bin/cli.cjs start --config cypress/projects/themed/playroom.config.js",
|
|
118
|
+
"build:themed": "./bin/cli.cjs build --config cypress/projects/themed/playroom.config.js",
|
|
119
119
|
"serve:themed": "PORT=9001 serve --config ../serve.json --no-request-logging cypress/projects/themed/dist",
|
|
120
|
-
"start:typescript": "./bin/cli.
|
|
121
|
-
"build:typescript": "./bin/cli.
|
|
120
|
+
"start:typescript": "./bin/cli.cjs start --config cypress/projects/typescript/playroom.config.js",
|
|
121
|
+
"build:typescript": "./bin/cli.cjs build --config cypress/projects/typescript/playroom.config.js",
|
|
122
122
|
"serve:typescript": "PORT=9002 serve --no-request-logging cypress/projects/typescript/dist",
|
|
123
123
|
"start:all": "concurrently 'npm:start:*(!all)'",
|
|
124
124
|
"build:all": "concurrently 'npm:build:*(!all)'",
|