@strapi/strapi 4.2.0-beta.0 → 4.2.0-beta.3

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.
Files changed (40) hide show
  1. package/README.md +2 -3
  2. package/bin/strapi.js +7 -0
  3. package/lib/Strapi.js +22 -4
  4. package/lib/commands/admin-create.js +15 -1
  5. package/lib/commands/admin-reset.js +15 -1
  6. package/lib/commands/build.js +4 -5
  7. package/lib/commands/builders/admin.js +4 -3
  8. package/lib/commands/builders/typescript.js +3 -6
  9. package/lib/commands/configurationDump.js +14 -1
  10. package/lib/commands/configurationRestore.js +16 -1
  11. package/lib/commands/console.js +16 -2
  12. package/lib/commands/develop.js +10 -4
  13. package/lib/commands/opt-out-telemetry.js +83 -0
  14. package/lib/commands/routes/list.js +15 -1
  15. package/lib/commands/start.js +12 -2
  16. package/lib/commands/watchAdmin.js +3 -4
  17. package/lib/core/app-configuration/index.js +5 -3
  18. package/lib/core/bootstrap.js +9 -1
  19. package/lib/core/loaders/apis.js +13 -9
  20. package/lib/core/loaders/index.js +1 -0
  21. package/lib/core/loaders/plugins/get-enabled-plugins.js +1 -6
  22. package/lib/core/loaders/sanitizers.js +5 -0
  23. package/lib/core/registries/policies.d.ts +1 -1
  24. package/lib/core/registries/sanitizers.js +26 -0
  25. package/lib/core-api/controller/index.d.ts +14 -9
  26. package/lib/core-api/service/index.d.ts +10 -9
  27. package/lib/factories.d.ts +21 -17
  28. package/lib/index.d.ts +7 -6
  29. package/lib/middlewares/body.js +38 -10
  30. package/lib/middlewares/public/index.js +1 -1
  31. package/lib/middlewares/session.js +3 -1
  32. package/lib/services/entity-validator/validators.js +3 -1
  33. package/lib/services/metrics/index.js +7 -1
  34. package/lib/services/metrics/sender.js +7 -0
  35. package/lib/services/server/index.js +1 -1
  36. package/lib/types/strapi.d.ts +291 -0
  37. package/lib/types/utils.d.ts +1 -0
  38. package/lib/utils/get-dirs.js +5 -4
  39. package/lib/utils/update-notifier/index.js +2 -2
  40. package/package.json +14 -13
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const { join } = require('path');
3
+ const { join, resolve } = require('path');
4
4
 
5
- const getDirs = ({ appDir, distDir }) => ({
5
+ const getDirs = ({ app: appDir, dist: distDir }, { strapi }) => ({
6
6
  dist: {
7
7
  root: distDir,
8
8
  src: join(distDir, 'src'),
@@ -12,7 +12,6 @@ const getDirs = ({ appDir, distDir }) => ({
12
12
  policies: join(distDir, 'src', 'policies'),
13
13
  middlewares: join(distDir, 'src', 'middlewares'),
14
14
  config: join(distDir, 'config'),
15
- public: join(distDir, 'public'),
16
15
  },
17
16
  app: {
18
17
  root: appDir,
@@ -23,7 +22,9 @@ const getDirs = ({ appDir, distDir }) => ({
23
22
  policies: join(appDir, 'src', 'policies'),
24
23
  middlewares: join(appDir, 'src', 'middlewares'),
25
24
  config: join(appDir, 'config'),
26
- public: join(appDir, 'public'),
25
+ },
26
+ static: {
27
+ public: resolve(appDir, strapi.config.get('server.dirs.public')),
27
28
  },
28
29
  });
29
30
 
@@ -20,7 +20,7 @@ const boxenOptions = {
20
20
  borderStyle: 'round',
21
21
  };
22
22
 
23
- const geUpdatetMessage = (newVersion, currentVersion) => {
23
+ const getUpdateMessage = (newVersion, currentVersion) => {
24
24
  const currentVersionLog = chalk.dim(currentVersion);
25
25
  const newVersionLog = chalk.green(newVersion);
26
26
  const releaseLink = chalk.bold('https://github.com/strapi/strapi/releases');
@@ -78,7 +78,7 @@ const createUpdateNotifier = strapi => {
78
78
  return;
79
79
  }
80
80
 
81
- const message = boxen(geUpdatetMessage(latestVersion, pkg.version), boxenOptions);
81
+ const message = boxen(getUpdateMessage(latestVersion, pkg.version), boxenOptions);
82
82
  config.set('lastNotification', now);
83
83
  console.log(message);
84
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/strapi",
3
- "version": "4.2.0-beta.0",
3
+ "version": "4.2.0-beta.3",
4
4
  "description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
5
5
  "keywords": [
6
6
  "strapi",
@@ -80,17 +80,17 @@
80
80
  "dependencies": {
81
81
  "@koa/cors": "3.1.0",
82
82
  "@koa/router": "10.1.1",
83
- "@strapi/admin": "4.2.0-beta.0",
84
- "@strapi/database": "4.2.0-beta.0",
85
- "@strapi/generate-new": "4.2.0-beta.0",
86
- "@strapi/generators": "4.2.0-beta.0",
87
- "@strapi/logger": "4.2.0-beta.0",
88
- "@strapi/plugin-content-manager": "4.2.0-beta.0",
89
- "@strapi/plugin-content-type-builder": "4.2.0-beta.0",
90
- "@strapi/plugin-email": "4.2.0-beta.0",
91
- "@strapi/plugin-upload": "4.2.0-beta.0",
92
- "@strapi/typescript-utils": "4.2.0-beta.0",
93
- "@strapi/utils": "4.2.0-beta.0",
83
+ "@strapi/admin": "4.2.0-beta.3",
84
+ "@strapi/database": "4.2.0-beta.3",
85
+ "@strapi/generate-new": "4.2.0-beta.3",
86
+ "@strapi/generators": "4.2.0-beta.3",
87
+ "@strapi/logger": "4.2.0-beta.3",
88
+ "@strapi/plugin-content-manager": "4.2.0-beta.3",
89
+ "@strapi/plugin-content-type-builder": "4.2.0-beta.3",
90
+ "@strapi/plugin-email": "4.2.0-beta.3",
91
+ "@strapi/plugin-upload": "4.2.0-beta.3",
92
+ "@strapi/typescript-utils": "4.2.0-beta.3",
93
+ "@strapi/utils": "4.2.0-beta.3",
94
94
  "bcryptjs": "2.4.3",
95
95
  "boxen": "5.1.2",
96
96
  "chalk": "4.1.2",
@@ -118,6 +118,7 @@
118
118
  "koa-session": "6.2.0",
119
119
  "koa-static": "5.0.0",
120
120
  "lodash": "4.17.21",
121
+ "mime-types": "2.1.35",
121
122
  "node-fetch": "2.6.7",
122
123
  "node-machine-id": "1.1.12",
123
124
  "node-schedule": "2.0.0",
@@ -138,5 +139,5 @@
138
139
  "node": ">=12.22.0 <=16.x.x",
139
140
  "npm": ">=6.0.0"
140
141
  },
141
- "gitHead": "db70f0de7cc73fb469c8a076b89530729cf14142"
142
+ "gitHead": "c4addbad6ecbc8ef7633bbba3806f3b0a2ae5f49"
142
143
  }