prev-cli 0.13.0 → 0.13.1
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/dist/cli.js +13 -12
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -981,7 +981,7 @@ Usage:
|
|
|
981
981
|
prev [options] Start development server
|
|
982
982
|
prev build [options] Build for production
|
|
983
983
|
prev preview [options] Preview production build
|
|
984
|
-
prev create [name] Create
|
|
984
|
+
prev create [name] Create preview in previews/<name>/ (default: "example")
|
|
985
985
|
prev clean [options] Remove old cache directories
|
|
986
986
|
|
|
987
987
|
Options:
|
|
@@ -992,13 +992,13 @@ Options:
|
|
|
992
992
|
-h, --help Show this help message
|
|
993
993
|
|
|
994
994
|
Previews:
|
|
995
|
-
|
|
996
|
-
|
|
995
|
+
Previews must be in the previews/ directory at your project root.
|
|
996
|
+
Each preview is a subfolder with React components:
|
|
997
997
|
|
|
998
|
-
previews/
|
|
999
|
-
my-demo/
|
|
1000
|
-
App.tsx
|
|
1001
|
-
styles.css
|
|
998
|
+
previews/ # Required location
|
|
999
|
+
my-demo/ # Preview name (used in <Preview src="...">)
|
|
1000
|
+
App.tsx # React component (entry point)
|
|
1001
|
+
styles.css # Optional CSS
|
|
1002
1002
|
|
|
1003
1003
|
Then embed in MDX:
|
|
1004
1004
|
import { Preview } from '@prev/theme'
|
|
@@ -1161,17 +1161,18 @@ export default function App() {
|
|
|
1161
1161
|
writeFileSync3(path7.join(previewDir, "App.tsx"), appTsx);
|
|
1162
1162
|
writeFileSync3(path7.join(previewDir, "styles.css"), stylesCss);
|
|
1163
1163
|
console.log(`
|
|
1164
|
-
✨ Created preview:
|
|
1164
|
+
✨ Created preview: previews/${name}/
|
|
1165
1165
|
|
|
1166
1166
|
Files:
|
|
1167
|
-
previews/${name}/App.tsx React component
|
|
1168
|
-
previews/${name}/styles.css Custom
|
|
1167
|
+
previews/${name}/App.tsx React component (entry point)
|
|
1168
|
+
previews/${name}/styles.css Custom animations
|
|
1169
1169
|
|
|
1170
|
-
|
|
1170
|
+
Embed in your MDX:
|
|
1171
1171
|
import { Preview } from '@prev/theme'
|
|
1172
1172
|
<Preview src="${name}" />
|
|
1173
1173
|
|
|
1174
|
-
|
|
1174
|
+
Start dev server:
|
|
1175
|
+
prev
|
|
1175
1176
|
`);
|
|
1176
1177
|
}
|
|
1177
1178
|
async function main() {
|