Skip to content

Commit da5ca2a

Browse files
committed
Link the strapi-utils dependecy to the users-permissions module in the setup step
1 parent 19ec624 commit da5ca2a

File tree

12 files changed

+84
-32
lines changed

12 files changed

+84
-32
lines changed

packages/strapi-plugin-email/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
"npm": ">= 5.0.0"
5050
},
5151
"license": "MIT"
52-
}
52+
}

packages/strapi-plugin-upload/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747
"npm": ">= 3.0.0"
4848
},
4949
"license": "MIT"
50-
}
50+
}

packages/strapi-plugin-users-permissions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"koa2-ratelimit": "^0.6.1",
3030
"purest": "^2.0.1",
3131
"request": "^2.83.0",
32-
"strapi-utils": "3.0.0-alpha.14.3",
32+
"strapi-utils": "3.0.0-alpha.14.5",
3333
"uuid": "^3.1.0"
3434
},
3535
"devDependencies": {

packages/strapi-provider-email-amazon-ses/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"npm": ">= 5.3.0"
4040
},
4141
"license": "MIT"
42-
}
42+
}

packages/strapi-provider-email-mailgun/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
"npm": ">= 5.3.0"
4343
},
4444
"license": "MIT"
45-
}
45+
}

packages/strapi-provider-email-sendgrid/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
"npm": ">= 5.3.0"
4343
},
4444
"license": "MIT"
45-
}
45+
}

packages/strapi-provider-email-sendmail/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@
4141
"npm": ">= 5.3.0"
4242
},
4343
"license": "MIT"
44-
}
44+
}

packages/strapi-provider-upload-aws-s3/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
"npm": ">= 5.3.0"
4444
},
4545
"license": "MIT"
46-
}
46+
}

packages/strapi-provider-upload-cloudinary/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
"npm": ">= 5.3.0"
4444
},
4545
"license": "MIT"
46-
}
46+
}

packages/strapi-provider-upload-local/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"npm": ">= 5.3.0"
4040
},
4141
"license": "MIT"
42-
}
42+
}

packages/strapi-provider-upload-rackspace/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
"pkgcloud": "^1.5.0",
1414
"streamifier": "^0.1.1"
1515
}
16-
}
16+
}

scripts/setup.js

+73-21
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const watcher = (label, cmd, withSuccess = true) => {
3434
shell.echo('✅ Success');
3535
shell.echo('');
3636
}
37-
3837
};
3938

4039
const asyncWatcher = (label, cmd, withSuccess = true, resolve) => {
@@ -88,7 +87,6 @@ if (shell.test('-e', 'admin/src/config/plugins.json') === false) {
8887
shell.cd('../../../');
8988
}
9089

91-
9290
watcher('📦 Linking strapi-admin', 'npm link --no-optional', false);
9391

9492
shell.cd('../strapi-generate-admin');
@@ -112,18 +110,33 @@ watcher('', 'npm install ../strapi-hook-knex');
112110
watcher('📦 Linking strapi-hook-bookshelf...', 'npm link');
113111

114112
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+
);
116117
watcher('📦 Linking strapi...', 'npm link');
117118

118119
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+
);
120125

121126
// Plugin services
122127
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+
);
124133

125134
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+
);
127140

128141
// Plugins with admin
129142
shell.cd('../strapi-plugin-email');
@@ -134,19 +147,31 @@ watcher('📦 Linking strapi-plugin-email...', 'npm link --no-optional', false)
134147

135148
shell.cd('../strapi-plugin-users-permissions');
136149
watcher('', 'npm install ../strapi-helper-plugin --no-optional');
150+
watcher('', 'npm install ../strapi-utils --no-optional');
137151
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+
);
139157

140158
shell.cd('../strapi-plugin-content-manager');
141159
watcher('', 'npm install ../strapi-helper-plugin --no-optional');
142160
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+
);
144166

145167
shell.cd('../strapi-plugin-settings-manager');
146168
watcher('', 'npm install ../strapi-helper-plugin --no-optional');
147169
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+
);
150175

151176
// Plugins with admin and other plugin's dependencies
152177
shell.cd('../strapi-plugin-upload');
@@ -160,16 +185,32 @@ watcher('', 'npm install ../strapi-helper-plugin --no-optional');
160185
watcher('', 'npm install ../strapi-generate --no-optional');
161186
watcher('', 'npm install ../strapi-generate-api --no-optional');
162187
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+
];
167203

168204
const buildPlugins = async () => {
169-
const build = (pckgName) => {
205+
const build = pckgName => {
170206
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+
);
173214
});
174215
};
175216

@@ -178,23 +219,34 @@ const buildPlugins = async () => {
178219

179220
const setup = async () => {
180221
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
182224
await buildPlugins();
183225
} else {
184226
pluginsToBuild.map(name => {
185227
const pluginName = name === 'admin' ? name : `plugin-${name}`;
186228
shell.cd(`../strapi-${pluginName}`);
187229

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+
);
189234
});
190235
}
191236
}
192237

193238
// Log installation duration.
194239
const installationEndDate = new Date();
195-
const duration = (installationEndDate.getTime() - installationStartDate.getTime()) / 1000;
240+
const duration =
241+
(installationEndDate.getTime() - installationStartDate.getTime()) / 1000;
196242
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+
);
198250
};
199251

200252
setup();

0 commit comments

Comments
 (0)