@soleil-se/build-app 2.5.3 → 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.
Files changed (3) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/index.js +14 -1
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ 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
+
7
11
  ## [2.5.3] - 2025-02-06
8
12
 
9
13
  - Kasta fel vid dynamiska importer då dessa inte stöds i Rhino.
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.3",
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.8.3"
60
+ "@soleil-se/build-utils": "^1.9.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "svelte": "^5.39.6",