@@ -34,7 +34,6 @@ const watcher = (label, cmd, withSuccess = true) => {
34
34
shell . echo ( '✅ Success' ) ;
35
35
shell . echo ( '' ) ;
36
36
}
37
-
38
37
} ;
39
38
40
39
const asyncWatcher = ( label , cmd , withSuccess = true , resolve ) => {
@@ -88,7 +87,6 @@ if (shell.test('-e', 'admin/src/config/plugins.json') === false) {
88
87
shell . cd ( '../../../' ) ;
89
88
}
90
89
91
-
92
90
watcher ( '📦 Linking strapi-admin' , 'npm link --no-optional' , false ) ;
93
91
94
92
shell . cd ( '../strapi-generate-admin' ) ;
@@ -112,18 +110,33 @@ watcher('', 'npm install ../strapi-hook-knex');
112
110
watcher ( '📦 Linking strapi-hook-bookshelf...' , 'npm link' ) ;
113
111
114
112
shell . cd ( '../strapi' ) ;
115
- watcher ( '' , 'npm install ../strapi-generate ../strapi-generate-admin ../strapi-generate-api ../strapi-generate-new ../strapi-generate-plugin ../strapi-generate-policy ../strapi-generate-service ../strapi-utils' ) ;
113
+ watcher (
114
+ '' ,
115
+ 'npm install ../strapi-generate ../strapi-generate-admin ../strapi-generate-api ../strapi-generate-new ../strapi-generate-plugin ../strapi-generate-policy ../strapi-generate-service ../strapi-utils'
116
+ ) ;
116
117
watcher ( '📦 Linking strapi...' , 'npm link' ) ;
117
118
118
119
shell . cd ( '../strapi-plugin-graphql' ) ;
119
- watcher ( '📦 Linking strapi-plugin-graphql...' , 'npm link --no-optional' , false ) ;
120
+ watcher (
121
+ '📦 Linking strapi-plugin-graphql...' ,
122
+ 'npm link --no-optional' ,
123
+ false
124
+ ) ;
120
125
121
126
// Plugin services
122
127
shell . cd ( '../strapi-provider-upload-local' ) ;
123
- watcher ( '📦 Linking strapi-provider-upload-local...' , 'npm link --no-optional' , false ) ;
128
+ watcher (
129
+ '📦 Linking strapi-provider-upload-local...' ,
130
+ 'npm link --no-optional' ,
131
+ false
132
+ ) ;
124
133
125
134
shell . cd ( '../strapi-provider-email-sendmail' ) ;
126
- watcher ( '📦 Linking strapi-provider-email-sendmail...' , 'npm link --no-optional' , false ) ;
135
+ watcher (
136
+ '📦 Linking strapi-provider-email-sendmail...' ,
137
+ 'npm link --no-optional' ,
138
+ false
139
+ ) ;
127
140
128
141
// Plugins with admin
129
142
shell . cd ( '../strapi-plugin-email' ) ;
@@ -134,19 +147,31 @@ watcher('📦 Linking strapi-plugin-email...', 'npm link --no-optional', false)
134
147
135
148
shell . cd ( '../strapi-plugin-users-permissions' ) ;
136
149
watcher ( '' , 'npm install ../strapi-helper-plugin --no-optional' ) ;
150
+ watcher ( '' , 'npm install ../strapi-utils --no-optional' ) ;
137
151
shell . rm ( '-f' , 'package-lock.json' ) ;
138
- watcher ( '📦 Linking strapi-plugin-users-permissions...' , 'npm link --no-optional' , false ) ;
152
+ watcher (
153
+ '📦 Linking strapi-plugin-users-permissions...' ,
154
+ 'npm link --no-optional' ,
155
+ false
156
+ ) ;
139
157
140
158
shell . cd ( '../strapi-plugin-content-manager' ) ;
141
159
watcher ( '' , 'npm install ../strapi-helper-plugin --no-optional' ) ;
142
160
shell . rm ( '-f' , 'package-lock.json' ) ;
143
- watcher ( '📦 Linking strapi-plugin-content-manager...' , 'npm link --no-optional' , false ) ;
161
+ watcher (
162
+ '📦 Linking strapi-plugin-content-manager...' ,
163
+ 'npm link --no-optional' ,
164
+ false
165
+ ) ;
144
166
145
167
shell . cd ( '../strapi-plugin-settings-manager' ) ;
146
168
watcher ( '' , 'npm install ../strapi-helper-plugin --no-optional' ) ;
147
169
shell . rm ( '-f' , 'package-lock.json' ) ;
148
- watcher ( '📦 Linking strapi-plugin-settings-manager...' , 'npm link --no-optional' , false ) ;
149
-
170
+ watcher (
171
+ '📦 Linking strapi-plugin-settings-manager...' ,
172
+ 'npm link --no-optional' ,
173
+ false
174
+ ) ;
150
175
151
176
// Plugins with admin and other plugin's dependencies
152
177
shell . cd ( '../strapi-plugin-upload' ) ;
@@ -160,16 +185,32 @@ watcher('', 'npm install ../strapi-helper-plugin --no-optional');
160
185
watcher ( '' , 'npm install ../strapi-generate --no-optional' ) ;
161
186
watcher ( '' , 'npm install ../strapi-generate-api --no-optional' ) ;
162
187
shell . rm ( '-f' , 'package-lock.json' ) ;
163
- watcher ( '📦 Linking strapi-plugin-content-type-builder...' , 'npm link --no-optional' , false ) ;
164
-
165
-
166
- const pluginsToBuild = [ 'admin' , 'content-manager' , 'content-type-builder' , 'upload' , 'email' , 'users-permissions' , 'settings-manager' ] ;
188
+ watcher (
189
+ '📦 Linking strapi-plugin-content-type-builder...' ,
190
+ 'npm link --no-optional' ,
191
+ false
192
+ ) ;
193
+
194
+ const pluginsToBuild = [
195
+ 'admin' ,
196
+ 'content-manager' ,
197
+ 'content-type-builder' ,
198
+ 'upload' ,
199
+ 'email' ,
200
+ 'users-permissions' ,
201
+ 'settings-manager'
202
+ ] ;
167
203
168
204
const buildPlugins = async ( ) => {
169
- const build = ( pckgName ) => {
205
+ const build = pckgName => {
170
206
return new Promise ( resolve => {
171
- const name = pckgName === 'admin' ? pckgName : `plugin-${ pckgName } ` ;
172
- asyncWatcher ( `🏗 Building ${ name } ...` , `cd ../strapi-${ name } && IS_MONOREPO=true npm run build` , false , resolve ) ;
207
+ const name = pckgName === 'admin' ? pckgName : `plugin-${ pckgName } ` ;
208
+ asyncWatcher (
209
+ `🏗 Building ${ name } ...` ,
210
+ `cd ../strapi-${ name } && IS_MONOREPO=true npm run build` ,
211
+ false ,
212
+ resolve
213
+ ) ;
173
214
} ) ;
174
215
} ;
175
216
@@ -178,23 +219,34 @@ const buildPlugins = async () => {
178
219
179
220
const setup = async ( ) => {
180
221
if ( process . env . npm_config_build ) {
181
- if ( process . platform === 'darwin' ) { // Allow async build for darwin platform
222
+ if ( process . platform === 'darwin' ) {
223
+ // Allow async build for darwin platform
182
224
await buildPlugins ( ) ;
183
225
} else {
184
226
pluginsToBuild . map ( name => {
185
227
const pluginName = name === 'admin' ? name : `plugin-${ name } ` ;
186
228
shell . cd ( `../strapi-${ pluginName } ` ) ;
187
229
188
- return watcher ( `🏗 Building ${ pluginName } ...` , 'IS_MONOREPO=true npm run build' ) ;
230
+ return watcher (
231
+ `🏗 Building ${ pluginName } ...` ,
232
+ 'IS_MONOREPO=true npm run build'
233
+ ) ;
189
234
} ) ;
190
235
}
191
236
}
192
237
193
238
// Log installation duration.
194
239
const installationEndDate = new Date ( ) ;
195
- const duration = ( installationEndDate . getTime ( ) - installationStartDate . getTime ( ) ) / 1000 ;
240
+ const duration =
241
+ ( installationEndDate . getTime ( ) - installationStartDate . getTime ( ) ) / 1000 ;
196
242
shell . echo ( '✅ Strapi has been succesfully installed.' ) ;
197
- shell . echo ( `⏳ The installation took ${ Math . floor ( duration / 60 ) > 0 ? `${ Math . floor ( duration / 60 ) } minutes and ` : '' } ${ Math . floor ( duration % 60 ) } seconds.` ) ;
243
+ shell . echo (
244
+ `⏳ The installation took ${
245
+ Math . floor ( duration / 60 ) > 0
246
+ ? `${ Math . floor ( duration / 60 ) } minutes and `
247
+ : ''
248
+ } ${ Math . floor ( duration % 60 ) } seconds.`
249
+ ) ;
198
250
} ;
199
251
200
252
setup ( ) ;
0 commit comments