-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathconfig.ts
More file actions
103 lines (100 loc) · 3.54 KB
/
config.ts
File metadata and controls
103 lines (100 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import messageHandler from './messages';
export interface Configuration {
starterApps: Array<any>;
sampleApps: any;
appLevelConfig: any;
}
export interface AppConfig {
source: string;
stack: string;
private?: boolean;
branch?: string;
appConfigKey?: string;
master_locale?: string;
}
const config: Configuration = {
sampleApps: [
{ displayName: 'React JS', configKey: 'reactjs' },
{ displayName: 'Next JS', configKey: 'nextjs' },
{ displayName: 'Gatsby', configKey: 'gatsby' },
{ displayName: 'Angular', configKey: 'angular' },
],
starterApps: [
{ displayName: 'React JS', configKey: 'reactjs-starter' },
{ displayName: 'Next JS', configKey: 'nextjs-starter' },
{ displayName: 'Gatsby', configKey: 'gatsby-starter' },
{ displayName: 'Angular', configKey: 'angular-starter' },
{ displayName: 'Nuxt JS (To be Deprecated)', configKey: 'nuxt-starter' },
{ displayName: 'Vue JS', configKey: 'vue-starter' },
{ displayName: 'Stencil', configKey: 'stencil-starter' },
{ displayName: 'Nuxt3', configKey: 'nuxt3-starter' },
{ displayName: 'Compass App', configKey: 'compass-app' }
],
appLevelConfig: {
nextjs: {
source: 'contentstack/contentstack-nextjs-react-universal-demo',
stack: 'contentstack/stack-contentstack-nextjs-react-universal-demo',
},
reactjs: {
source: 'contentstack/contentstack-reactjs-universal-sample-app',
stack: 'contentstack/stack-contentstack-reactjs-universal-sample-app',
},
gatsby: {
source: 'contentstack/gatsby-starter-contentstack',
stack: 'contentstack/stack-gatsby-starter-contentstack',
},
angular: {
source: 'contentstack/contentstack-angular-modularblock-example',
stack: 'contentstack/stack-contentstack-angular-modularblock-example',
},
'compass-app': {
source: 'contentstack/compass-starter-app',
stack: 'contentstack/compass-starter-stack',
master_locale: 'en',
},
'nuxtjs-disabled': {
source: 'contentstack/contentstack-nuxtjs-vue-universal-demo',
stack: 'shafeeqd959/stack-contentstack-nuxtjs-vue-universal-demo',
},
'nuxt-starter': {
source: 'contentstack/contentstack-nuxtjs-starter-app',
stack: 'contentstack/stack-starter-app',
},
'reactjs-starter': {
source: 'contentstack/contentstack-react-starter-app',
stack: 'contentstack/stack-starter-app',
},
'nextjs-starter': {
source: 'contentstack/contentstack-nextjs-starter-app',
stack: 'contentstack/stack-starter-app',
},
'gatsby-starter': {
source: 'contentstack/contentstack-gatsby-starter-app',
stack: 'contentstack/stack-starter-app',
},
'angular-starter': {
source: 'contentstack/contentstack-angular-starter',
stack: 'contentstack/stack-starter-app',
},
'vue-starter': {
source: 'contentstack/contentstack-vuejs-starter-app',
stack: 'contentstack/stack-starter-app',
},
'stencil-starter': {
source: 'contentstack/contentstack-stencil-starter-app',
stack: 'contentstack/stack-starter-app',
},
'nuxt3-starter': {
source: 'contentstack/contentstack-nuxt3-starter-app',
stack: 'contentstack/stack-starter-app',
},
},
};
export default config;
export function getAppLevelConfigByName(appConfigKey: string): any {
if (!config.appLevelConfig.hasOwnProperty(appConfigKey)) {
throw new Error(messageHandler.parse('CLI_BOOTSTRAP_INVALID_APP_NAME'));
}
config.appLevelConfig[appConfigKey].appConfigKey = appConfigKey;
return config.appLevelConfig[appConfigKey];
}