@soleil-se/build-app 2.1.3 → 2.1.5

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 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.1.5] - 2025-02-28
8
+
9
+ - Kasta fel vid redirects då uppladdning av tillägg misslyckas och fastnar.
10
+
11
+ ## [2.1.4] - 2024-12-05
12
+
13
+ - Ta bort `babel-plugin-transform-async-to-promises` då det medför problem vid serverrendering.
14
+
7
15
  ## [2.1.3] - 2024-11-29
8
16
 
9
17
  - Lägg till `globalThis` i serverkontext.
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  Script for building WebApps, RESTApps and Widgets with Svelte in Sitevision.
4
4
 
5
- [Documentation](https://docs.soleil.se/build/app) | [Changelog](https://docs.soleil.se/build/app/changelog)
5
+ [Documentation](https://docs.soleil.se/build/build-app) | [Changelog](https://docs.soleil.se/build/build-app/changelog)
package/bin/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@soleil-se/build-app",
3
- "version": "2.1.3",
3
+ "description": "Script for building WebApps, RESTApps and Widgets with Svelte in Sitevision.",
4
+ "version": "2.1.5",
4
5
  "bin": {
5
6
  "build-app": "./bin/index.js",
6
7
  "sv-app-build": "./bin/index.js"
@@ -9,6 +10,13 @@
9
10
  "author": "Soleil AB",
10
11
  "license": "UNLICENSED",
11
12
  "type": "module",
13
+ "keywords": [
14
+ "sitevision",
15
+ "webapp",
16
+ "restapp",
17
+ "widget",
18
+ "svelte"
19
+ ],
12
20
  "engines": {
13
21
  "node": ">=20.0.0"
14
22
  },
@@ -24,13 +32,12 @@
24
32
  "@rollup/plugin-replace": "6.0.1",
25
33
  "@rollup/plugin-terser": "0.4.4",
26
34
  "archiver": "7.0.1",
27
- "babel-plugin-transform-async-to-promises": "0.8.18",
28
35
  "chalk": "5.3.0",
29
36
  "find-up": "7.0.0",
30
37
  "form-data": "4.0.1",
31
38
  "fs-extra": "11.2.0",
32
39
  "glob": "^11.0.0",
33
- "got": "14.4.4",
40
+ "got": "14.4.5",
34
41
  "gzip-size": "7.0.0",
35
42
  "lodash-es": "4.17.21",
36
43
  "minimist": "^1.2.8",
@@ -39,25 +46,20 @@
39
46
  "postcss-pxtorem": "6.1.0",
40
47
  "pretty-bytes": "6.1.1",
41
48
  "prompts": "2.4.2",
42
- "rollup": "4.27.2",
49
+ "rollup": "4.28.0",
43
50
  "rollup-plugin-postcss": "4.0.2",
44
51
  "rollup-plugin-string": "3.0.0",
45
52
  "rollup-plugin-svelte": "7.2.2",
46
53
  "slash": "5.1.0",
47
54
  "svelte-preprocess": "6.0.3",
48
55
  "@soleil-se/build-config": "1.3.0",
49
- "@soleil-se/build-utils": "1.8.0"
56
+ "@soleil-se/build-utils": "1.8.2"
50
57
  },
51
58
  "devDependencies": {
52
- "svelte": "5.1.3"
59
+ "svelte": "^5.6.2"
53
60
  },
54
- "scripts": {},
55
- "description": "Script for building WebApps, RESTApps and Widgets with Svelte in Sitevision.",
56
- "keywords": [
57
- "Sitevision",
58
- "WebApp",
59
- "RESTApp",
60
- "Widget",
61
- "Svelte"
62
- ]
61
+ "publishConfig": {
62
+ "access": "public"
63
+ },
64
+ "scripts": {}
63
65
  }
@@ -4,16 +4,22 @@ import config from '@soleil-se/build-config';
4
4
 
5
5
  const { name, host, auth, acceptUnauthorizedCert } = config.env;
6
6
 
7
- const [username, password] = Buffer.from(auth || '', 'base64').toString().split(':');
7
+ const [username, password] = Buffer.from(auth || '', 'base64').toString().split(/:(.*)/s);
8
8
 
9
9
  const options = {
10
- prefixUrl: `${host}/rest-api/1/0/${encodeURI(name)}/`,
11
- username,
12
- password,
10
+ prefixUrl: `${host}/rest-api/1/0/${encodeURIComponent(name)}/`,
11
+ username: encodeURIComponent(username),
12
+ password: encodeURIComponent(password),
13
13
  method: 'POST',
14
14
  responseType: 'json',
15
15
  resolveBodyOnly: true,
16
16
  hooks: {
17
+ beforeRedirect: [
18
+ () => {
19
+ // Addon upload won't work on redirect, throw error to stop the request
20
+ throw new Error('REDIRECT');
21
+ },
22
+ ],
17
23
  beforeError: [
18
24
  (error) => {
19
25
  const { response } = error;
@@ -22,7 +28,10 @@ const options = {
22
28
  let message = body && body.message ? body.message : body.toString();
23
29
  if (!message && response.statusCode === 401) {
24
30
  message = 'Unauthorized, correct username and password?';
31
+ } else if (response.statusCode >= 300 && response.statusCode < 400) {
32
+ message = `Request to '${response?.requestUrl?.origin}' was redirected to '${response?.redirectUrls[0]?.origin}', check if the site primary address is correct in config.`;
25
33
  }
34
+
26
35
  return new Error(`${response.statusCode} - ${message}`);
27
36
  }
28
37
  return new Error(error.message);
@@ -21,7 +21,7 @@ function getCertificate() {
21
21
  function getAuth() {
22
22
  const { auth } = config.webappSign || {};
23
23
  if (auth) {
24
- const [username, password] = Buffer.from(auth || '', 'base64').toString().split(':');
24
+ const [username, password] = Buffer.from(auth || '', 'base64').toString().split(/:(.*)/s);
25
25
  return { username, password };
26
26
  }
27
27
  return prompts([
@@ -44,8 +44,8 @@ async function signRequest(path) {
44
44
  return got({
45
45
  url: 'https://developer.sitevision.se/rest-api/appsigner/signapp',
46
46
  method: 'POST',
47
- username,
48
- password,
47
+ username: encodeURIComponent(username),
48
+ password: encodeURIComponent(password),
49
49
  searchParams: { certificateName: certificate },
50
50
  body: form,
51
51
  responseType: 'buffer',
@@ -28,7 +28,6 @@ export function getBabelClientPlugin() {
28
28
  export function getBabelServerPlugin() {
29
29
  return babel({
30
30
  ...commonOptions,
31
- plugins: ['babel-plugin-transform-async-to-promises'],
32
31
  presets: [
33
32
  ['@babel/preset-env', {
34
33
  exclude: ['@babel/plugin-transform-arrow-functions'],