@strapi/strapi 4.1.5 → 4.1.6

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/README.md CHANGED
@@ -114,8 +114,7 @@ For general help using Strapi, please refer to [the official Strapi documentatio
114
114
  - [Discord](https://discord.strapi.io) (For live discussion with the Community and Strapi team)
115
115
  - [GitHub](https://github.com/strapi/strapi) (Bug reports, Contributions)
116
116
  - [Community Forum](https://forum.strapi.io) (Questions and Discussions)
117
- - [Academy](https://academy.strapi.io) (Learn the fundamentals of Strapi)
118
- - [ProductBoard](https://portal.productboard.com/strapi/tabs/2-under-consideration) (Roadmap, Feature requests)
117
+ - [Roadmap & Feature Requests](https://feedback.strapi.io/)
119
118
  - [Twitter](https://twitter.com/strapijs) (Get the news fast)
120
119
  - [Facebook](https://www.facebook.com/Strapi-616063331867161)
121
120
  - [YouTube Channel](https://www.youtube.com/strapi) (Learn from Video Tutorials)
@@ -126,7 +125,7 @@ Follow our [migration guides](https://docs.strapi.io/developer-docs/latest/updat
126
125
 
127
126
  ## Roadmap
128
127
 
129
- Check out our [roadmap](https://portal.productboard.com/strapi) to get informed of the latest features released and the upcoming ones. You may also give us insights and vote for a specific feature.
128
+ Check out our [roadmap](https://feedback.strapi.io/) to get informed of the latest features released and the upcoming ones. You may also give us insights and vote for a specific feature.
130
129
 
131
130
  ## Documentation
132
131
 
package/lib/Strapi.js CHANGED
@@ -50,8 +50,8 @@ const LIFECYCLES = {
50
50
  class Strapi {
51
51
  constructor(opts = {}) {
52
52
  destroyOnSignal(this);
53
- this.dirs = utils.getDirs(opts.dir || process.cwd());
54
- const appConfig = loadConfiguration(this.dirs.root, opts);
53
+ const rootDir = opts.dir || process.cwd();
54
+ const appConfig = loadConfiguration(rootDir, opts);
55
55
  this.container = createContainer(this);
56
56
  this.container.register('config', createConfigProvider(appConfig));
57
57
  this.container.register('content-types', contentTypesRegistry(this));
@@ -65,6 +65,8 @@ class Strapi {
65
65
  this.container.register('apis', apisRegistry(this));
66
66
  this.container.register('auth', createAuth(this));
67
67
 
68
+ this.dirs = utils.getDirs(rootDir, { strapi: this });
69
+
68
70
  this.isLoaded = false;
69
71
  this.reload = this.reload();
70
72
  this.server = createServer(this);
@@ -8,6 +8,7 @@ const execa = require('execa');
8
8
  const { getOr } = require('lodash/fp');
9
9
 
10
10
  const { createLogger } = require('@strapi/logger');
11
+ const { joinBy } = require('@strapi/utils');
11
12
  const loadConfiguration = require('../core/app-configuration');
12
13
  const strapi = require('../index');
13
14
  const buildAdmin = require('./build');
@@ -131,6 +132,8 @@ function watchFileChanges({ dir, strapiInstance, watchIgnoreFiles, polling }) {
131
132
  '**/index.html',
132
133
  '**/public',
133
134
  '**/public/**',
135
+ strapiInstance.dirs.public,
136
+ joinBy('/', strapiInstance.dirs.public, '**'),
134
137
  '**/*.db*',
135
138
  '**/exports/**',
136
139
  ...watchIgnoreFiles,
@@ -21,6 +21,7 @@ const defaultConfig = {
21
21
  proxy: false,
22
22
  cron: { enabled: false },
23
23
  admin: { autoOpen: false },
24
+ dirs: { public: './public' },
24
25
  },
25
26
  admin: {},
26
27
  api: {
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const { getConfigUrls } = require('@strapi/utils');
4
+ const fse = require('fs-extra');
4
5
 
5
- module.exports = function({ strapi }) {
6
+ module.exports = async function({ strapi }) {
6
7
  strapi.config.port = strapi.config.get('server.port') || strapi.config.port;
7
8
  strapi.config.host = strapi.config.get('server.host') || strapi.config.host;
8
9
 
@@ -22,4 +23,11 @@ module.exports = function({ strapi }) {
22
23
  if (!shouldServeAdmin) {
23
24
  strapi.config.serveAdminPanel = false;
24
25
  }
26
+
27
+ // ensure public repository exists
28
+ if (!(await fse.pathExists(strapi.dirs.public))) {
29
+ throw new Error(
30
+ `The public folder (${strapi.dirs.public}) doesn't exist or is not accessible. Please make sure it exists.`
31
+ );
32
+ }
25
33
  };
@@ -19,7 +19,9 @@ const defaultConfig = {
19
19
  module.exports = (userConfig, { strapi }) => {
20
20
  const keys = strapi.server.app.keys;
21
21
  if (!isArray(keys) || isEmpty(keys) || keys.some(isEmpty)) {
22
- throw new Error(`App keys are required. Please set app.keys in config/server.js (ex: keys: ['myKeyA', 'myKeyB'])`);
22
+ throw new Error(
23
+ `App keys are required. Please set app.keys in config/server.js (ex: keys: ['myKeyA', 'myKeyB'])`
24
+ );
23
25
  }
24
26
 
25
27
  const config = defaultsDeep(defaultConfig, userConfig);
@@ -30,7 +30,7 @@ const healthCheck = async ctx => {
30
30
  const createServer = strapi => {
31
31
  const app = createKoaApp({
32
32
  proxy: strapi.config.get('server.proxy'),
33
- keys: strapi.config.get('server.app.keys'),
33
+ keys: strapi.config.get('server.app.keys'),
34
34
  });
35
35
 
36
36
  const router = new Router();
@@ -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 = root => ({
5
+ const getDirs = (root, { strapi }) => ({
6
6
  root,
7
7
  src: join(root, 'src'),
8
8
  api: join(root, 'src', 'api'),
@@ -11,7 +11,7 @@ const getDirs = root => ({
11
11
  policies: join(root, 'src', 'policies'),
12
12
  middlewares: join(root, 'src', 'middlewares'),
13
13
  config: join(root, 'config'),
14
- public: join(root, 'public'),
14
+ public: resolve(root, strapi.config.get('server.dirs.public')),
15
15
  });
16
16
 
17
17
  module.exports = getDirs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/strapi",
3
- "version": "4.1.5",
3
+ "version": "4.1.6",
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,16 +80,16 @@
80
80
  "dependencies": {
81
81
  "@koa/cors": "3.1.0",
82
82
  "@koa/router": "10.1.1",
83
- "@strapi/admin": "4.1.5",
84
- "@strapi/database": "4.1.5",
85
- "@strapi/generate-new": "4.1.5",
86
- "@strapi/generators": "4.1.5",
87
- "@strapi/logger": "4.1.5",
88
- "@strapi/plugin-content-manager": "4.1.5",
89
- "@strapi/plugin-content-type-builder": "4.1.5",
90
- "@strapi/plugin-email": "4.1.5",
91
- "@strapi/plugin-upload": "4.1.5",
92
- "@strapi/utils": "4.1.5",
83
+ "@strapi/admin": "4.1.6",
84
+ "@strapi/database": "4.1.6",
85
+ "@strapi/generate-new": "4.1.6",
86
+ "@strapi/generators": "4.1.6",
87
+ "@strapi/logger": "4.1.6",
88
+ "@strapi/plugin-content-manager": "4.1.6",
89
+ "@strapi/plugin-content-type-builder": "4.1.6",
90
+ "@strapi/plugin-email": "4.1.6",
91
+ "@strapi/plugin-upload": "4.1.6",
92
+ "@strapi/utils": "4.1.6",
93
93
  "bcryptjs": "2.4.3",
94
94
  "boxen": "5.1.2",
95
95
  "chalk": "4.1.2",
@@ -136,5 +136,5 @@
136
136
  "node": ">=12.22.0 <=16.x.x",
137
137
  "npm": ">=6.0.0"
138
138
  },
139
- "gitHead": "f1859f03756a5feb888583dba85bcec7745ce21f"
139
+ "gitHead": "f25774168cdc244d15782f71f0fd541dae152407"
140
140
  }