@platformatic/foundation 3.41.0 → 3.43.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/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { FastifyError } from '@fastify/error'
2
2
  import { JSONSchemaType } from 'ajv'
3
3
  import { EventEmitter } from 'node:events'
4
- import { Logger } from 'pino'
4
+ import { ParseArgsOptionsConfig } from 'node:util'
5
+ import { LevelWithSilentOrString, Logger } from 'pino'
5
6
 
6
7
  // Symbols
7
8
  export declare const kCanceled: unique symbol
@@ -10,6 +11,58 @@ export declare const kHandledError: unique symbol
10
11
  export declare const kMetadata: unique symbol
11
12
  export declare const kTimeout: unique symbol
12
13
 
14
+ // Cli types
15
+ export function createCLIContext<T = {}>(
16
+ executableId?: string,
17
+ executableName?: string,
18
+ verbose?: boolean,
19
+ prettyPrint?: boolean,
20
+ options?: T
21
+ ): {
22
+ executableId: string
23
+ executableName: string
24
+ verbose: boolean
25
+ prettyPrint: boolean
26
+ } & T
27
+
28
+ export function logo(color?: boolean, name?: string): string
29
+
30
+ export function createCliLogger(level: LevelWithSilentOrString, noPretty: boolean): Logger
31
+
32
+ export function logFatalError(logger: Logger, ...args: any[]): false
33
+
34
+ export function parseArgs(
35
+ args: string[],
36
+ options: ParseArgsOptionsConfig,
37
+ stopAtFirstPositional?: boolean,
38
+ strict?: boolean
39
+ ): {
40
+ values: Record<string, any>
41
+ positionals: string[]
42
+ unparsed: string[]
43
+ tokens: any[]
44
+ }
45
+
46
+ export function getRoot(positionals?: string[]): string
47
+
48
+ export function applicationToEnvVariable(application: string): string
49
+
50
+ export function findRuntimeConfigurationFile(
51
+ logger: Logger,
52
+ root: string,
53
+ configurationFile?: string,
54
+ fallback?: boolean,
55
+ throwOnError?: boolean,
56
+ verifyPackages?: boolean,
57
+ executableName?: string
58
+ ): Promise<string | false | undefined>
59
+
60
+ export function fallbackToTemporaryConfigFile(
61
+ logger: Logger,
62
+ root: string,
63
+ verifyPackages: boolean
64
+ ): Promise<string | false | undefined>
65
+
13
66
  // Configuration types
14
67
  export declare const envVariablePattern: RegExp
15
68
  export declare const knownConfigurationFilesExtensions: string[]
package/lib/schema.js CHANGED
@@ -1409,6 +1409,9 @@ export const runtimeProperties = {
1409
1409
  default: 'external'
1410
1410
  },
1411
1411
  env,
1412
+ envfile: {
1413
+ type: 'string'
1414
+ },
1412
1415
  sourceMaps: {
1413
1416
  type: 'boolean',
1414
1417
  default: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/foundation",
3
- "version": "3.41.0",
3
+ "version": "3.43.0",
4
4
  "description": "Platformatic Foundation",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "pino": "^9.9.0",
31
31
  "pino-pretty": "^13.0.0",
32
32
  "semver": "^7.6.3",
33
- "undici": "7.18.2",
33
+ "undici": "7.24.0",
34
34
  "yaml": "^2.4.1"
35
35
  },
36
36
  "devDependencies": {
@@ -41,13 +41,15 @@
41
41
  "neostandard": "^0.12.0",
42
42
  "pino": "^9.9.0",
43
43
  "pino-test": "^1.0.1",
44
+ "tstyche": "^6.2.0",
44
45
  "typescript": "^5.5.4"
45
46
  },
46
47
  "engines": {
47
48
  "node": ">=22.19.0"
48
49
  },
49
50
  "scripts": {
50
- "test": "node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
51
+ "test": "npm run test:types && node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
52
+ "test:types": "tstyche",
51
53
  "lint": "eslint"
52
54
  }
53
55
  }