@platformatic/composer 3.0.0-alpha.5 → 3.0.0-alpha.6

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.
Files changed (49) hide show
  1. package/LICENSE +1 -1
  2. package/eslint.config.js +1 -8
  3. package/index.d.ts +1 -58
  4. package/index.js +9 -30
  5. package/package.json +8 -54
  6. package/schema.json +1136 -907
  7. package/scripts/schema.js +12 -0
  8. package/config.d.ts +0 -997
  9. package/lib/application.js +0 -186
  10. package/lib/commands/index.js +0 -15
  11. package/lib/commands/openapi-fetch-schemas.js +0 -47
  12. package/lib/composer-hook.js +0 -60
  13. package/lib/errors.js +0 -18
  14. package/lib/generator.js +0 -127
  15. package/lib/graphql-fetch.js +0 -83
  16. package/lib/graphql-generator.js +0 -33
  17. package/lib/graphql.js +0 -24
  18. package/lib/metrics.js +0 -12
  19. package/lib/not-host-constraints.js +0 -31
  20. package/lib/openapi-composer.js +0 -101
  21. package/lib/openapi-config-schema.js +0 -89
  22. package/lib/openapi-generator.js +0 -213
  23. package/lib/openapi-load-config.js +0 -31
  24. package/lib/openapi-modifier.js +0 -128
  25. package/lib/openapi-scalar.js +0 -22
  26. package/lib/proxy.js +0 -265
  27. package/lib/root.js +0 -75
  28. package/lib/schema.js +0 -258
  29. package/lib/stackable.js +0 -88
  30. package/lib/upgrade.js +0 -20
  31. package/lib/utils.js +0 -16
  32. package/lib/versions/2.0.0.js +0 -9
  33. package/lib/versions/3.0.0.js +0 -14
  34. package/public/images/dark_mode.svg +0 -3
  35. package/public/images/ellipse.svg +0 -21
  36. package/public/images/external-link.svg +0 -5
  37. package/public/images/favicon.ico +0 -0
  38. package/public/images/graphiql.svg +0 -10
  39. package/public/images/graphql.svg +0 -10
  40. package/public/images/light_mode.svg +0 -11
  41. package/public/images/openapi.svg +0 -13
  42. package/public/images/platformatic-logo-dark.svg +0 -30
  43. package/public/images/platformatic-logo-light.svg +0 -30
  44. package/public/images/reverse-proxy.svg +0 -8
  45. package/public/images/triangle_dark.svg +0 -3
  46. package/public/images/triangle_light.svg +0 -3
  47. package/public/index.html +0 -253
  48. package/public/index.njk +0 -101
  49. package/public/main.css +0 -244
package/LICENSE CHANGED
@@ -136,7 +136,7 @@
136
136
  with Licensor regarding such Contributions.
137
137
 
138
138
  6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
139
+ names, trademarks, application marks, or product names of the Licensor,
140
140
  except as required for reasonable and customary use in describing the
141
141
  origin of the Work and reproducing the content of the NOTICE file.
142
142
 
package/eslint.config.js CHANGED
@@ -1,12 +1,5 @@
1
1
  import neostandard from 'neostandard'
2
2
 
3
3
  export default neostandard({
4
- ts: true,
5
- ignores: [
6
- ...neostandard.resolveIgnoresFromGitignore(),
7
- 'test/tmp/**/*',
8
- 'test/fixtures/*/dist/**/*',
9
- '**/dist/*',
10
- 'tmp/**/*'
11
- ]
4
+ ts: true
12
5
  })
package/index.d.ts CHANGED
@@ -1,58 +1 @@
1
- import { BaseStackable } from '@platformatic/basic'
2
- import { BaseGenerator } from '@platformatic/generators'
3
- import {
4
- Configuration,
5
- ConfigurationOptions,
6
- ServerInstance as ServiceInstance,
7
- ServiceStackable
8
- } from '@platformatic/service'
9
- import { JSONSchemaType } from 'ajv'
10
- import { FastifyError, FastifyInstance } from 'fastify'
11
- import { PlatformaticComposerConfig } from './config'
12
-
13
- export { PlatformaticApplication } from '@platformatic/service'
14
- export { PlatformaticComposerConfig } from './config'
15
-
16
- export type ComposerStackable = ServiceStackable<PlatformaticComposerConfig>
17
-
18
- export type ServerInstance = ServiceInstance<PlatformaticComposerConfig>
19
-
20
- type ComposerConfiguration = Configuration<PlatformaticComposerConfig>
21
-
22
- export declare function loadConfiguration (
23
- root: string | PlatformaticServiceConfig,
24
- source?: string | PlatformaticServiceConfig,
25
- context?: ConfigurationOptions
26
- ): Promise<ComposerConfiguration>
27
-
28
- export function create (
29
- root: string,
30
- source?: string | PlatformaticComposerConfig,
31
- context?: ConfigurationOptions
32
- ): Promise<ComposerStackable>
33
-
34
- export declare function platformaticComposer (app: FastifyInstance, stackable: BaseStackable): Promise<void>
35
-
36
- export class Generator extends BaseGenerator.BaseGenerator {}
37
-
38
- export declare const packageJson: Record<string, unknown>
39
-
40
- export declare const schema: JSONSchemaType<PlatformaticComposerConfig>
41
-
42
- export declare const schemaComponents: {
43
- openApiService: JSONSchemaType<object>
44
- entityResolver: JSONSchemaType<object>
45
- entities: JSONSchemaType<object>
46
- graphqlService: JSONSchemaType<object>
47
- graphqlComposerOptions: JSONSchemaType<object>
48
- composer: JSONSchemaType<object>
49
- types: JSONSchemaType<object>
50
- }
51
-
52
- export declare const version: string
53
-
54
- export function FastifyInstanceIsAlreadyListeningError (): FastifyError
55
- export function FailedToFetchOpenAPISchemaError (): FastifyError
56
- export function ValidationErrors (): FastifyError
57
- export function PathAlreadyExistsError (): FastifyError
58
- export function CouldNotReadOpenAPIConfigError (): FastifyError
1
+ export * from '@platformatic/gateway'
package/index.js CHANGED
@@ -1,34 +1,13 @@
1
- import { resolve, validationOptions } from '@platformatic/basic'
2
- import { kMetadata, loadConfiguration as utilsLoadConfiguration } from '@platformatic/foundation'
3
- import { transform } from '@platformatic/service'
4
- import { schema } from './lib/schema.js'
5
- import { ComposerStackable } from './lib/stackable.js'
6
- import { upgrade } from './lib/upgrade.js'
1
+ import { create as createGateway } from '@platformatic/gateway'
7
2
 
8
- export async function loadConfiguration (configOrRoot, sourceOrConfig, context) {
9
- const { root, source } = await resolve(configOrRoot, sourceOrConfig, 'composer')
10
-
11
- return utilsLoadConfiguration(source, context?.schema ?? schema, {
12
- validationOptions,
13
- transform,
14
- upgrade,
15
- replaceEnv: true,
16
- root,
17
- ...context
18
- })
19
- }
3
+ // eslint-disable-next-line import-x/export
4
+ export * from '@platformatic/gateway'
20
5
 
6
+ // eslint-disable-next-line import-x/export
21
7
  export async function create (configOrRoot, sourceOrConfig, context) {
22
- const config = await loadConfiguration(configOrRoot, sourceOrConfig, context)
23
- return new ComposerStackable(config[kMetadata].root, config, context)
24
- }
8
+ globalThis.platformatic.logger.warn(
9
+ '@platformatic/composer is deprecated and it will be removed in version 4.0.0, please migrate to @platformatic/gateway.'
10
+ )
25
11
 
26
- export const skipTelemetryHooks = true
27
-
28
- export { platformaticComposer } from './lib/application.js'
29
- export * from './lib/commands/index.js'
30
- export * from './lib/errors.js'
31
- export * as errors from './lib/errors.js'
32
- export { Generator } from './lib/generator.js'
33
- export { packageJson, schema, schemaComponents, version } from './lib/schema.js'
34
- export { ComposerStackable } from './lib/stackable.js'
12
+ return createGateway(configOrRoot, sourceOrConfig, context)
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/composer",
3
- "version": "3.0.0-alpha.5",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -16,68 +16,22 @@
16
16
  },
17
17
  "homepage": "https://github.com/platformatic/platformatic#readme",
18
18
  "devDependencies": {
19
- "borp": "^0.20.0",
20
19
  "c8": "^10.0.0",
21
- "dedent": "^1.5.1",
20
+ "cleaner-spec-reporter": "^0.5.0",
22
21
  "eslint": "9",
23
- "json-schema-to-typescript": "^15.0.0",
24
- "neostandard": "^0.12.0",
25
- "openapi-schema-validator": "^12.1.3",
26
- "pino-test": "^1.0.1",
27
- "prom-client": "^15.1.2",
28
- "self-cert": "^2.0.0",
29
- "single-user-cache": "^1.0.1",
30
- "split2": "^4.2.0",
31
- "tsd": "^0.32.0",
32
- "typescript": "^5.5.4",
33
- "why-is-node-running": "2",
34
- "ws": "^8.16.0",
35
- "@platformatic/db": "3.0.0-alpha.5",
36
- "@platformatic/client": "3.0.0-alpha.5"
22
+ "neostandard": "^0.12.0"
37
23
  },
38
24
  "dependencies": {
39
- "@fastify/error": "^4.0.0",
40
- "@fastify/http-proxy": "^11.3.0",
41
- "@fastify/reply-from": "^12.0.0",
42
- "@fastify/static": "^8.0.0",
43
- "@fastify/swagger": "^9.0.0",
44
- "@fastify/view": "^10.0.1",
45
- "@platformatic/fastify-openapi-glue": "^5.1.0",
46
- "@platformatic/graphql-composer": "^0.10.0",
47
- "@scalar/fastify-api-reference": "1.33.0",
48
- "ajv": "^8.12.0",
49
- "console-table-printer": "^2.12.0",
50
- "execa": "^9.0.0",
51
- "fast-deep-equal": "^3.1.3",
52
- "fastify": "^5.0.0",
53
- "fastify-plugin": "^5.0.0",
54
- "graphql": "^16.8.1",
55
- "help-me": "^5.0.0",
56
- "json-schema-traverse": "^1.0.0",
57
- "mercurius": "^16.0.0",
58
- "minimist": "^1.2.8",
59
- "my-ua-parser": "^2.0.2",
60
- "nunjucks": "^3.2.4",
61
- "ora": "^6.3.1",
62
- "pino": "^9.9.0",
63
- "pino-pretty": "^13.0.0",
64
- "rfdc": "^1.3.1",
65
- "semgrator": "^0.3.0",
66
- "undici": "^7.0.0",
67
- "@platformatic/basic": "3.0.0-alpha.5",
68
- "@platformatic/service": "3.0.0-alpha.5",
69
- "@platformatic/scalar-theme": "3.0.0-alpha.5",
70
- "@platformatic/telemetry": "3.0.0-alpha.5",
71
- "@platformatic/foundation": "^3.0.0-alpha.5"
25
+ "@platformatic/foundation": "3.0.0-alpha.6",
26
+ "@platformatic/gateway": "3.0.0-alpha.6"
72
27
  },
73
28
  "engines": {
74
29
  "node": ">=22.18.0"
75
30
  },
76
31
  "scripts": {
77
- "test": "pnpm run lint && borp -T --timeout 1200000 -c 1",
78
- "gen-schema": "node lib/schema.js > schema.json",
79
- "gen-types": "json2ts > config.d.ts < schema.json",
80
- "build": "pnpm run gen-schema && pnpm run gen-types",
32
+ "test": "node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js",
33
+ "prebuild": "cd ../gateway && pnpm run build",
34
+ "build": "node scripts/schema.js",
81
35
  "lint": "eslint"
82
36
  }
83
37
  }