@preference-sl/prefconfigurator-wasm 0.1.57 → 0.1.59-beta.202509291322
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 +5 -9
- package/_framework/PrefConfigurator.Abstractions.6lzt7qgexf.wasm +0 -0
- package/_framework/PrefConfigurator.Abstractions.6lzt7qgexf.wasm.br +0 -0
- package/_framework/PrefConfigurator.Abstractions.6lzt7qgexf.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Abstractions.s6id4a28it.wasm +0 -0
- package/_framework/PrefConfigurator.Abstractions.s6id4a28it.wasm.br +0 -0
- package/_framework/PrefConfigurator.Abstractions.s6id4a28it.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Application.0iimu41vgx.wasm +0 -0
- package/_framework/PrefConfigurator.Application.0iimu41vgx.wasm.br +0 -0
- package/_framework/PrefConfigurator.Application.0iimu41vgx.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Application.4bp1xw2vcx.wasm +0 -0
- package/_framework/PrefConfigurator.Application.4bp1xw2vcx.wasm.br +0 -0
- package/_framework/PrefConfigurator.Application.4bp1xw2vcx.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Infrastructure.ghwh3g3pv2.wasm +0 -0
- package/_framework/PrefConfigurator.Infrastructure.ghwh3g3pv2.wasm.br +0 -0
- package/_framework/PrefConfigurator.Infrastructure.ghwh3g3pv2.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Infrastructure.m88dsgskqk.wasm +0 -0
- package/_framework/PrefConfigurator.Infrastructure.m88dsgskqk.wasm.br +0 -0
- package/_framework/PrefConfigurator.Infrastructure.m88dsgskqk.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Wasm.9agkeig53x.wasm +0 -0
- package/_framework/PrefConfigurator.Wasm.9agkeig53x.wasm.br +0 -0
- package/_framework/PrefConfigurator.Wasm.9agkeig53x.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Wasm.hwkfwxuiob.wasm +0 -0
- package/_framework/PrefConfigurator.Wasm.hwkfwxuiob.wasm.br +0 -0
- package/_framework/PrefConfigurator.Wasm.hwkfwxuiob.wasm.gz +0 -0
- package/_framework/blazor.boot.json +9 -9
- package/_framework/blazor.boot.json.br +0 -0
- package/_framework/blazor.boot.json.gz +0 -0
- package/main.js +1 -2
- package/package.json +3 -5
- package/scripts/postinstall.js +25 -70
package/README.md
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
# prefconfigurator-wasm
|
|
2
2
|
|
|
3
|
-
Upon install, postinstall copies into the consumer project:
|
|
3
|
+
Upon install, \postinstall\ copies into the consumer project:
|
|
4
4
|
|
|
5
|
-
- public/preference-sl/prefconfigurator-wasm/_framework
|
|
6
|
-
- public/preference-sl/prefconfigurator-wasm/main.js (if not present)
|
|
7
|
-
- public/preference-sl/prefconfigurator-wasm/index.demo.html (if not present
|
|
8
|
-
- public/preference-sl/prefconfigurator-wasm
|
|
9
|
-
|
|
10
|
-
Env vars:
|
|
11
|
-
- PUBLIC_DIR — destination root (auto-detects public, wwwroot, or src/assets if not set)
|
|
12
|
-
- WASM_SUBDIR — subfolder for runtime under the app folder (default _framework)
|
|
5
|
+
- \public/preference-sl/prefconfigurator-wasm/_framework\
|
|
6
|
+
- \public/preference-sl/prefconfigurator-wasm/main.js\ (if not present)
|
|
7
|
+
- \public/preference-sl/prefconfigurator-wasm/index.demo.html\ (if not present)
|
|
8
|
+
- Extra JS under \public/preference-sl/prefconfigurator-wasm/\ (without overwriting)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mainAssemblyName": "PrefConfigurator.Wasm",
|
|
3
3
|
"resources": {
|
|
4
|
-
"hash": "sha256-
|
|
4
|
+
"hash": "sha256-dIIwO9q3ORPn79hyNXrNZJtAE6gIBtfAq7Srf58bhy4=",
|
|
5
5
|
"fingerprinting": {
|
|
6
6
|
"Microsoft.CSharp.soa7iupusj.wasm": "Microsoft.CSharp.wasm",
|
|
7
7
|
"Microsoft.Extensions.Caching.Abstractions.9tfokavdri.wasm": "Microsoft.Extensions.Caching.Abstractions.wasm",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"Microsoft.Extensions.Options.bzdoshyjeq.wasm": "Microsoft.Extensions.Options.wasm",
|
|
35
35
|
"Microsoft.Extensions.Primitives.ii8zcoqmmf.wasm": "Microsoft.Extensions.Primitives.wasm",
|
|
36
36
|
"Newtonsoft.Json.ou6h2ikg0u.wasm": "Newtonsoft.Json.wasm",
|
|
37
|
-
"PrefConfigurator.Abstractions.
|
|
38
|
-
"PrefConfigurator.Application.
|
|
39
|
-
"PrefConfigurator.Infrastructure.
|
|
40
|
-
"PrefConfigurator.Wasm.
|
|
37
|
+
"PrefConfigurator.Abstractions.s6id4a28it.wasm": "PrefConfigurator.Abstractions.wasm",
|
|
38
|
+
"PrefConfigurator.Application.0iimu41vgx.wasm": "PrefConfigurator.Application.wasm",
|
|
39
|
+
"PrefConfigurator.Infrastructure.ghwh3g3pv2.wasm": "PrefConfigurator.Infrastructure.wasm",
|
|
40
|
+
"PrefConfigurator.Wasm.hwkfwxuiob.wasm": "PrefConfigurator.Wasm.wasm",
|
|
41
41
|
"Preference.Hydra.OpenApi.oba396x8m7.wasm": "Preference.Hydra.OpenApi.wasm",
|
|
42
42
|
"System.Collections.Concurrent.kq7l3koqtq.wasm": "System.Collections.Concurrent.wasm",
|
|
43
43
|
"System.Collections.NonGeneric.u4veqqwbpo.wasm": "System.Collections.NonGeneric.wasm",
|
|
@@ -134,10 +134,10 @@
|
|
|
134
134
|
"Microsoft.Extensions.Options.bzdoshyjeq.wasm": "sha256-OUMXYxUKhNC6l0LAh4xpi+gy+X9b0XXW3pZh9YdZ9C8=",
|
|
135
135
|
"Microsoft.Extensions.Primitives.ii8zcoqmmf.wasm": "sha256-Jt5QBSXSDEahiZ89Pn1MhJ9A3C/ftN8ZXaBGV9JgqwQ=",
|
|
136
136
|
"Newtonsoft.Json.ou6h2ikg0u.wasm": "sha256-8EZ4H5Mb5yxuavrUzuw5k75ewxJQbdU+Y1rksETqPVo=",
|
|
137
|
-
"PrefConfigurator.Abstractions.
|
|
138
|
-
"PrefConfigurator.Application.
|
|
139
|
-
"PrefConfigurator.Infrastructure.
|
|
140
|
-
"PrefConfigurator.Wasm.
|
|
137
|
+
"PrefConfigurator.Abstractions.s6id4a28it.wasm": "sha256-VKmg2p/yXfU7r8ZsIPMfSfMMPKkfJvqNC8+eozyDFZo=",
|
|
138
|
+
"PrefConfigurator.Application.0iimu41vgx.wasm": "sha256-KEXIrHi0NBNgaz092LvIljwjZHsQ+Dz0G/J27Dtq0tY=",
|
|
139
|
+
"PrefConfigurator.Infrastructure.ghwh3g3pv2.wasm": "sha256-TK7zeguQLSaqMLnvW+V/ZoxvImf732fWInya1+XhqCo=",
|
|
140
|
+
"PrefConfigurator.Wasm.hwkfwxuiob.wasm": "sha256-kbsG/dDDx68FoMVPiRRiC2DfpMc8yz22yA2Qpl5PlJI=",
|
|
141
141
|
"Preference.Hydra.OpenApi.oba396x8m7.wasm": "sha256-BOitG9XqTGoVdagU40GvNefDuOylKCPs3Gp5VG0M3oY=",
|
|
142
142
|
"System.Collections.Concurrent.kq7l3koqtq.wasm": "sha256-lDJetX8MOCPfYgq+j+JjNEwEFA9oW7BLaaNmAFUZQaE=",
|
|
143
143
|
"System.Collections.NonGeneric.u4veqqwbpo.wasm": "sha256-Hlfxail2eLYOSROomwSdgZ3zfxPgxeQCs+6AiZn4uBE=",
|
|
Binary file
|
|
Binary file
|
package/main.js
CHANGED
package/package.json
CHANGED
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
"postinstall": "node scripts/postinstall.js"
|
|
4
4
|
},
|
|
5
5
|
"description": ".NET WebAssembly runtime package that centralizes logic for building product configurators, exposing a simple API for integration into ecommerce platforms.",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.59-beta.202509291322",
|
|
7
7
|
"files": [
|
|
8
8
|
"_framework/**",
|
|
9
|
-
"
|
|
10
|
-
"main.js",
|
|
9
|
+
"**/*.js",
|
|
11
10
|
"index.html",
|
|
12
|
-
"README.md"
|
|
13
|
-
"**/*.js"
|
|
11
|
+
"README.md"
|
|
14
12
|
],
|
|
15
13
|
"author": "Alex Moreno Palacio \u003camoreno@preference.es\u003e",
|
|
16
14
|
"name": "@preference-sl/prefconfigurator-wasm",
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,101 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
2
|
const fs = require("fs");
|
|
4
3
|
const path = require("path");
|
|
5
4
|
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const dir = stack.pop();
|
|
10
|
-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
11
|
-
const abs = path.join(dir, entry.name);
|
|
12
|
-
if (entry.isDirectory()) stack.push(abs);
|
|
13
|
-
else if (entry.isFile()) onFile(abs);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function ensureDir(p) {
|
|
19
|
-
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function copyFileIfAbsent(src, dest) {
|
|
23
|
-
if (!fs.existsSync(dest)) {
|
|
24
|
-
ensureDir(dest);
|
|
25
|
-
fs.copyFileSync(src, dest);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
5
|
+
function walk(root, cb){ const st=[root]; while(st.length){ const d=st.pop(); for(const e of fs.readdirSync(d,{withFileTypes:true})){ const a=path.join(d,e.name); if(e.isDirectory()) st.push(a); else if(e.isFile()) cb(a); }}}
|
|
6
|
+
function ensureDir(p){ fs.mkdirSync(path.dirname(p), { recursive: true }); }
|
|
7
|
+
function copyIfAbsent(src,dst){ if(!fs.existsSync(dst)){ ensureDir(dst); fs.copyFileSync(src,dst); } }
|
|
28
8
|
|
|
29
|
-
try
|
|
9
|
+
try{
|
|
30
10
|
const pkgRoot = __dirname ? path.resolve(__dirname, "..") : process.cwd();
|
|
31
11
|
const srcFramework = path.join(pkgRoot, "_framework");
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
12
|
+
const srcMain = path.join(pkgRoot, "main.js");
|
|
13
|
+
const srcIndex = path.join(pkgRoot, "index.html");
|
|
35
14
|
const consumerRoot = process.env.INIT_CWD || process.env.npm_config_local_prefix || process.cwd();
|
|
36
15
|
|
|
37
16
|
const candidates = [process.env.PUBLIC_DIR, "public", "wwwroot", path.join("src","assets")].filter(Boolean);
|
|
38
17
|
let targetPublic = null;
|
|
39
|
-
for (const c of candidates)
|
|
18
|
+
for (const c of candidates){
|
|
40
19
|
const abs = path.isAbsolute(c) ? c : path.resolve(consumerRoot, c);
|
|
41
20
|
if (fs.existsSync(abs)) { targetPublic = abs; break; }
|
|
42
21
|
}
|
|
43
22
|
if (!targetPublic) targetPublic = path.resolve(consumerRoot, "public");
|
|
44
23
|
|
|
45
|
-
// Siempre bajo public/preference-sl/<nombrepaquete>, y <nombrepaquete> en minúsculas
|
|
46
24
|
const packageName = "prefconfigurator-wasm".toLowerCase();
|
|
47
|
-
const
|
|
48
|
-
const destRoot = path.join(targetPublic,
|
|
25
|
+
const ns = "preference-sl";
|
|
26
|
+
const destRoot = path.join(targetPublic, ns, packageName);
|
|
49
27
|
|
|
50
28
|
const wasmSubdir = process.env.WASM_SUBDIR || "_framework";
|
|
51
29
|
const destFramework = path.join(destRoot, wasmSubdir);
|
|
52
30
|
|
|
53
|
-
// 1)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
59
|
-
const s = path.join(src, entry.name);
|
|
60
|
-
const d = path.join(dest, entry.name);
|
|
61
|
-
if (entry.isDirectory()) copyRecursive(s, d);
|
|
62
|
-
else if (entry.isFile()) fs.copyFileSync(s, d);
|
|
63
|
-
}
|
|
64
|
-
})(srcFramework, destFramework);
|
|
31
|
+
// 1) Runtime
|
|
32
|
+
(function copyR(src,dst){ if(!fs.existsSync(src)) return; fs.mkdirSync(dst,{recursive:true});
|
|
33
|
+
for(const e of fs.readdirSync(src,{withFileTypes:true})){ const s=path.join(src,e.name); const d=path.join(dst,e.name);
|
|
34
|
+
if(e.isDirectory()) copyR(s,d); else if(e.isFile()) fs.copyFileSync(s,d);
|
|
35
|
+
}})(srcFramework, destFramework);
|
|
65
36
|
|
|
66
37
|
// 2) main.js (no overwrite)
|
|
67
|
-
const
|
|
68
|
-
if (fs.existsSync(
|
|
69
|
-
fs.mkdirSync(destRoot, { recursive: true });
|
|
70
|
-
fs.copyFileSync(srcMainJs, destMainJs);
|
|
71
|
-
console.log(`[${path.basename(pkgRoot)}] Installed main.js at ${destMainJs}`);
|
|
72
|
-
}
|
|
38
|
+
const destMain = path.join(destRoot, "main.js");
|
|
39
|
+
if (fs.existsSync(srcMain) && !fs.existsSync(destMain)){ fs.mkdirSync(destRoot,{recursive:true}); fs.copyFileSync(srcMain, destMain); }
|
|
73
40
|
|
|
74
41
|
// 3) index.html -> index.demo.html (no overwrite)
|
|
75
|
-
const
|
|
76
|
-
if (fs.existsSync(
|
|
77
|
-
fs.mkdirSync(destRoot, { recursive: true });
|
|
78
|
-
fs.copyFileSync(srcIndexHtml, destIndexDemo);
|
|
79
|
-
console.log(`[${path.basename(pkgRoot)}] Installed index.demo.html at ${destIndexDemo}`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// 4) Copiar TODOS los .js fuera de _framework y sin sobreescribir, preservando estructura.
|
|
83
|
-
console.log(`[${path.basename(pkgRoot)}] Copying extra JS -> ${destRoot}`);
|
|
84
|
-
const excludeAbs = new Set([
|
|
85
|
-
path.join(pkgRoot, "main.js"),
|
|
86
|
-
path.join(pkgRoot, "index.html"),
|
|
87
|
-
path.join(pkgRoot, "scripts", "postinstall.js"),
|
|
88
|
-
]);
|
|
42
|
+
const destDemo = path.join(destRoot, "index.demo.html");
|
|
43
|
+
if (fs.existsSync(srcIndex) && !fs.existsSync(destDemo)){ fs.mkdirSync(destRoot,{recursive:true}); fs.copyFileSync(srcIndex, destDemo); }
|
|
89
44
|
|
|
90
|
-
|
|
45
|
+
// 4) Extra JS fuera de _framework, sin sobrescribir
|
|
46
|
+
const exclude = new Set([ path.join(pkgRoot,"main.js"), path.join(pkgRoot,"index.html"), path.join(pkgRoot,"scripts","postinstall.js") ]);
|
|
47
|
+
walk(pkgRoot, (abs)=>{
|
|
91
48
|
if (!abs.toLowerCase().endsWith(".js")) return;
|
|
92
49
|
if (abs.startsWith(path.join(pkgRoot, "_framework"))) return;
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const dest = path.join(destRoot, rel);
|
|
97
|
-
copyFileIfAbsent(abs, dest);
|
|
50
|
+
if (exclude.has(abs)) return;
|
|
51
|
+
const rel = path.relative(pkgRoot, abs);
|
|
52
|
+
copyIfAbsent(abs, path.join(destRoot, rel));
|
|
98
53
|
});
|
|
99
|
-
} catch (err)
|
|
54
|
+
} catch (err){
|
|
100
55
|
console.warn(`[postinstall] Warning: copy failed: ${err && (err.message || err)}`);
|
|
101
56
|
}
|