فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(A07): package offline Persian fonts and SheetJS instead of external CDNs
* fix(A07): remove external font and Excel startup CDN requests * fix(A07): bundle Persian font weights using local Fontsource assets * fix(A07): import SheetJS as locally bundled module * test(A07): verify local Excel roundtrip and no startup CDN * ci(A07): vendor pinned offline assets and verify packaging before commit * ci(A07): force-add vetted vendor tarball otherwise ignored by gitignore * build(A07): vendor offline SheetJS and Vazirmatn dependencies * chore(A07): remove one-time offline vendor bootstrap workflow after successful pinning --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
davoodmehraban89 committed
Oct 15, 2026 at 20:55 UTC
57f19fe582bd3bab5ea333a19104f17b934a45fc
8 files changed
+59
-50
index.html
-3
@@ -5,10 +5,7 @@
5
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
<meta name="theme-color" content="#0d9488" />
7
<title>Factor-easyPro | سامانه حسابداری و صدور فاکتور</title>
8
-
9
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/misc/Farsi-Digits/Vazirmatn-FD-font-face.css" />
8
<link rel="stylesheet" href="/src/styles/main.css" />
11
-<script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
9
<link rel="icon" href="data:,">
10
</head>
11
<body>
package-lock.json
+24
-46
@@ -9,9 +9,11 @@
9
"version": "2.0.3",
10
"license": "ISC",
11
"dependencies": {
12
+ "@fontsource/vazirmatn": "5.3.0",
13
"@tauri-apps/plugin-dialog": "2.7.3",
14
"@tauri-apps/plugin-fs": "2.5.2",
14
- "@tauri-apps/plugin-opener": "2.5.5"
15
+ "@tauri-apps/plugin-opener": "2.5.5",
16
+ "xlsx": "file:vendor/xlsx-0.20.3.tgz"
17
},
18
"devDependencies": {
19
"@tauri-apps/cli": "^2.11.4",
@@ -19,6 +21,15 @@
21
"vite": "^8.3.0"
22
}
23
},
24
+ "node_modules/@fontsource/vazirmatn": {
25
+ "version": "5.3.0",
26
+ "resolved": "https://registry.npmjs.org/@fontsource/vazirmatn/-/vazirmatn-5.3.0.tgz",
27
+ "integrity": "sha512-XC/2yN2r5gwhFT3klSuWaqncODX2DOfRYfNmbyzgtWYxHxMC+tcoaX+tgggrm6hSkEgpR1TuSDEf1PiI91G7qg==",
28
+ "license": "OFL-1.1",
29
+ "funding": {
30
+ "url": "https://github.com/sponsors/ayuhito"
31
+ }
32
+ },
33
"node_modules/@oxc-project/types": {
34
"version": "0.150.0",
35
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.150.0.tgz",
@@ -139,9 +150,6 @@
150
"arm64"
151
],
152
"dev": true,
142
- "libc": [
143
- "glibc"
144
- ],
153
"license": "MIT",
154
"optional": true,
155
"os": [
@@ -159,9 +167,6 @@
167
"arm64"
168
],
169
"dev": true,
162
- "libc": [
163
- "musl"
164
- ],
170
"license": "MIT",
171
"optional": true,
172
"os": [
@@ -179,9 +184,6 @@
184
"ppc64"
185
],
186
"dev": true,
182
- "libc": [
183
- "glibc"
184
- ],
187
"license": "MIT",
188
"optional": true,
189
"os": [
@@ -199,9 +201,6 @@
201
"s390x"
202
],
203
"dev": true,
202
- "libc": [
203
- "glibc"
204
- ],
204
"license": "MIT",
205
"optional": true,
206
"os": [
@@ -219,9 +218,6 @@
218
"x64"
219
],
220
"dev": true,
222
- "libc": [
223
- "glibc"
224
- ],
221
"license": "MIT",
222
"optional": true,
223
"os": [
@@ -239,9 +235,6 @@
235
"x64"
236
],
237
"dev": true,
242
- "libc": [
243
- "musl"
244
- ],
238
"license": "MIT",
239
"optional": true,
240
"os": [
@@ -408,9 +401,6 @@
401
"arm64"
402
],
403
"dev": true,
411
- "libc": [
412
- "glibc"
413
- ],
404
"license": "Apache-2.0 OR MIT",
405
"optional": true,
406
"os": [
@@ -428,9 +418,6 @@
418
"arm64"
419
],
420
"dev": true,
431
- "libc": [
432
- "musl"
433
- ],
421
"license": "Apache-2.0 OR MIT",
422
"optional": true,
423
"os": [
@@ -448,9 +435,6 @@
435
"riscv64"
436
],
437
"dev": true,
451
- "libc": [
452
- "glibc"
453
- ],
438
"license": "Apache-2.0 OR MIT",
439
"optional": true,
440
"os": [
@@ -468,9 +452,6 @@
452
"x64"
453
],
454
"dev": true,
471
- "libc": [
472
- "glibc"
473
- ],
455
"license": "Apache-2.0 OR MIT",
456
"optional": true,
457
"os": [
@@ -488,9 +469,6 @@
469
"x64"
470
],
471
"dev": true,
491
- "libc": [
492
- "musl"
493
- ],
472
"license": "Apache-2.0 OR MIT",
473
"optional": true,
474
"os": [
@@ -774,9 +752,6 @@
752
"arm64"
753
],
754
"dev": true,
777
- "libc": [
778
- "glibc"
779
- ],
755
"license": "MPL-2.0",
756
"optional": true,
757
"os": [
@@ -798,9 +773,6 @@
773
"arm64"
774
],
775
"dev": true,
801
- "libc": [
802
- "musl"
803
- ],
776
"license": "MPL-2.0",
777
"optional": true,
778
"os": [
@@ -822,9 +794,6 @@
794
"x64"
795
],
796
"dev": true,
825
- "libc": [
826
- "glibc"
827
- ],
797
"license": "MPL-2.0",
798
"optional": true,
799
"os": [
@@ -846,9 +815,6 @@
815
"x64"
816
],
817
"dev": true,
849
- "libc": [
850
- "musl"
851
- ],
818
"license": "MPL-2.0",
819
"optional": true,
820
"os": [
@@ -1110,6 +1076,18 @@
1076
"optional": true
1077
}
1078
}
1079
+ },
1080
+ "node_modules/xlsx": {
1081
+ "version": "0.20.3",
1082
+ "resolved": "file:vendor/xlsx-0.20.3.tgz",
1083
+ "integrity": "sha512-oLDq3jw7AcLqKWH2AhCpVTZl8mf6X2YReP+Neh0SJUzV/BdZYjth94tG5toiMB1PPrYtxOCfaoUCkvtuH+3AJA==",
1084
+ "license": "Apache-2.0",
1085
+ "bin": {
1086
+ "xlsx": "bin/xlsx.njs"
1087
+ },
1088
+ "engines": {
1089
+ "node": ">=0.8"
1090
+ }
1091
}
1092
}
1093
}
package.json
+3
-1
@@ -28,8 +28,10 @@
28
"vite": "^8.3.0"
29
},
30
"dependencies": {
31
+ "@fontsource/vazirmatn": "5.3.0",
32
"@tauri-apps/plugin-dialog": "2.7.3",
33
"@tauri-apps/plugin-fs": "2.5.2",
33
- "@tauri-apps/plugin-opener": "2.5.5"
34
+ "@tauri-apps/plugin-opener": "2.5.5",
35
+ "xlsx": "file:vendor/xlsx-0.20.3.tgz"
36
}
37
}
src/controllers/ExcelController.js
+1
@@ -2,6 +2,7 @@
2
// ExcelController — خروجی و ورودی Excel
3
// ============================================================
4
5
+import * as XLSX from 'xlsx';
6
import { StorageService } from '../core/StorageService.js';
7
import { Auth } from '../core/Auth.js';
8
import { DataScope } from '../core/DataScope.js';
src/main.js
+2
@@ -3,6 +3,8 @@
3
// ============================================================
4
5
import appPackage from '../package.json' with { type: 'json' };
6
+import '@fontsource/vazirmatn/400.css';
7
+import '@fontsource/vazirmatn/700.css';
8
import { SettingsView } from './views/SettingsView.js';
9
import { ChequesView } from './views/ChequesView.js';
10
import { TreasuryView } from './views/TreasuryView.js';
tests/a07-offline-bundled-assets.test.mjs
new
+28
@@ -0,0 +1,28 @@
1
+import test from 'node:test';
2
+import assert from 'node:assert/strict';
3
+import { readFileSync } from 'node:fs';
4
+import * as XLSX from 'xlsx';
5
+
6
+const read = path => readFileSync(new URL('../' + path, import.meta.url), 'utf8');
7
+
8
+test('A07: the app shell cannot block startup on a remote CDN', () => {
9
+ const html = read('index.html');
10
+ const entry = read('src/main.js');
11
+ const excel = read('src/controllers/ExcelController.js');
12
+ assert.doesNotMatch(html, /<script[^>]*src=["']https?:\/\//i);
13
+ assert.doesNotMatch(html, /<link[^>]*href=["']https?:\/\//i);
14
+ assert.match(entry, /@fontsource\/vazirmatn\/400\.css/);
15
+ assert.match(entry, /@fontsource\/vazirmatn\/700\.css/);
16
+ assert.match(excel, /import \* as XLSX from 'xlsx'/);
17
+});
18
+
19
+test('A07: bundled SheetJS can read and write Persian spreadsheets with integer currency', () => {
20
+ const sheet = XLSX.utils.aoa_to_sheet([['کالا','مبلغ'],['دفتر',125000]]);
21
+ const wb = XLSX.utils.book_new();
22
+ XLSX.utils.book_append_sheet(wb, sheet, 'اطلاعات');
23
+ const array = XLSX.write(wb, { bookType:'xlsx', type:'buffer' });
24
+ assert.ok(array.byteLength > 200);
25
+ const restored = XLSX.read(array, { type:'buffer' });
26
+ const rows = XLSX.utils.sheet_to_json(restored.Sheets['اطلاعات'], { header: 1 });
27
+ assert.deepEqual(rows, [['کالا','مبلغ'],['دفتر',125000]]);
28
+});
vendor/SHA256SUMS.txt
new
+1
@@ -0,0 +1 @@
1
+8dc73fc3b00203e72d176e85b50938627c7b086e607c682e8d3c22c02bb99fe8 xlsx-0.20.3.tgz
vendor/xlsx-0.20.3.tgz
Binary files /dev/null and b/vendor/xlsx-0.20.3.tgz differ