@platformatic/node 2.59.0 → 2.60.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/config.d.ts CHANGED
@@ -40,6 +40,14 @@ export interface PlatformaticNodeJsStackable {
40
40
  [k: string]: unknown;
41
41
  };
42
42
  };
43
+ formatters?: {
44
+ path: string;
45
+ };
46
+ timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
47
+ redact?: {
48
+ paths: string[];
49
+ censor?: string;
50
+ };
43
51
  [k: string]: unknown;
44
52
  };
45
53
  server?: {
package/index.js CHANGED
@@ -300,7 +300,6 @@ export class NodeStackable extends BaseStackable {
300
300
 
301
301
  async _findEntrypoint () {
302
302
  const config = this.configManager.current
303
- const outputRoot = resolve(this.root, config.application.outputDirectory)
304
303
 
305
304
  if (config.node.main) {
306
305
  return pathResolve(this.root, config.node.main)
@@ -324,19 +323,7 @@ export class NodeStackable extends BaseStackable {
324
323
  }
325
324
  }
326
325
 
327
- let root = this.root
328
-
329
- if (this.isProduction) {
330
- const hasCommand = this.configManager.current.application.commands.build
331
- const hasBuildScript = await this.#hasBuildScript()
332
-
333
- if (hasCommand || hasBuildScript) {
334
- this.verifyOutputDirectory(outputRoot)
335
- root = outputRoot
336
- }
337
- }
338
-
339
- return pathResolve(root, entrypoint)
326
+ return pathResolve(this.root, entrypoint)
340
327
  }
341
328
 
342
329
  async #hasBuildScript () {
package/lib/schema.js CHANGED
@@ -28,6 +28,43 @@ const node = {
28
28
  additionalProperties: false
29
29
  }
30
30
 
31
+ const logger = utilsSchemaComponents.logger
32
+
33
+ logger.properties = {
34
+ ...logger.properties,
35
+ formatters: {
36
+ type: 'object',
37
+ properties: {
38
+ path: {
39
+ type: 'string',
40
+ resolvePath: true
41
+ }
42
+ },
43
+ required: ['path'],
44
+ additionalProperties: false
45
+ },
46
+
47
+ timestamp: {
48
+ enum: ['epochTime', 'unixTime', 'nullTime', 'isoTime']
49
+ },
50
+
51
+ redact: {
52
+ type: 'object',
53
+ properties: {
54
+ paths: {
55
+ type: 'array',
56
+ items: { type: 'string' }
57
+ },
58
+ censor: {
59
+ type: 'string',
60
+ default: '[redacted]'
61
+ }
62
+ },
63
+ required: ['paths'],
64
+ additionalProperties: false
65
+ }
66
+ }
67
+
31
68
  export const schemaComponents = { node }
32
69
 
33
70
  export const schema = {
@@ -39,7 +76,7 @@ export const schema = {
39
76
  $schema: {
40
77
  type: 'string'
41
78
  },
42
- logger: utilsSchemaComponents.logger,
79
+ logger,
43
80
  server: utilsSchemaComponents.server,
44
81
  watch: basicSchemaComponents.watch,
45
82
  application: basicSchemaComponents.application,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/node",
3
- "version": "2.59.0",
3
+ "version": "2.60.0",
4
4
  "description": "Platformatic Node.js Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,9 +17,9 @@
17
17
  "dependencies": {
18
18
  "json5": "^2.2.3",
19
19
  "light-my-request": "^6.0.0",
20
- "@platformatic/config": "2.59.0",
21
- "@platformatic/basic": "2.59.0",
22
- "@platformatic/utils": "2.59.0"
20
+ "@platformatic/basic": "2.60.0",
21
+ "@platformatic/utils": "2.60.0",
22
+ "@platformatic/config": "2.60.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "borp": "^0.19.0",
@@ -31,12 +31,12 @@
31
31
  "neostandard": "^0.12.0",
32
32
  "tsx": "^4.19.0",
33
33
  "typescript": "^5.5.4",
34
- "@platformatic/service": "2.59.0",
35
- "@platformatic/composer": "2.59.0"
34
+ "@platformatic/composer": "2.60.0",
35
+ "@platformatic/service": "2.60.0"
36
36
  },
37
37
  "scripts": {
38
- "test": "npm run lint && borp --concurrency=1 --no-timeout",
39
- "coverage": "npm run lint && borp -C -X test -X test/fixtures --concurrency=1 --no-timeout",
38
+ "test": "pnpm run lint && borp --concurrency=1 --no-timeout",
39
+ "coverage": "pnpm run lint && borp -C -X test -X test/fixtures --concurrency=1 --no-timeout",
40
40
  "gen-schema": "node lib/schema.js > schema.json",
41
41
  "gen-types": "json2ts > config.d.ts < schema.json",
42
42
  "build": "pnpm run gen-schema && pnpm run gen-types",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/node/2.59.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/node/2.60.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Node.js Stackable",
5
5
  "type": "object",
@@ -95,6 +95,46 @@
95
95
  }
96
96
  },
97
97
  "additionalProperties": false
98
+ },
99
+ "formatters": {
100
+ "type": "object",
101
+ "properties": {
102
+ "path": {
103
+ "type": "string",
104
+ "resolvePath": true
105
+ }
106
+ },
107
+ "required": [
108
+ "path"
109
+ ],
110
+ "additionalProperties": false
111
+ },
112
+ "timestamp": {
113
+ "enum": [
114
+ "epochTime",
115
+ "unixTime",
116
+ "nullTime",
117
+ "isoTime"
118
+ ]
119
+ },
120
+ "redact": {
121
+ "type": "object",
122
+ "properties": {
123
+ "paths": {
124
+ "type": "array",
125
+ "items": {
126
+ "type": "string"
127
+ }
128
+ },
129
+ "censor": {
130
+ "type": "string",
131
+ "default": "[redacted]"
132
+ }
133
+ },
134
+ "required": [
135
+ "paths"
136
+ ],
137
+ "additionalProperties": false
98
138
  }
99
139
  },
100
140
  "required": [