@groundfloorcloud/cli 0.1.11 → 0.1.13

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/README.md CHANGED
@@ -245,7 +245,7 @@ gf flags rm new-checkout -e dev
245
245
  Keys are lowercase letters, digits, `-`, `_` and `.`, starting with a letter.
246
246
  Apps read flags at runtime from `GET /v1/workspaces/{id}/flags/runtime`: Shell
247
247
  apps with the end-user token, Coderunners with `gf m2m token` (read-only). See
248
- https://docs.groundfloor.cloud/docs/customer-portal/feature-flags.
248
+ https://docs.groundfloor.cloud/docs/configure/feature-flags.
249
249
 
250
250
  ## Commands
251
251
 
@@ -309,7 +309,7 @@ sign-in fails with an invalid redirect URI:
309
309
  ## More
310
310
 
311
311
  - [Customer Portal](https://app.groundfloor.cloud)
312
- - [Developers](https://docs.groundfloor.cloud/docs/customer-portal/developers)
313
- - [Deploy with agents](https://docs.groundfloor.cloud/docs/customer-portal/agents)
314
- - [Coderunner](https://docs.groundfloor.cloud/docs/customer-portal/coderunner)
312
+ - [Developers](https://docs.groundfloor.cloud/docs/developer-tools/cli)
313
+ - [Deploy with agents](https://docs.groundfloor.cloud/docs/developer-tools/ai-agents)
314
+ - [Coderunner](https://docs.groundfloor.cloud/docs/deploy)
315
315
  - [API authentication](https://docs.groundfloor.cloud/docs/api/authentication)
package/dist/index.js CHANGED
@@ -1795,8 +1795,36 @@ async function readOptional(filePath) {
1795
1795
  return null;
1796
1796
  }
1797
1797
  }
1798
- async function preflightNodePackage(sourceDir) {
1798
+ var NODE_HANDLER_MISSING = "Function/Job/Schedule Node projects need a handler.js exporting `handler` at the project root (or a package.json \"main\" pointing at an existing file). The platform runs a generated /app/main.js that does require('./handler'); `npm start` is not run for these workload types. See the runtime docs for the handler signature.";
1799
+ async function exists(filePath) {
1800
+ try {
1801
+ return (await fs3.stat(filePath)).isFile();
1802
+ } catch {
1803
+ return false;
1804
+ }
1805
+ }
1806
+ async function hasHandlerEntry(sourceDir) {
1807
+ if (await exists(path4.join(sourceDir, "handler.js"))) return true;
1808
+ const raw = await readOptional(path4.join(sourceDir, "package.json"));
1809
+ if (raw == null) return false;
1810
+ let main2;
1811
+ try {
1812
+ main2 = JSON.parse(raw).main;
1813
+ } catch {
1814
+ throw new Error("package.json is not valid JSON.");
1815
+ }
1816
+ if (typeof main2 !== "string" || !main2.trim()) return false;
1817
+ const resolved = path4.resolve(sourceDir, main2);
1818
+ const rel = path4.relative(sourceDir, resolved);
1819
+ if (rel.startsWith("..") || path4.isAbsolute(rel)) return false;
1820
+ return exists(resolved);
1821
+ }
1822
+ async function preflightNodePackage(sourceDir, workloadType = "service") {
1799
1823
  const dockerfile = await readOptional(path4.join(sourceDir, "Dockerfile"));
1824
+ if (dockerfile == null && workloadType !== "service") {
1825
+ if (!await hasHandlerEntry(sourceDir)) throw new Error(NODE_HANDLER_MISSING);
1826
+ return;
1827
+ }
1800
1828
  const needsStartScript = dockerfile == null || dockerfileRunsNpmStart(dockerfile);
1801
1829
  if (!needsStartScript) return;
1802
1830
  const raw = await readOptional(path4.join(sourceDir, "package.json"));
@@ -2005,7 +2033,7 @@ async function deployCommand(opts) {
2005
2033
  }
2006
2034
  }
2007
2035
  if (runtime === "node") {
2008
- await preflightNodePackage(pkg.sourceDir);
2036
+ await preflightNodePackage(pkg.sourceDir, workloadType);
2009
2037
  }
2010
2038
  const schedule = resolveDeploySchedule({
2011
2039
  workloadType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groundfloorcloud/cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Groundfloor gf CLI — sign in, deploy coderunners, publish Shell apps, and manage secrets, files, and Dataplane.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,7 @@
18
18
  "url": "git+ssh://git@bitbucket.org/codementeam/groundfloor-client-portal.git",
19
19
  "directory": "packages/cli"
20
20
  },
21
- "homepage": "https://docs.groundfloor.cloud/docs/customer-portal/developers",
21
+ "homepage": "https://docs.groundfloor.cloud/docs/developer-tools/cli",
22
22
  "keywords": [
23
23
  "groundfloor",
24
24
  "cli",