@flyo/nitro-astro 2.0.8 → 2.0.10

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/README.md CHANGED
@@ -12,10 +12,11 @@ This guide targets developers and web designers aiming to combine Flyo Nitro CMS
12
12
 
13
13
  ## Installation
14
14
 
15
- To install the package, execute the following command:
15
+ To install the `@flyo/nitro-astro` package, execute the following command:
16
16
 
17
17
  ```bash
18
- astro add @flyo/nitro-astro
18
+ npm install @flyo/nitro-astro
19
+ # yarn add @flyo/nitro-astro
19
20
  ```
20
21
 
21
22
  Then, revise and adjust the configuration in your `astro.config.mjs`:
@@ -41,6 +42,7 @@ export default defineConfig({
41
42
  });
42
43
  ```
43
44
 
45
+ > [!WARNING]
44
46
  > The nitro astro integration requires an SSR setup which is done by using `output: 'server'`.
45
47
 
46
48
  ### Pages
@@ -245,7 +247,8 @@ All endpoints accept a `lang` parameter to retrieve data in the desired language
245
247
  await useEntitiesApi().entityByUniqueid({ uniqueid, lang: Astro.currentLocale });
246
248
  ```
247
249
 
248
- Note: If your entity details are internationalized (i18n), you need to create separate detail pages for each language.
250
+ > [!NOTE]
251
+ > If your entity details are internationalized (i18n), you need to create separate detail pages for each language.
249
252
 
250
253
  ```
251
254
  .
@@ -29,7 +29,7 @@
29
29
  </g>
30
30
  </g>
31
31
  </svg>
32
- `;function $e(e){const n={accessToken:!1,liveEdit:!1,fallbackComponent:null,componentsDir:"src/components/flyo",serverCacheHeaderTtl:1200,clientCacheHeaderTtl:900,...e};return n.liveEdit==="true"?n.liveEdit=!0:n.liveEdit==="false"&&(n.liveEdit=!1),{name:"@flyo/nitro-astro",hooks:{"astro:config:setup":({injectScript:t,updateConfig:i,injectRoute:a,addMiddleware:o,addDevToolbarApp:r})=>{r({id:"flyo-nitro",name:"Flyo Nitro",icon:xe,entrypoint:"@flyo/nitro-astro/toolbar.ts"}),a({pattern:"sitemap.xml",entrypoint:"@flyo/nitro-astro/sitemap.ts"}),o({entrypoint:"@flyo/nitro-astro/middleware.ts",order:"post"}),i({image:{service:{entrypoint:"@flyo/nitro-astro/cdn.ts"}},vite:{plugins:[Ie(e.componentsDir,e.components||{},e.fallbackComponent)]}}),t("page-ssr",`
32
+ `;function $e(e){const n={accessToken:!1,liveEdit:!1,fallbackComponent:null,componentsDir:"src/components/flyo",serverCacheHeaderTtl:1200,clientCacheHeaderTtl:900,...e};return n.liveEdit==="true"?n.liveEdit=!0:n.liveEdit==="false"&&(n.liveEdit=!1),{name:"@flyo/nitro-astro",hooks:{"astro:config:setup":({injectScript:t,updateConfig:i,injectRoute:a,addMiddleware:o,addDevToolbarApp:r})=>{r({id:"flyo-nitro",name:"Flyo Nitro",icon:xe,entrypoint:"@flyo/nitro-astro/toolbar.ts"}),a({pattern:"sitemap.xml",entrypoint:"@flyo/nitro-astro/sitemap.ts"}),o({entrypoint:"@flyo/nitro-astro/middleware.ts",order:"post"}),i({image:{service:{entrypoint:"@flyo/nitro-astro/cdn.ts"}},vite:{plugins:[Ie(n.componentsDir,n.components||{},n.fallbackComponent)]}}),t("page-ssr",`
33
33
  import { Configuration } from '@flyo/nitro-typescript'
34
34
 
35
35
  var defaultConfig = new Configuration({
@@ -789,9 +789,9 @@ function Pe(e) {
789
789
  vite: {
790
790
  plugins: [
791
791
  Re(
792
- e.componentsDir,
793
- e.components || {},
794
- e.fallbackComponent
792
+ n.componentsDir,
793
+ n.components || {},
794
+ n.fallbackComponent
795
795
  )
796
796
  ]
797
797
  }
@@ -15,9 +15,23 @@ export interface IntegrationOptions {
15
15
  * If enabled, the user can interact with the components, also it represents the application to be in development mode.
16
16
  */
17
17
  liveEdit: string | boolean | number;
18
- /** Directory path for components. */
18
+ /**
19
+ * Directory path for components.
20
+ * By default the flyo components are located in `src/components/flyo`.
21
+ */
19
22
  componentsDir: string;
20
- /** Object containing component definitions. */
23
+ /**
24
+ * Object containing component definitions.
25
+ * The key is the component name defined in Flyo Interface, while the value is the name of the component inside the components directory.
26
+ * ```json
27
+ * components: {
28
+ * FlyoComponentName: "FlyoComponentName",
29
+ * AnotherFlyoComponent "subfolder/AnotherFlyoComponent",
30
+ * }
31
+ * ```
32
+ * > The suffix .astro is not required.
33
+ * > Adding new elements to components section, requires restarting the development server.
34
+ */
21
35
  components: object;
22
36
  /**
23
37
  * (Optional) Fallback component name.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@flyo/nitro-astro",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "Connecting Flyo Headless Content Hub into your Astro project.",
5
5
  "homepage": "https://dev.flyo.cloud/nitro",
6
6
  "keywords": [
7
7
  "withastro",
8
- "astro-adapter"
8
+ "flyo"
9
9
  ],
10
10
  "main": "./dist/nitro-astro.js",
11
11
  "module": "./dist/nitro-astro.mjs",