@nodegx/preview 0.1.0 → 0.2.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.
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * P112 OWN-016 — `nodegx deploy` from an npm install: `npx -y --package @nodegx/preview nodegx-deploy <project> <out>`.
4
+ *
5
+ * The deploy engine (`dist/nodegx-deploy.cjs`, HLS-015) already shipped in this package for `@nodegx/export`'s
6
+ * `nodegx deploy` to spawn, but `@nodegx/export` is not published and refuses outside a checkout by design. The
7
+ * engine itself was always a complete CLI: `<project-dir> <out-dir> [--base-url <url>]`, one JSON report on stdout,
8
+ * everything human on stderr. This gives it a name an install can run.
9
+ */
10
+ const fs = require('fs');
11
+ const path = require('path');
12
+
13
+ const engine = path.join(__dirname, '..', 'dist', 'nodegx-deploy.cjs');
14
+ if (!fs.existsSync(engine)) {
15
+ process.stderr.write(
16
+ 'nodegx-deploy: dist/nodegx-deploy.cjs is missing.\n' + 'Build it first: npm --prefix packages/noodl-preview run build\n'
17
+ );
18
+ process.exit(2);
19
+ }
20
+ require(engine);