@soleil-se/build-app 2.5.2 → 2.5.4
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 +8 -0
- package/index.js +14 -1
- package/package.json +2 -2
- package/rollup/api/getReplacePlugin.js +1 -2
- package/rollup/server.js +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ title: Changelog
|
|
|
4
4
|
|
|
5
5
|
Baseras på [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) och använder [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [2.5.4] - 2025-02-11
|
|
8
|
+
|
|
9
|
+
- Aktivera bara nuvarande version av tillägget en gång när flaggan `--activate` används.
|
|
10
|
+
|
|
11
|
+
## [2.5.3] - 2025-02-06
|
|
12
|
+
|
|
13
|
+
- Kasta fel vid dynamiska importer då dessa inte stöds i Rhino.
|
|
14
|
+
|
|
7
15
|
## [2.5.2] - 2025-01-22
|
|
8
16
|
|
|
9
17
|
- Använd den fördefinierade inställningen `browser` för klientkod vid module resolution med `@rollup/plugin-node-resolve`.
|
package/index.js
CHANGED
|
@@ -33,6 +33,19 @@ async function getMinimumSitevisionVersion() {
|
|
|
33
33
|
return (packageJson.dependencies['@sitevision/api'] || '2025.4.1').replace(/^[\^~]/, '');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/** @type {string|undefined} The last activated version of the addon */
|
|
37
|
+
let lastActivatedVersion;
|
|
38
|
+
/**
|
|
39
|
+
* Check if the addon should be activated by comparing the current version in the manifest with the last activated version.
|
|
40
|
+
* @returns {Promise<boolean>} True if the addon should be activated, false otherwise.
|
|
41
|
+
*/
|
|
42
|
+
async function shouldActivate() {
|
|
43
|
+
const manifest = await readManifest();
|
|
44
|
+
if (manifest.version === lastActivatedVersion) return false;
|
|
45
|
+
lastActivatedVersion = manifest.version;
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
36
49
|
async function main() {
|
|
37
50
|
const manifest = await readManifest();
|
|
38
51
|
const minimumSitevisionVersion = await getMinimumSitevisionVersion();
|
|
@@ -109,7 +122,7 @@ async function main() {
|
|
|
109
122
|
})));
|
|
110
123
|
|
|
111
124
|
if (args.activate) {
|
|
112
|
-
tasks.push(task('activate', activate()));
|
|
125
|
+
tasks.push(task('activate', activate(), shouldActivate));
|
|
113
126
|
}
|
|
114
127
|
}
|
|
115
128
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/build-app",
|
|
3
3
|
"description": "Script for building WebApps, RESTApps and Widgets with Svelte in Sitevision.",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.4",
|
|
5
5
|
"bin": {
|
|
6
6
|
"build-app": "./bin/index.js",
|
|
7
7
|
"sv-app-build": "./bin/index.js"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"svelte-preprocess": "6.0.3",
|
|
58
58
|
"tslib": "^2.8.1",
|
|
59
59
|
"@soleil-se/build-config": "^1.4.0",
|
|
60
|
-
"@soleil-se/build-utils": "^1.
|
|
60
|
+
"@soleil-se/build-utils": "^1.9.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"svelte": "^5.39.6",
|
|
@@ -17,8 +17,7 @@ export function getReplaceServerPlugin() {
|
|
|
17
17
|
"typeof process !== 'undefined' ? process.server : typeof window === 'undefined'": true,
|
|
18
18
|
'process.server': true,
|
|
19
19
|
'process.browser': false,
|
|
20
|
-
'import(
|
|
21
|
-
'import("node:crypto")': null,
|
|
20
|
+
'import(': 'dynamicImportError(',
|
|
22
21
|
preventAssignment: true,
|
|
23
22
|
delimiters: ['', ''],
|
|
24
23
|
});
|
package/rollup/server.js
CHANGED
|
@@ -60,7 +60,16 @@ export default function rollupServer({
|
|
|
60
60
|
bundleCache = cache && bundle.cache;
|
|
61
61
|
return bundle.write({
|
|
62
62
|
file: output,
|
|
63
|
-
intro:
|
|
63
|
+
intro: /* js */`
|
|
64
|
+
var Promise = Promise || { resolve: () => {} };
|
|
65
|
+
var global = global || this;
|
|
66
|
+
var self = self || global;
|
|
67
|
+
var globalThis = globalThis || global;
|
|
68
|
+
var setTimeout = setTimeout || function(cb) { cb() };
|
|
69
|
+
function dynamicImportError(moduleName) {
|
|
70
|
+
throw new Error('The module "' + moduleName + '" tried to be dynamically imported with "import", this is not supported in Rhino.');
|
|
71
|
+
}
|
|
72
|
+
`,
|
|
64
73
|
format: 'iife',
|
|
65
74
|
});
|
|
66
75
|
} catch (e) {
|