flightdeck 0.2.17 → 0.2.19

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.
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { FlightDeckLogger, FlightDeck } from './chunk-7KMVUPT3.js';
2
+ import { FlightDeckLogger, FlightDeck } from './chunk-D4EVARJP.js';
3
3
  import './chunk-PZ5AY32C.js';
4
4
  import * as path from 'node:path';
5
- import { parseNumberOption, parseBooleanOption, cli, optional } from 'comline';
5
+ import { cli, parseBooleanOption, parseNumberOption, optional } from 'comline';
6
6
  import { z } from 'zod';
7
7
 
8
- var CLI_LOGGER = new FlightDeckLogger(`comline`, process.pid, undefined, {
8
+ var CLI_LOGGER = new FlightDeckLogger(`comline`, process.pid, void 0, {
9
9
  jsonLogging: true
10
10
  });
11
11
  Object.assign(console, {
@@ -111,7 +111,8 @@ switch (inputs.case) {
111
111
  writeJsonSchema(outdir ?? `.`);
112
112
  }
113
113
  break;
114
- default: {
114
+ case ``:
115
+ case `$configPath`: {
115
116
  const flightDeck = new FlightDeck(inputs.opts);
116
117
  process.on(`close`, async () => {
117
118
  await flightDeck.stopAllServices();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flightdeck.x.ts"],"names":[],"mappings":";;;;;;;AAWA,IAAM,aAAa,IAAI,gBAAA,CAAiB,CAAW,OAAA,CAAA,EAAA,OAAA,CAAQ,KAAK,SAAW,EAAA;AAAA,EAC1E,WAAa,EAAA;AACd,CAAC,CAAA;AACD,MAAA,CAAO,OAAO,OAAS,EAAA;AAAA,EACtB,GAAK,EAAA,UAAA,CAAW,IAAK,CAAA,IAAA,CAAK,UAAU,CAAA;AAAA,EACpC,IAAM,EAAA,UAAA,CAAW,IAAK,CAAA,IAAA,CAAK,UAAU,CAAA;AAAA,EACrC,IAAM,EAAA,UAAA,CAAW,IAAK,CAAA,IAAA,CAAK,UAAU,CAAA;AAAA,EACrC,KAAO,EAAA,UAAA,CA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,EAAa,MAAM,CAAA;AAAA,IACpD,YAAc,EAAA;AAAA,MACb,EAAI,EAAA,iBAAA;AAAA,MACJ,WAAa,EAAA,iBAAA;AAAA,MACb,MAAQ,EAAA;AAAA,KACT;AAAA,IACA,WAAa,EAAA,IAAA;AAAA,IACb,kBAAA,EAAoB,CAAC,IAAS,KAAA;AAC7B,MAAI,IAAA,IAAA,CAAK,CAAC,CAAA,KAAM,CAAU,MAAA,CAAA,EAAA;AACzB,QAAA;AAAA;AAED,MAAM,MAAA,UAAA,GACL,KAAK,CAAC,CAAA,IAAU,UAAK,OAAQ,CAAA,GAAA,IAAO,CAAwB,sBAAA,CAAA,CAAA;AAC7D,MAAO,OAAA,UAAA;AAAA;AACR,GACD;AAAA,EACA;AACD,CAAA;AAEA,IAAM,EAAE,MAAQ,EAAA,eAAA,EAAoB,GAAA,KAAA,CAAM,QAAQ,IAAI,CAAA;AAEtD,QAAQ,OAAO,IAAM;AAAA,EACpB,KAAK,CAAA,MAAA,CAAA;AACJ,IAAA;AACC,MAAM,MAAA,EAAE,MAAO,EAAA,GAAI,MAAO,CAAA,IAAA;AAC1B,MAAA,eAAA,CAAgB,UAAU,CAAG,CAAA,CAAA,CAAA;AAAA;AAE9B,IAAA;AAAA,EACD,SAAS;AACR,IAAA,MAAM,UAAa,GAAA,IAAI,UAAW,CAAA,MAAA,CAAO,IAAI,CAAA;AAC7C,IAAQ,OAAA,CAAA,EAAA,CAAG,SAAS,YAAY;AAC/B,MAAA,MAAM,WAAW,eAAgB,EAAA;AAAA,KACjC,CAAA;AAAA;AAEH","file":"flightdeck.x.js","sourcesContent":["#!/usr/bin/env node\n\nimport * as path from \"node:path\"\n\nimport type { OptionsGroup } from \"comline\"\nimport { cli, optional, parseBooleanOption, parseNumberOption } from \"comline\"\nimport { z } from \"zod\"\n\nimport type { FlightDeckOptions } from \"./flightdeck.lib\"\nimport { FlightDeck, FlightDeckLogger } from \"./flightdeck.lib\"\n\nconst CLI_LOGGER = new FlightDeckLogger(`comline`, process.pid, undefined, {\n\tjsonLogging: true,\n})\nObject.assign(console, {\n\tlog: CLI_LOGGER.info.bind(CLI_LOGGER),\n\tinfo: CLI_LOGGER.info.bind(CLI_LOGGER),\n\twarn: CLI_LOGGER.warn.bind(CLI_LOGGER),\n\terror: CLI_LOGGER.error.bind(CLI_LOGGER),\n})\n\nconst FLIGHTDECK_MANUAL = {\n\toptionsSchema: z.object({\n\t\tport: z.number().optional(),\n\t\tpackageName: z.string(),\n\t\tservices: z.record(z.object({ run: z.string(), waitFor: z.boolean() })),\n\t\tflightdeckRootDir: z.string(),\n\t\tscripts: z.object({\n\t\t\tdownload: z.string(),\n\t\t\tinstall: z.string(),\n\t\t\tcheckAvailability: z.string(),\n\t\t}),\n\t\tjsonLogging: z.boolean().optional(),\n\t}),\n\toptions: {\n\t\tport: {\n\t\t\tflag: `p`,\n\t\t\trequired: false,\n\t\t\tdescription: `Port to run the flightdeck server on.`,\n\t\t\texample: `--port=8080`,\n\t\t\tparse: parseNumberOption,\n\t\t},\n\t\tpackageName: {\n\t\t\tflag: `n`,\n\t\t\trequired: true,\n\t\t\tdescription: `Name of the package.`,\n\t\t\texample: `--packageName=\\\"my-app\\\"`,\n\t\t},\n\t\tservices: {\n\t\t\tflag: `s`,\n\t\t\trequired: true,\n\t\t\tdescription: `Map of service names to executables.`,\n\t\t\texample: `--services=\"{\\\\\"frontend\\\\\":{\\\\\"run\\\\\":\\\\\"./frontend\\\\\",\\\\\"waitFor\\\\\":false},\\\\\"backend\\\\\":{\\\\\"run\\\\\":\\\\\"./backend\\\\\",\\\\\"waitFor\\\\\":true}}\"`,\n\t\t\tparse: JSON.parse,\n\t\t},\n\t\tflightdeckRootDir: {\n\t\t\tflag: `d`,\n\t\t\trequired: true,\n\t\t\tdescription: `Directory where the service is stored.`,\n\t\t\texample: `--flightdeckRootDir=\\\"./services/sample/repo/my-app/current\\\"`,\n\t\t},\n\t\tscripts: {\n\t\t\tflag: `r`,\n\t\t\trequired: true,\n\t\t\tdescription: `Map of scripts to run.`,\n\t\t\texample: `--scripts=\"{\\\\\"download\\\\\":\\\\\"npm i\",\\\\\"install\\\\\":\\\\\"npm run build\\\\\"}\"`,\n\t\t\tparse: JSON.parse,\n\t\t},\n\t\tjsonLogging: {\n\t\t\tflag: `j`,\n\t\t\trequired: false,\n\t\t\tdescription: `Enable json logging.`,\n\t\t\texample: `--jsonLogging`,\n\t\t\tparse: parseBooleanOption,\n\t\t},\n\t},\n} satisfies OptionsGroup<FlightDeckOptions>\n\nconst SCHEMA_MANUAL = {\n\toptionsSchema: z.object({\n\t\toutdir: z.string().optional(),\n\t}),\n\toptions: {\n\t\toutdir: {\n\t\t\tflag: `o`,\n\t\t\trequired: false,\n\t\t\tdescription: `Directory to write the schema to.`,\n\t\t\texample: `--outdir=./dist`,\n\t\t},\n\t},\n} satisfies OptionsGroup<{ outdir?: string | undefined }>\n\nconst parse = cli(\n\t{\n\t\tcliName: `flightdeck`,\n\t\troutes: optional({ schema: null, $configPath: null }),\n\t\trouteOptions: {\n\t\t\t\"\": FLIGHTDECK_MANUAL,\n\t\t\t$configPath: FLIGHTDECK_MANUAL,\n\t\t\tschema: SCHEMA_MANUAL,\n\t\t},\n\t\tdebugOutput: true,\n\t\tdiscoverConfigPath: (args) => {\n\t\t\tif (args[0] === `schema`) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst configPath =\n\t\t\t\targs[0] ?? path.join(process.cwd(), `flightdeck.config.json`)\n\t\t\treturn configPath\n\t\t},\n\t},\n\tconsole,\n)\n\nconst { inputs, writeJsonSchema } = parse(process.argv)\n\nswitch (inputs.case) {\n\tcase `schema`:\n\t\t{\n\t\t\tconst { outdir } = inputs.opts\n\t\t\twriteJsonSchema(outdir ?? `.`)\n\t\t}\n\t\tbreak\n\tdefault: {\n\t\tconst flightDeck = new FlightDeck(inputs.opts)\n\t\tprocess.on(`close`, async () => {\n\t\t\tawait flightDeck.stopAllServices()\n\t\t})\n\t}\n}\n"]}
1
+ {"version":3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AAAA,EACD,KAAK,CAAA,CAAA;AAAA,EACL,KAAK,CAAe,WAAA,CAAA,EAAA;AACnB,IAAA,MAAM,UAAa,GAAA,IAAI,UAAW,CAAA,MAAA,CAAO,IAAI,CAAA;AAC7C,IAAQ,OAAA,CAAA,EAAA,CAAG,SAAS,YAAY;AAC/B,MAAA,MAAM,WAAW,eAAgB,EAAA;AAAA,KACjC,CAAA;AAAA;AAEH","file":"flightdeck.x.js","sourcesContent":["#!/usr/bin/env node\n\nimport * as path from \"node:path\"\n\nimport type { OptionsGroup } from \"comline\"\nimport { cli, optional, parseBooleanOption, parseNumberOption } from \"comline\"\nimport { z } from \"zod\"\n\nimport type { FlightDeckOptions } from \"./flightdeck.lib\"\nimport { FlightDeck, FlightDeckLogger } from \"./flightdeck.lib\"\n\nconst CLI_LOGGER = new FlightDeckLogger(`comline`, process.pid, undefined, {\n\tjsonLogging: true,\n})\nObject.assign(console, {\n\tlog: CLI_LOGGER.info.bind(CLI_LOGGER),\n\tinfo: CLI_LOGGER.info.bind(CLI_LOGGER),\n\twarn: CLI_LOGGER.warn.bind(CLI_LOGGER),\n\terror: CLI_LOGGER.error.bind(CLI_LOGGER),\n})\n\nconst FLIGHTDECK_MANUAL = {\n\toptionsSchema: z.object({\n\t\tport: z.number().optional(),\n\t\tpackageName: z.string(),\n\t\tservices: z.record(z.object({ run: z.string(), waitFor: z.boolean() })),\n\t\tflightdeckRootDir: z.string(),\n\t\tscripts: z.object({\n\t\t\tdownload: z.string(),\n\t\t\tinstall: z.string(),\n\t\t\tcheckAvailability: z.string(),\n\t\t}),\n\t\tjsonLogging: z.boolean().optional(),\n\t}),\n\toptions: {\n\t\tport: {\n\t\t\tflag: `p`,\n\t\t\trequired: false,\n\t\t\tdescription: `Port to run the flightdeck server on.`,\n\t\t\texample: `--port=8080`,\n\t\t\tparse: parseNumberOption,\n\t\t},\n\t\tpackageName: {\n\t\t\tflag: `n`,\n\t\t\trequired: true,\n\t\t\tdescription: `Name of the package.`,\n\t\t\texample: `--packageName=\\\"my-app\\\"`,\n\t\t},\n\t\tservices: {\n\t\t\tflag: `s`,\n\t\t\trequired: true,\n\t\t\tdescription: `Map of service names to executables.`,\n\t\t\texample: `--services=\"{\\\\\"frontend\\\\\":{\\\\\"run\\\\\":\\\\\"./frontend\\\\\",\\\\\"waitFor\\\\\":false},\\\\\"backend\\\\\":{\\\\\"run\\\\\":\\\\\"./backend\\\\\",\\\\\"waitFor\\\\\":true}}\"`,\n\t\t\tparse: JSON.parse,\n\t\t},\n\t\tflightdeckRootDir: {\n\t\t\tflag: `d`,\n\t\t\trequired: true,\n\t\t\tdescription: `Directory where the service is stored.`,\n\t\t\texample: `--flightdeckRootDir=\\\"./services/sample/repo/my-app/current\\\"`,\n\t\t},\n\t\tscripts: {\n\t\t\tflag: `r`,\n\t\t\trequired: true,\n\t\t\tdescription: `Map of scripts to run.`,\n\t\t\texample: `--scripts=\"{\\\\\"download\\\\\":\\\\\"npm i\",\\\\\"install\\\\\":\\\\\"npm run build\\\\\"}\"`,\n\t\t\tparse: JSON.parse,\n\t\t},\n\t\tjsonLogging: {\n\t\t\tflag: `j`,\n\t\t\trequired: false,\n\t\t\tdescription: `Enable json logging.`,\n\t\t\texample: `--jsonLogging`,\n\t\t\tparse: parseBooleanOption,\n\t\t},\n\t},\n} satisfies OptionsGroup<FlightDeckOptions>\n\nconst SCHEMA_MANUAL = {\n\toptionsSchema: z.object({\n\t\toutdir: z.string().optional(),\n\t}),\n\toptions: {\n\t\toutdir: {\n\t\t\tflag: `o`,\n\t\t\trequired: false,\n\t\t\tdescription: `Directory to write the schema to.`,\n\t\t\texample: `--outdir=./dist`,\n\t\t},\n\t},\n} satisfies OptionsGroup<{ outdir?: string | undefined }>\n\nconst parse = cli(\n\t{\n\t\tcliName: `flightdeck`,\n\t\troutes: optional({ schema: null, $configPath: null }),\n\t\trouteOptions: {\n\t\t\t\"\": FLIGHTDECK_MANUAL,\n\t\t\t$configPath: FLIGHTDECK_MANUAL,\n\t\t\tschema: SCHEMA_MANUAL,\n\t\t},\n\t\tdebugOutput: true,\n\t\tdiscoverConfigPath: (args) => {\n\t\t\tif (args[0] === `schema`) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst configPath =\n\t\t\t\targs[0] ?? path.join(process.cwd(), `flightdeck.config.json`)\n\t\t\treturn configPath\n\t\t},\n\t},\n\tconsole,\n)\n\nconst { inputs, writeJsonSchema } = parse(process.argv)\n\nswitch (inputs.case) {\n\tcase `schema`:\n\t\t{\n\t\t\tconst { outdir } = inputs.opts\n\t\t\twriteJsonSchema(outdir ?? `.`)\n\t\t}\n\t\tbreak\n\tcase ``:\n\tcase `$configPath`: {\n\t\tconst flightDeck = new FlightDeck(inputs.opts)\n\t\tprocess.on(`close`, async () => {\n\t\t\tawait flightDeck.stopAllServices()\n\t\t})\n\t}\n}\n"]}
package/dist/lib.js CHANGED
@@ -1,4 +1,4 @@
1
- export { FLIGHTDECK_ERROR, FLIGHTDECK_INFO, FLIGHTDECK_LNAV_FORMAT, FLIGHTDECK_SETUP_PHASES, FLIGHTDECK_UPDATE_PHASES, FLIGHTDECK_WARN, FlightDeck, FlightDeckLogger, flightDeckLogSchema, isVersionNumber } from './chunk-7KMVUPT3.js';
1
+ export { FLIGHTDECK_ERROR, FLIGHTDECK_INFO, FLIGHTDECK_LNAV_FORMAT, FLIGHTDECK_SETUP_PHASES, FLIGHTDECK_UPDATE_PHASES, FLIGHTDECK_WARN, FlightDeck, FlightDeckLogger, flightDeckLogSchema, isVersionNumber } from './chunk-D4EVARJP.js';
2
2
  export { klaxon_lib_exports as Klaxon } from './chunk-ZID4FJKY.js';
3
3
  import './chunk-PZ5AY32C.js';
4
4
  //# sourceMappingURL=lib.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flightdeck",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Jeremy Banka",
@@ -30,7 +30,7 @@
30
30
  "@t3-oss/env-core": "0.12.0",
31
31
  "cron": "4.1.0",
32
32
  "zod": "3.24.2",
33
- "atom.io": "0.32.0",
33
+ "atom.io": "0.32.2",
34
34
  "comline": "0.1.9",
35
35
  "safedeposit": "0.1.0"
36
36
  },
@@ -39,13 +39,13 @@
39
39
  "@biomejs/wasm-nodejs": "1.9.4",
40
40
  "@types/node": "22.13.5",
41
41
  "@types/tmp": "0.2.6",
42
- "bun-types": "1.2.3",
42
+ "bun-types": "1.2.4",
43
43
  "concurrently": "9.1.2",
44
44
  "eslint": "9.21.0",
45
45
  "json-schema-to-zod": "2.6.0",
46
46
  "rimraf": "6.0.1",
47
47
  "tmp": "0.2.3",
48
- "tsup": "8.3.6",
48
+ "tsup": "8.4.0",
49
49
  "vitest": "3.0.7",
50
50
  "varmint": "0.4.2"
51
51
  },
@@ -44,6 +44,7 @@ export type FlightDeckOptions<S extends string = string> = {
44
44
  }
45
45
 
46
46
  export class FlightDeck<S extends string = string> {
47
+ public readonly options: FlightDeckOptions<S>
47
48
  protected safety = 0
48
49
 
49
50
  protected storage: FilesystemStorage<{
@@ -77,7 +78,8 @@ export class FlightDeck<S extends string = string> {
77
78
 
78
79
  protected restartTimes: number[] = []
79
80
 
80
- public constructor(public readonly options: FlightDeckOptions<S>) {
81
+ public constructor(options: FlightDeckOptions<S>) {
82
+ this.options = options
81
83
  const { FLIGHTDECK_SECRET } = env
82
84
  const { flightdeckRootDir = resolve(homedir(), `.flightdeck`) } = options
83
85
  const port = options.port ?? 8080
@@ -121,7 +121,8 @@ switch (inputs.case) {
121
121
  writeJsonSchema(outdir ?? `.`)
122
122
  }
123
123
  break
124
- default: {
124
+ case ``:
125
+ case `$configPath`: {
125
126
  const flightDeck = new FlightDeck(inputs.opts)
126
127
  process.on(`close`, async () => {
127
128
  await flightDeck.stopAllServices()