apostrophe 3.39.1 → 3.40.0-alpha
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/CHANGELOG.md +10 -0
- package/index.js +2 -0
- package/modules/@apostrophecms/asset/lib/webpack/apos/webpack.config.js +2 -1
- package/modules/@apostrophecms/asset/lib/webpack/apos/webpack.js.js +21 -0
- package/package.json +1 -1
- package/test/attachments.js +1 -1
- package/test/base-url-env-var.js +36 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.40.0 (2023-02-11)
|
|
4
|
+
|
|
5
|
+
* For devops purposes, the `APOS_BASE_URL` environment variable is now respected as an override of the `baseUrl` option.
|
|
6
|
+
|
|
7
|
+
## 3.39.2 (2023-02-03)
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
* Hotfix for a backwards compatibility break in webpack that triggered a tiptap bug. The admin UI build will now succeed as expected.
|
|
12
|
+
|
|
3
13
|
## 3.39.1 (2023-02-02)
|
|
4
14
|
|
|
5
15
|
### Fixes
|
package/index.js
CHANGED
|
@@ -449,6 +449,8 @@ async function apostrophe(options, telemetry, rootSpan) {
|
|
|
449
449
|
throw 'Specify the `shortName` option and set it to the name of your project\'s repository or folder';
|
|
450
450
|
}
|
|
451
451
|
self.title = self.options.title;
|
|
452
|
+
// Environment variable override
|
|
453
|
+
self.options.baseUrl = process.env.APOS_BASE_URL || self.options.baseUrl;
|
|
452
454
|
self.baseUrl = self.options.baseUrl;
|
|
453
455
|
self.prefix = self.options.prefix || '';
|
|
454
456
|
}
|
|
@@ -2,6 +2,7 @@ const path = require('path');
|
|
|
2
2
|
const merge = require('webpack-merge').merge;
|
|
3
3
|
const scss = require('./webpack.scss');
|
|
4
4
|
const vue = require('./webpack.vue');
|
|
5
|
+
const js = require('./webpack.js');
|
|
5
6
|
|
|
6
7
|
let BundleAnalyzerPlugin;
|
|
7
8
|
|
|
@@ -12,7 +13,7 @@ if (process.env.APOS_BUNDLE_ANALYZER) {
|
|
|
12
13
|
module.exports = ({
|
|
13
14
|
importFile, modulesDir, outputPath, outputFilename
|
|
14
15
|
}, apos) => {
|
|
15
|
-
const tasks = [ scss, vue ].map(task =>
|
|
16
|
+
const tasks = [ scss, vue, js ].map(task =>
|
|
16
17
|
task(
|
|
17
18
|
{
|
|
18
19
|
importFile,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = (options, apos) => {
|
|
2
|
+
return {
|
|
3
|
+
module: {
|
|
4
|
+
rules: [
|
|
5
|
+
{
|
|
6
|
+
test: /\.(m)?js$/i,
|
|
7
|
+
resolve: {
|
|
8
|
+
byDependency: {
|
|
9
|
+
esm: {
|
|
10
|
+
// Be tolerant of imports like lodash/debounce that
|
|
11
|
+
// should really be lodash/debounce.js, as dependencies
|
|
12
|
+
// like tiptap are not fully on board with that rule yet
|
|
13
|
+
fullySpecified: false
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
package/package.json
CHANGED
package/test/attachments.js
CHANGED
|
@@ -201,7 +201,7 @@ describe('Attachment', function() {
|
|
|
201
201
|
extension: 'jpg',
|
|
202
202
|
_id: 'test'
|
|
203
203
|
});
|
|
204
|
-
assert(url
|
|
204
|
+
assert.strictEqual(url, '/uploads/attachments/test-test.full.jpg');
|
|
205
205
|
});
|
|
206
206
|
|
|
207
207
|
it('should generate the "one-half" URL when one-half size specified for image', function() {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const t = require('../test-lib/test.js');
|
|
2
|
+
const assert = require('assert');
|
|
3
|
+
let apos;
|
|
4
|
+
let savedBaseUrl;
|
|
5
|
+
|
|
6
|
+
const config = {
|
|
7
|
+
root: module,
|
|
8
|
+
// Should get overridden by the above
|
|
9
|
+
baseUrl: 'http://localhost:3000'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
describe('Locales', function() {
|
|
13
|
+
this.timeout(t.timeout);
|
|
14
|
+
|
|
15
|
+
before(async function() {
|
|
16
|
+
savedBaseUrl = process.env.APOS_BASE_URL;
|
|
17
|
+
process.env.APOS_BASE_URL = 'https://madethisup.com';
|
|
18
|
+
apos = await t.create(config);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
after(function() {
|
|
22
|
+
if (savedBaseUrl) {
|
|
23
|
+
process.env.APOS_BASE_URL = savedBaseUrl;
|
|
24
|
+
} else {
|
|
25
|
+
delete process.env.APOS_BASE_URL;
|
|
26
|
+
}
|
|
27
|
+
return t.destroy(apos);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('APOS_BASE_URL should take effect', async function() {
|
|
31
|
+
const req = apos.task.getReq();
|
|
32
|
+
const home = await apos.doc.find(req, { slug: '/' }).toObject();
|
|
33
|
+
assert(home);
|
|
34
|
+
assert.strictEqual(home._url, 'https://madethisup.com/');
|
|
35
|
+
});
|
|
36
|
+
});
|