@minnai/create-aura-app 0.0.16 → 0.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minnai/create-aura-app",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Scaffolding tool for new Aura projects",
5
5
  "bin": "dist/index.js",
6
6
  "files": [
@@ -9,17 +9,21 @@ import { LOCAL_AIRS } from '../../aura.config';
9
9
 
10
10
  export const registerExampleAIRs = () => {
11
11
  // 1. Register Standard AIRs (Core)
12
- // The Standard AIRs export a wrapper object { manifest, resources, component }
13
- // We need to flatten this to match AIRManifest { id, meta, component }
14
- [TasksAIR, YouTubeAIR].forEach((air: any) => {
15
- // Core AIRs are exported as { manifest, resources, component }
16
- const airData = air.default || air;
17
- if (LOCAL_AIRS.includes(airData.manifest.id)) {
18
- atmosphere.register({
19
- ...airData.manifest,
20
- component: airData.component,
21
- resources: airData.resources
22
- });
12
+ const coreAIRs = [
13
+ { data: TasksAIR, id: 'tasks-air' },
14
+ { data: YouTubeAIR, id: 'youtube-player-air' }
15
+ ];
16
+
17
+ coreAIRs.forEach(({ data, id }) => {
18
+ if (LOCAL_AIRS.includes(id)) {
19
+ const air = (data as any).default || data;
20
+ if (air && air.manifest) {
21
+ atmosphere.register({
22
+ ...air.manifest,
23
+ component: air.component || air.Component,
24
+ resources: air.resources
25
+ });
26
+ }
23
27
  }
24
28
  });
25
29
 
@@ -40,9 +44,11 @@ export const registerExampleAIRs = () => {
40
44
  }
41
45
  };
42
46
 
47
+ const getManifest = (air: any) => (air?.default || air)?.manifest;
48
+
43
49
  export const EXAMPLE_AIRS = [
44
- YouTubeAIR.manifest,
45
- TasksAIR.manifest,
50
+ getManifest(YouTubeAIR),
51
+ getManifest(TasksAIR),
46
52
  StocksManifest,
47
53
  CurrencyManifest
48
- ].filter(manifest => LOCAL_AIRS.includes(manifest.id));
54
+ ].filter(manifest => manifest && LOCAL_AIRS.includes(manifest.id));