@platformatic/service 0.28.1 → 0.30.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.
Files changed (44) hide show
  1. package/fixtures/hello-client-ts/tsconfig.json +3 -2
  2. package/fixtures/hello-client-ts-without-deps/hello.d.ts +34 -0
  3. package/fixtures/hello-client-ts-without-deps/hello.openapi.json +22 -0
  4. package/fixtures/hello-client-ts-without-deps/platformatic.service.json +23 -0
  5. package/fixtures/hello-client-ts-without-deps/plugin.ts +8 -0
  6. package/fixtures/hello-client-ts-without-deps/tsconfig.json +22 -0
  7. package/fixtures/hello-client-without-deps/hello.d.ts +34 -0
  8. package/fixtures/hello-client-without-deps/hello.openapi.json +22 -0
  9. package/fixtures/hello-client-without-deps/platformatic.service.json +21 -0
  10. package/fixtures/hello-client-without-deps/plugin.js +8 -0
  11. package/help/compile.txt +2 -1
  12. package/index.js +9 -1
  13. package/lib/compile.js +14 -11
  14. package/lib/plugins/clients.js +7 -3
  15. package/lib/plugins/plugins.js +20 -8
  16. package/lib/schema.js +50 -4
  17. package/package.json +6 -6
  18. package/test/cli/compile-1.test.mjs +500 -0
  19. package/test/cli/{compile.test.mjs → compile-2.test.mjs} +173 -149
  20. package/test/cli/helper.mjs +15 -0
  21. package/test/cli/tap-parallel-not-ok +0 -0
  22. package/test/clients.test.js +27 -2
  23. package/test/fixtures/bad-typescript-plugin/platformatic.service.json +1 -1
  24. package/test/fixtures/bad-typescript-plugin/tsconfig.json +1 -1
  25. package/test/fixtures/typescript-autoload/tsconfig.json +3 -3
  26. package/test/fixtures/typescript-compiled/compiled/plugin.js +6 -0
  27. package/test/fixtures/typescript-compiled/platformatic.service.json +18 -0
  28. package/test/fixtures/typescript-plugin-custom-flags/platformatic.service.json +18 -0
  29. package/test/fixtures/typescript-plugin-custom-flags/plugin.ts +5 -0
  30. package/test/fixtures/typescript-plugin-custom-flags/tsconfig.json +22 -0
  31. package/test/fixtures/typescript-plugin-custom-tsconfig/a-config-for-ts.json +22 -0
  32. package/test/fixtures/typescript-plugin-custom-tsconfig/platformatic.service.json +18 -0
  33. package/test/fixtures/typescript-plugin-custom-tsconfig/plugin.ts +5 -0
  34. package/test/fixtures/typescript-plugin-nocompile/tsconfig.json +3 -3
  35. package/test/fixtures/typescript-plugin-nocompile-enabled/platformatic.service.json +18 -0
  36. package/test/fixtures/typescript-plugin-nocompile-enabled/plugin.ts +5 -0
  37. package/test/fixtures/typescript-plugin-nocompile-enabled/tsconfig.json +22 -0
  38. package/test/fixtures/typescript-plugin-nocompile-string/platformatic.service.json +16 -0
  39. package/test/fixtures/typescript-plugin-nocompile-string/plugin.ts +5 -0
  40. package/test/fixtures/typescript-plugin-nocompile-string/tsconfig.json +22 -0
  41. package/test/fixtures/typescript-plugin-string/platformatic.service.json +16 -0
  42. package/test/fixtures/typescript-plugin-string/plugin.ts +5 -0
  43. package/test/fixtures/typescript-plugin-string/tsconfig.json +22 -0
  44. package/test/tap-parallel-ok +0 -0
@@ -0,0 +1,18 @@
1
+ {
2
+ "server": {
3
+ "logger": {
4
+ "level": "info"
5
+ },
6
+ "hostname": "127.0.0.1",
7
+ "port": "0",
8
+ "pluginTimeout": 60000,
9
+ "keepAliveTimeout": 1
10
+ },
11
+ "plugins": {
12
+ "paths": ["plugin.ts"],
13
+ "typescript": {
14
+ "tsConfig": "./a-config-for-ts.json"
15
+ }
16
+ },
17
+ "watch": false
18
+ }
@@ -0,0 +1,5 @@
1
+ import { FastifyInstance } from 'fastify'
2
+
3
+ export default async function (app: FastifyInstance) {
4
+ app.log.info('Typescript plugin loaded')
5
+ }
@@ -2,10 +2,10 @@
2
2
  "compilerOptions": {
3
3
  "module": "commonjs",
4
4
  "esModuleInterop": true,
5
- "target": "es6",
5
+ "target": "es2020",
6
6
  "moduleResolution": "node",
7
- "sourceMap": true,
8
- "pretty": true,
7
+ "sourceMap": false,
8
+ "pretty": false,
9
9
  "noEmitOnError": true,
10
10
  "outDir": "dist"
11
11
  },
@@ -0,0 +1,18 @@
1
+ {
2
+ "server": {
3
+ "logger": {
4
+ "level": "info"
5
+ },
6
+ "hostname": "127.0.0.1",
7
+ "port": "0",
8
+ "pluginTimeout": 60000,
9
+ "keepAliveTimeout": 1
10
+ },
11
+ "plugins": {
12
+ "paths": ["plugin.ts"],
13
+ "typescript": {
14
+ "enabled": "false"
15
+ }
16
+ },
17
+ "watch": false
18
+ }
@@ -0,0 +1,5 @@
1
+ import { FastifyInstance } from 'fastify'
2
+
3
+ export default async function (app: FastifyInstance) {
4
+ app.log.info('Typescript plugin loaded')
5
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "esModuleInterop": true,
5
+ "target": "es2020",
6
+ "moduleResolution": "node",
7
+ "sourceMap": false,
8
+ "pretty": false,
9
+ "noEmitOnError": true,
10
+ "outDir": "dist"
11
+ },
12
+ "watchOptions": {
13
+ "watchFile": "fixedPollingInterval",
14
+ "watchDirectory": "fixedPollingInterval",
15
+ "fallbackPolling": "dynamicPriority",
16
+ "synchronousWatchDirectory": true,
17
+ "excludeDirectories": [
18
+ "**/node_modules",
19
+ "dist"
20
+ ]
21
+ }
22
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "server": {
3
+ "logger": {
4
+ "level": "info"
5
+ },
6
+ "hostname": "127.0.0.1",
7
+ "port": "0",
8
+ "pluginTimeout": 60000,
9
+ "keepAliveTimeout": 1
10
+ },
11
+ "plugins": {
12
+ "paths": ["plugin.ts"],
13
+ "typescript": "false"
14
+ },
15
+ "watch": false
16
+ }
@@ -0,0 +1,5 @@
1
+ import { FastifyInstance } from 'fastify'
2
+
3
+ export default async function (app: FastifyInstance) {
4
+ app.log.info('Typescript plugin loaded')
5
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "esModuleInterop": true,
5
+ "target": "es6",
6
+ "moduleResolution": "node",
7
+ "sourceMap": true,
8
+ "pretty": true,
9
+ "noEmitOnError": true,
10
+ "outDir": "dist"
11
+ },
12
+ "watchOptions": {
13
+ "watchFile": "fixedPollingInterval",
14
+ "watchDirectory": "fixedPollingInterval",
15
+ "fallbackPolling": "dynamicPriority",
16
+ "synchronousWatchDirectory": true,
17
+ "excludeDirectories": [
18
+ "**/node_modules",
19
+ "dist"
20
+ ]
21
+ }
22
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "server": {
3
+ "logger": {
4
+ "level": "info"
5
+ },
6
+ "hostname": "127.0.0.1",
7
+ "port": "0",
8
+ "pluginTimeout": 60000,
9
+ "keepAliveTimeout": 1
10
+ },
11
+ "plugins": {
12
+ "paths": ["plugin.ts"],
13
+ "typescript": "true"
14
+ },
15
+ "watch": false
16
+ }
@@ -0,0 +1,5 @@
1
+ import { FastifyInstance } from 'fastify'
2
+
3
+ export default async function (app: FastifyInstance) {
4
+ app.log.info('Typescript plugin loaded')
5
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "esModuleInterop": true,
5
+ "target": "es2020",
6
+ "moduleResolution": "node",
7
+ "sourceMap": false,
8
+ "pretty": false,
9
+ "noEmitOnError": true,
10
+ "outDir": "dist"
11
+ },
12
+ "watchOptions": {
13
+ "watchFile": "fixedPollingInterval",
14
+ "watchDirectory": "fixedPollingInterval",
15
+ "fallbackPolling": "dynamicPriority",
16
+ "synchronousWatchDirectory": true,
17
+ "excludeDirectories": [
18
+ "**/node_modules",
19
+ "dist"
20
+ ]
21
+ }
22
+ }
File without changes