aid-installer 1.1.1 → 2.0.1

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/scripts/vendor.js DELETED
@@ -1,98 +0,0 @@
1
- #!/usr/bin/env node
2
- // vendor.js - Copy the aid-cli source files from the repo root into the npm package.
3
- //
4
- // Run automatically as the `prepack` npm script so `npm pack` and
5
- // `npm publish` always ship the current source.
6
- //
7
- // Source of truth is the repo root (two levels above packages/npm/).
8
- // Destination is packages/npm/{bin,lib,dashboard/,VERSION} (gitignored; generated at pack time).
9
- //
10
- // Files copied (mirrors release.sh Step-5 aid-cli bundle):
11
- // bin/aid -> packages/npm/bin/aid
12
- // bin/aid.ps1 -> packages/npm/bin/aid.ps1
13
- // bin/aid.cmd -> packages/npm/bin/aid.cmd
14
- // lib/aid-install-core.sh -> packages/npm/lib/aid-install-core.sh
15
- // lib/AidInstallCore.psm1 -> packages/npm/lib/AidInstallCore.psm1
16
- // VERSION -> packages/npm/VERSION
17
- //
18
- // Dashboard server+reader unit (12 files, curated -- excludes tests/ __pycache__ *.pyc README):
19
- // dashboard/home.html -> packages/npm/dashboard/home.html
20
- // dashboard/index.html -> packages/npm/dashboard/index.html
21
- // dashboard/reader/__init__.py -> packages/npm/dashboard/reader/__init__.py
22
- // dashboard/reader/reader.py -> packages/npm/dashboard/reader/reader.py
23
- // dashboard/reader/models.py -> packages/npm/dashboard/reader/models.py
24
- // dashboard/reader/parsers.py -> packages/npm/dashboard/reader/parsers.py
25
- // dashboard/reader/derivation.py -> packages/npm/dashboard/reader/derivation.py
26
- // dashboard/reader/locator.py -> packages/npm/dashboard/reader/locator.py
27
- // dashboard/server/server.py -> packages/npm/dashboard/server/server.py
28
- // dashboard/server/server.mjs -> packages/npm/dashboard/server/server.mjs
29
- // dashboard/server/reader.mjs -> packages/npm/dashboard/server/reader.mjs
30
- // dashboard/server/__init__.py -> packages/npm/dashboard/server/__init__.py
31
-
32
- 'use strict';
33
-
34
- var fs = require('fs');
35
- var path = require('path');
36
-
37
- // packages/npm/scripts/vendor.js is three levels below repo root.
38
- var repoRoot = path.join(__dirname, '..', '..', '..');
39
- var pkgRoot = path.join(__dirname, '..');
40
-
41
- var copies = [
42
- ['bin/aid', 'bin/aid'],
43
- ['bin/aid.ps1', 'bin/aid.ps1'],
44
- ['bin/aid.cmd', 'bin/aid.cmd'],
45
- ['lib/aid-install-core.sh', 'lib/aid-install-core.sh'],
46
- ['lib/AidInstallCore.psm1', 'lib/AidInstallCore.psm1'],
47
- ['VERSION', 'VERSION'],
48
- // Dashboard server+reader unit (12 files, curated).
49
- ['dashboard/home.html', 'dashboard/home.html'],
50
- ['dashboard/index.html', 'dashboard/index.html'],
51
- ['dashboard/reader/__init__.py', 'dashboard/reader/__init__.py'],
52
- ['dashboard/reader/reader.py', 'dashboard/reader/reader.py'],
53
- ['dashboard/reader/models.py', 'dashboard/reader/models.py'],
54
- ['dashboard/reader/parsers.py', 'dashboard/reader/parsers.py'],
55
- ['dashboard/reader/derivation.py', 'dashboard/reader/derivation.py'],
56
- ['dashboard/reader/locator.py', 'dashboard/reader/locator.py'],
57
- ['dashboard/server/server.py', 'dashboard/server/server.py'],
58
- ['dashboard/server/server.mjs', 'dashboard/server/server.mjs'],
59
- ['dashboard/server/reader.mjs', 'dashboard/server/reader.mjs'],
60
- ['dashboard/server/__init__.py', 'dashboard/server/__init__.py'],
61
- ];
62
-
63
- // Clean slate: remove any prior vendored payload (lib/ dir, dashboard/ dir, the vendored
64
- // bin scripts, VERSION) so stray runtime artifacts or files from an older version never
65
- // ship. Keep the committed shim bin/aid.js.
66
- try { fs.rmSync(path.join(pkgRoot, 'lib'), { recursive: true, force: true }); } catch (e) {}
67
- try { fs.rmSync(path.join(pkgRoot, 'dashboard'), { recursive: true, force: true }); } catch (e) {}
68
- ['bin/aid', 'bin/aid.ps1', 'bin/aid.cmd', 'VERSION'].forEach(function (f) {
69
- try { fs.rmSync(path.join(pkgRoot, f), { force: true }); } catch (e) {}
70
- });
71
-
72
- // Ensure destination directories exist.
73
- var dirs = ['bin', 'lib', 'dashboard/reader', 'dashboard/server'];
74
- for (var i = 0; i < dirs.length; i++) {
75
- var d = path.join(pkgRoot, dirs[i]);
76
- if (!fs.existsSync(d)) {
77
- fs.mkdirSync(d, { recursive: true });
78
- }
79
- }
80
-
81
- var ok = true;
82
- for (var j = 0; j < copies.length; j++) {
83
- var src = path.join(repoRoot, copies[j][0]);
84
- var dest = path.join(pkgRoot, copies[j][1]);
85
- try {
86
- fs.copyFileSync(src, dest);
87
- console.log('vendor: copied ' + copies[j][0] + ' -> packages/npm/' + copies[j][1]);
88
- } catch (e) {
89
- console.error('vendor: ERROR copying ' + src + ': ' + e.message);
90
- ok = false;
91
- }
92
- }
93
-
94
- if (!ok) {
95
- process.exit(1);
96
- }
97
-
98
- console.log('vendor: done. 18 files vendored into packages/npm/.');