@platformatic/nuxt 0.0.1 → 3.58.1
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/LICENSE +201 -0
- package/README.md +26 -0
- package/config.d.ts +749 -0
- package/eslint.config.js +3 -0
- package/index.d.ts +35 -0
- package/index.js +31 -0
- package/lib/capability.js +255 -0
- package/lib/schema.js +50 -0
- package/package.json +39 -18
- package/schema.json +2805 -0
- package/test/backlog.test.js +88 -0
- package/test/development.test.js +216 -0
- package/test/fetch.test.js +67 -0
- package/test/fixtures/composer-autodetect-prefix/package.json +10 -0
- package/test/fixtures/composer-autodetect-prefix/platformatic.runtime.json +24 -0
- package/test/fixtures/composer-autodetect-prefix/services/frontend/app.vue +8 -0
- package/test/fixtures/composer-autodetect-prefix/services/frontend/nuxt.config.js +16 -0
- package/test/fixtures/composer-autodetect-prefix/services/frontend/package.json +9 -0
- package/test/fixtures/composer-autodetect-prefix/services/frontend/platformatic.application.json +6 -0
- package/test/fixtures/composer-custom-commands/package.json +11 -0
- package/test/fixtures/composer-custom-commands/platformatic.runtime.json +24 -0
- package/test/fixtures/composer-custom-commands/services/frontend/app.vue +8 -0
- package/test/fixtures/composer-custom-commands/services/frontend/nuxt.config.js +16 -0
- package/test/fixtures/composer-custom-commands/services/frontend/package.json +16 -0
- package/test/fixtures/composer-custom-commands/services/frontend/platformatic.application.json +11 -0
- package/test/fixtures/composer-with-prefix/package.json +10 -0
- package/test/fixtures/composer-with-prefix/platformatic.runtime.json +24 -0
- package/test/fixtures/composer-with-prefix/services/frontend/app.vue +8 -0
- package/test/fixtures/composer-with-prefix/services/frontend/nuxt.config.js +16 -0
- package/test/fixtures/composer-with-prefix/services/frontend/package.json +9 -0
- package/test/fixtures/composer-with-prefix/services/frontend/platformatic.application.json +6 -0
- package/test/fixtures/composer-without-prefix/package.json +10 -0
- package/test/fixtures/composer-without-prefix/platformatic.runtime.json +24 -0
- package/test/fixtures/composer-without-prefix/services/frontend/app.vue +8 -0
- package/test/fixtures/composer-without-prefix/services/frontend/nuxt.config.js +13 -0
- package/test/fixtures/composer-without-prefix/services/frontend/package.json +9 -0
- package/test/fixtures/composer-without-prefix/services/frontend/platformatic.application.json +3 -0
- package/test/fixtures/fetch-test/package.json +10 -0
- package/test/fixtures/fetch-test/platformatic.runtime.json +24 -0
- package/test/fixtures/fetch-test/services/frontend/app.vue +29 -0
- package/test/fixtures/fetch-test/services/frontend/nuxt.config.js +15 -0
- package/test/fixtures/fetch-test/services/frontend/package.json +9 -0
- package/test/fixtures/fetch-test/services/frontend/platformatic.application.json +6 -0
- package/test/fixtures/logger/package.json +8 -0
- package/test/fixtures/logger/platformatic.runtime.json +15 -0
- package/test/fixtures/logger/services/frontend/app.vue +12 -0
- package/test/fixtures/logger/services/frontend/logger-formatters.js +7 -0
- package/test/fixtures/logger/services/frontend/nuxt.config.js +12 -0
- package/test/fixtures/logger/services/frontend/package.json +9 -0
- package/test/fixtures/logger/services/frontend/platformatic.application.json +14 -0
- package/test/fixtures/metrics/package.json +10 -0
- package/test/fixtures/metrics/platformatic.runtime.json +25 -0
- package/test/fixtures/metrics/services/backend/package.json +6 -0
- package/test/fixtures/metrics/services/backend/platformatic.json +16 -0
- package/test/fixtures/metrics/services/backend/plugins/example.js +3 -0
- package/test/fixtures/metrics/services/backend/routes/root.js +30 -0
- package/test/fixtures/metrics/services/composer/package.json +6 -0
- package/test/fixtures/metrics/services/composer/platformatic.json +14 -0
- package/test/fixtures/metrics/services/frontend/app.vue +8 -0
- package/test/fixtures/metrics/services/frontend/nuxt.config.js +15 -0
- package/test/fixtures/metrics/services/frontend/package.json +9 -0
- package/test/fixtures/metrics/services/frontend/platformatic.application.json +6 -0
- package/test/fixtures/ssr-autodetect-prefix/package.json +10 -0
- package/test/fixtures/ssr-autodetect-prefix/platformatic.runtime.json +24 -0
- package/test/fixtures/ssr-autodetect-prefix/services/frontend/app.vue +8 -0
- package/test/fixtures/ssr-autodetect-prefix/services/frontend/nuxt.config.js +15 -0
- package/test/fixtures/ssr-autodetect-prefix/services/frontend/package.json +9 -0
- package/test/fixtures/ssr-autodetect-prefix/services/frontend/platformatic.application.json +6 -0
- package/test/fixtures/ssr-custom-commands/package.json +11 -0
- package/test/fixtures/ssr-custom-commands/platformatic.runtime.json +24 -0
- package/test/fixtures/ssr-custom-commands/services/frontend/app.vue +8 -0
- package/test/fixtures/ssr-custom-commands/services/frontend/nuxt.config.js +15 -0
- package/test/fixtures/ssr-custom-commands/services/frontend/package.json +16 -0
- package/test/fixtures/ssr-custom-commands/services/frontend/platformatic.application.json +11 -0
- package/test/fixtures/ssr-standalone/package.json +8 -0
- package/test/fixtures/ssr-standalone/platformatic.runtime.json +15 -0
- package/test/fixtures/ssr-standalone/services/frontend/app.vue +8 -0
- package/test/fixtures/ssr-standalone/services/frontend/nuxt.config.js +12 -0
- package/test/fixtures/ssr-standalone/services/frontend/package.json +9 -0
- package/test/fixtures/ssr-standalone/services/frontend/platformatic.application.json +3 -0
- package/test/fixtures/ssr-with-prefix/package.json +10 -0
- package/test/fixtures/ssr-with-prefix/platformatic.runtime.json +24 -0
- package/test/fixtures/ssr-with-prefix/services/frontend/app.vue +8 -0
- package/test/fixtures/ssr-with-prefix/services/frontend/nuxt.config.js +15 -0
- package/test/fixtures/ssr-with-prefix/services/frontend/package.json +9 -0
- package/test/fixtures/ssr-with-prefix/services/frontend/platformatic.application.json +6 -0
- package/test/fixtures/ssr-without-prefix/package.json +10 -0
- package/test/fixtures/ssr-without-prefix/platformatic.runtime.json +24 -0
- package/test/fixtures/ssr-without-prefix/services/frontend/app.vue +8 -0
- package/test/fixtures/ssr-without-prefix/services/frontend/nuxt.config.js +12 -0
- package/test/fixtures/ssr-without-prefix/services/frontend/package.json +9 -0
- package/test/fixtures/ssr-without-prefix/services/frontend/platformatic.application.json +3 -0
- package/test/fixtures/standalone/package.json +8 -0
- package/test/fixtures/standalone/platformatic.runtime.json +15 -0
- package/test/fixtures/standalone/services/frontend/app.vue +8 -0
- package/test/fixtures/standalone/services/frontend/nuxt.config.js +13 -0
- package/test/fixtures/standalone/services/frontend/package.json +9 -0
- package/test/fixtures/standalone/services/frontend/platformatic.application.json +3 -0
- package/test/helper.js +1 -0
- package/test/https.test.js +43 -0
- package/test/logger.test.js +31 -0
- package/test/metrics.test.js +46 -0
- package/test/miscellaneous.test.js +33 -0
- package/test/production.test.js +153 -0
- package/test/types/index.tst.ts +34 -0
- package/test/version-check.test.js +29 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
ssr: false,
|
|
5
|
+
compatibilityDate: '2026-06-15',
|
|
6
|
+
telemetry: false,
|
|
7
|
+
devtools: { enabled: false },
|
|
8
|
+
vite: {
|
|
9
|
+
server: {
|
|
10
|
+
allowedHosts: ['.plt.local']
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/2.0.0.json",
|
|
3
|
+
"entrypoint": "composer",
|
|
4
|
+
"services": [
|
|
5
|
+
{
|
|
6
|
+
"id": "frontend",
|
|
7
|
+
"config": "platformatic.application.json",
|
|
8
|
+
"path": "./services/frontend"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "backend",
|
|
12
|
+
"config": "platformatic.json",
|
|
13
|
+
"path": "./services/backend"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "composer",
|
|
17
|
+
"config": "platformatic.json",
|
|
18
|
+
"path": "./services/composer"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"logger": {
|
|
22
|
+
"level": "error"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
Hello from v{{ version }} t{{ time }}
|
|
4
|
+
<pre id="fetch-results">{{ JSON.stringify(fetchResults, null, 2) }}</pre>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
const version = 123
|
|
10
|
+
const time = Date.now()
|
|
11
|
+
const fetchResults = {}
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const stringUrlResponse = await fetch('http://backend.plt.local/example')
|
|
15
|
+
const stringUrlData = await stringUrlResponse.json()
|
|
16
|
+
fetchResults.stringUrl = { ok: stringUrlResponse.ok, data: stringUrlData }
|
|
17
|
+
} catch (err) {
|
|
18
|
+
fetchResults.stringUrl = { ok: false, error: String(err) }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const req = new Request('http://backend.plt.local/example')
|
|
23
|
+
const requestObjectResponse = await fetch(req)
|
|
24
|
+
const requestObjectData = await requestObjectResponse.json()
|
|
25
|
+
fetchResults.requestObject = { ok: requestObjectResponse.ok, data: requestObjectData }
|
|
26
|
+
} catch (err) {
|
|
27
|
+
fetchResults.requestObject = { ok: false, error: String(err) }
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
app: {
|
|
5
|
+
baseURL: '/frontend/'
|
|
6
|
+
},
|
|
7
|
+
compatibilityDate: '2026-06-15',
|
|
8
|
+
telemetry: false,
|
|
9
|
+
devtools: { enabled: false },
|
|
10
|
+
vite: {
|
|
11
|
+
server: {
|
|
12
|
+
allowedHosts: ['.plt.local']
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/2.0.0.json",
|
|
3
|
+
"entrypoint": "frontend",
|
|
4
|
+
"services": [
|
|
5
|
+
{
|
|
6
|
+
"id": "frontend",
|
|
7
|
+
"config": "platformatic.application.json",
|
|
8
|
+
"path": "./services/frontend"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"logger": {
|
|
12
|
+
"level": "info"
|
|
13
|
+
},
|
|
14
|
+
"restartOnError": false
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>Hello from v{{ version }} t{{ time }}</div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { getLogger } from '@platformatic/globals'
|
|
7
|
+
|
|
8
|
+
const logger = getLogger()
|
|
9
|
+
logger?.info('Log from Nuxt App page')
|
|
10
|
+
const version = 123
|
|
11
|
+
const time = Date.now()
|
|
12
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/nuxt/3.52.4.json",
|
|
3
|
+
"logger": {
|
|
4
|
+
"level": "debug",
|
|
5
|
+
"formatters": {
|
|
6
|
+
"path": "logger-formatters.js"
|
|
7
|
+
},
|
|
8
|
+
"timestamp": "isoTime",
|
|
9
|
+
"redact": {
|
|
10
|
+
"paths": ["req.headers.authorization"],
|
|
11
|
+
"censor": "***HIDDEN***"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/2.56.0.json",
|
|
3
|
+
"entrypoint": "composer",
|
|
4
|
+
"metrics": true,
|
|
5
|
+
"services": [
|
|
6
|
+
{
|
|
7
|
+
"id": "frontend",
|
|
8
|
+
"config": "platformatic.application.json",
|
|
9
|
+
"path": "./services/frontend"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "backend",
|
|
13
|
+
"config": "platformatic.json",
|
|
14
|
+
"path": "./services/backend"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "composer",
|
|
18
|
+
"config": "platformatic.json",
|
|
19
|
+
"path": "./services/composer"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"logger": {
|
|
23
|
+
"level": "error"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/service/2.56.0.json",
|
|
3
|
+
"service": {
|
|
4
|
+
"openapi": true
|
|
5
|
+
},
|
|
6
|
+
"watch": false,
|
|
7
|
+
"plugins": {
|
|
8
|
+
"paths": [
|
|
9
|
+
{
|
|
10
|
+
"path": "./plugins",
|
|
11
|
+
"encapsulate": false
|
|
12
|
+
},
|
|
13
|
+
"./routes"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module.exports = async function (fastify) {
|
|
2
|
+
const { getITC } = require('@platformatic/globals')
|
|
3
|
+
|
|
4
|
+
fastify.get('/example', async () => {
|
|
5
|
+
return { hello: fastify.example }
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
fastify.get('/mesh', async () => {
|
|
9
|
+
const itc = getITC()
|
|
10
|
+
const meta = await itc.send('getApplicationMeta', 'composer')
|
|
11
|
+
|
|
12
|
+
const url = new URL(
|
|
13
|
+
`${meta.gateway.proxies.frontend.rewritePrefix}/direct`.replaceAll(
|
|
14
|
+
/\/+/g,
|
|
15
|
+
'/'
|
|
16
|
+
),
|
|
17
|
+
'http://frontend.plt.local'
|
|
18
|
+
)
|
|
19
|
+
const response = await fetch(url)
|
|
20
|
+
return response.json()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
fastify.get('/time', async () => {
|
|
24
|
+
return { time: Date.now() }
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
fastify.get('/time-alternative', async () => {
|
|
28
|
+
return { time: Date.now() }
|
|
29
|
+
})
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
app: {
|
|
5
|
+
baseURL: '/frontend/'
|
|
6
|
+
},
|
|
7
|
+
compatibilityDate: '2026-06-15',
|
|
8
|
+
telemetry: false,
|
|
9
|
+
devtools: { enabled: false },
|
|
10
|
+
vite: {
|
|
11
|
+
server: {
|
|
12
|
+
allowedHosts: ['.plt.local']
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/2.0.0.json",
|
|
3
|
+
"entrypoint": "composer",
|
|
4
|
+
"services": [
|
|
5
|
+
{
|
|
6
|
+
"id": "frontend",
|
|
7
|
+
"config": "platformatic.application.json",
|
|
8
|
+
"path": "./services/frontend"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "backend",
|
|
12
|
+
"config": "platformatic.json",
|
|
13
|
+
"path": "./services/backend"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "composer",
|
|
17
|
+
"config": "platformatic.json",
|
|
18
|
+
"path": "./services/composer"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"logger": {
|
|
22
|
+
"level": "error"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
app: {
|
|
5
|
+
baseURL: '/nested/base/dir/'
|
|
6
|
+
},
|
|
7
|
+
compatibilityDate: '2026-06-15',
|
|
8
|
+
telemetry: false,
|
|
9
|
+
devtools: { enabled: false },
|
|
10
|
+
vite: {
|
|
11
|
+
server: {
|
|
12
|
+
allowedHosts: ['.plt.local']
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/2.0.0.json",
|
|
3
|
+
"entrypoint": "composer",
|
|
4
|
+
"services": [
|
|
5
|
+
{
|
|
6
|
+
"id": "frontend",
|
|
7
|
+
"config": "platformatic.application.json",
|
|
8
|
+
"path": "./services/frontend"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "backend",
|
|
12
|
+
"config": "platformatic.json",
|
|
13
|
+
"path": "./services/backend"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "composer",
|
|
17
|
+
"config": "platformatic.json",
|
|
18
|
+
"path": "./services/composer"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"logger": {
|
|
22
|
+
"level": "error"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
app: {
|
|
5
|
+
baseURL: '/frontend/'
|
|
6
|
+
},
|
|
7
|
+
compatibilityDate: '2026-06-15',
|
|
8
|
+
telemetry: false,
|
|
9
|
+
devtools: { enabled: false },
|
|
10
|
+
vite: {
|
|
11
|
+
server: {
|
|
12
|
+
allowedHosts: ['.plt.local']
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nuxt",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "nuxt dev --host 127.0.0.1 --port 0",
|
|
8
|
+
"build": "nuxt build",
|
|
9
|
+
"start": "node .output/server/index.mjs"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@platformatic/nuxt": "^3.52.4",
|
|
13
|
+
"nuxt": "^4.4.8",
|
|
14
|
+
"vue": "^3.5.22"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/2.0.0.json",
|
|
3
|
+
"entrypoint": "frontend",
|
|
4
|
+
"services": [
|
|
5
|
+
{
|
|
6
|
+
"id": "frontend",
|
|
7
|
+
"config": "platformatic.application.json",
|
|
8
|
+
"path": "./services/frontend"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"logger": {
|
|
12
|
+
"level": "info"
|
|
13
|
+
},
|
|
14
|
+
"restartOnError": false
|
|
15
|
+
}
|