@ade-syofyan/feature-map-pro 0.21.0-pro.1 → 0.21.0-pro.2

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 CHANGED
@@ -11,8 +11,9 @@ Masukkan email pembelian dan kode lisensi dari Ade Syofyan. Anda juga bisa memak
11
11
  `--license-file /path/to/buyer.license`. Jangan memasukkan kode ke argumen command.
12
12
  Setelah aktif, buka sesi agent baru. Status: `npx @ade-syofyan/feature-map-pro@preview license status`.
13
13
 
14
- Rilis preview ini menyediakan binary macOS Apple Silicon, diuji pada mesin build.
15
- Platform lain ditolak sampai paketnya tersedia. Node 20+, tar, Git, serta Python 3
14
+ Platform yang tersedia tercantum di release.json: macOS Apple Silicon, Windows x64,
15
+ dan Linux x64 (glibc, Ubuntu 22.04 atau lebih baru). Windows ARM, Linux ARM dan
16
+ Alpine/musl belum didukung. Windows memakai tar bawaan Windows 10/11. Node 20+, tar, Git, serta Python 3
16
17
  untuk hook/core Free diperlukan. Installer memasang skill Codex; `--activate-only`
17
18
  mengaktifkan tanpa memasang skill. Plugin Claude Code dapat dipasang manual dari
18
19
  folder paket melalui pengelola plugin, dengan satu sumber feature-map aktif.
package/lib/installer.mjs CHANGED
@@ -33,7 +33,7 @@ export function verifyChecksum(data,expected) {
33
33
  return true;
34
34
  }
35
35
  export function validateArchiveNames(listing) {
36
- const names=listing.split('\n').filter(Boolean);
36
+ const names=listing.split(/\r?\n/).filter(Boolean);
37
37
  if(!names.length) throw new Error('Arsip kosong.');
38
38
  for(const name of names) {
39
39
  if(!/^feature-map-pro\/(?:[A-Za-z0-9._+@/-]*)$/.test(name)||name.split('/').some(p=>p==='..'||p==='.'))
@@ -67,10 +67,10 @@ export async function download(entry) {
67
67
  }
68
68
  throw new Error('Terlalu banyak redirect unduhan.');
69
69
  }
70
- export function enginePath(root) { return path.join(root,'runtime','engine','feature-map-engine'); }
71
- function engineValid(root,entry) {
70
+ export function enginePath(root,platform=process.platform) { return path.join(root,'runtime','engine',platform==='win32'?'feature-map-engine.exe':'feature-map-engine'); }
71
+ function engineValid(root,entry,platform) {
72
72
  try {
73
- const file=enginePath(root);
73
+ const file=enginePath(root,platform);
74
74
  if(fs.lstatSync(file).isSymbolicLink()||!fs.statSync(file).isFile()) return false;
75
75
  verifyChecksum(fs.readFileSync(file),entry.engine_sha256);return true;
76
76
  } catch {return false;}
@@ -80,13 +80,13 @@ function tar(args) {
80
80
  if(result.error||result.status!==0) throw new Error('Paket tidak bisa dibaca. Pastikan tar tersedia.');
81
81
  return result.stdout;
82
82
  }
83
- export async function ensurePayload(manifest,{home=process.env.FEATURE_MAP_PRO_HOME||path.join(os.homedir(),'.local','share','feature-map-pro'),fetchArtifact=download}={}) {
84
- const entry=selectArtifact(manifest);
85
- const base=path.resolve(home,'releases',manifest.version,`${process.platform}-${process.arch}`);
83
+ export async function ensurePayload(manifest,{home=process.env.FEATURE_MAP_PRO_HOME||path.join(os.homedir(),'.local','share','feature-map-pro'),fetchArtifact=download,platform=process.platform,arch=process.arch}={}) {
84
+ const entry=selectArtifact(manifest,platform,arch);
85
+ const base=path.resolve(home,'releases',manifest.version,`${platform}-${arch}`);
86
86
  const root=path.join(base,'feature-map-pro');
87
87
  const marker=path.join(base,'artifact.sha256');
88
88
  if(fs.existsSync(base)&&fs.lstatSync(base).isSymbolicLink()) throw new Error('Folder instalasi tidak boleh berupa symlink.');
89
- if(fs.existsSync(marker)&&fs.readFileSync(marker,'utf8')===entry.sha256&&engineValid(root,entry)) return root;
89
+ if(fs.existsSync(marker)&&fs.readFileSync(marker,'utf8')===entry.sha256&&engineValid(root,entry,platform)) return root;
90
90
  const parent=path.dirname(base);fs.mkdirSync(parent,{recursive:true});
91
91
  const staging=fs.mkdtempSync(path.join(parent,'.download-'));
92
92
  try {
@@ -94,12 +94,12 @@ export async function ensurePayload(manifest,{home=process.env.FEATURE_MAP_PRO_H
94
94
  const data=await fetchArtifact(entry);verifyChecksum(data,entry.sha256);
95
95
  const archive=path.join(staging,'download.tar.gz');fs.writeFileSync(archive,data,{mode:0o600});
96
96
  validateArchiveNames(tar(['-tzf',archive]));
97
- const types=tar(['-tvzf',archive]).split('\n').filter(Boolean);
97
+ const types=tar(['-tvzf',archive]).split(/\r?\n/).filter(Boolean);
98
98
  if(types.some(line=>!['-','d'].includes(line[0]))) throw new Error('Arsip mengandung link atau file khusus.');
99
99
  const extracted=path.join(staging,'extracted');fs.mkdirSync(extracted);
100
100
  tar(['-xzf',archive,'-C',extracted,'--no-same-owner']);
101
101
  const extractedRoot=path.join(extracted,'feature-map-pro');
102
- if(!engineValid(extractedRoot,entry)) throw new Error('Mesin Pro tidak cocok dengan rilis.');
102
+ if(!engineValid(extractedRoot,entry,platform)) throw new Error('Mesin Pro tidak cocok dengan rilis.');
103
103
  const previous=base+'.previous-'+randomUUID();
104
104
  const hadPrevious=fs.existsSync(base);
105
105
  if(hadPrevious) fs.renameSync(base,previous);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ade-syofyan/feature-map-pro",
3
- "version": "0.21.0-pro.1",
3
+ "version": "0.21.0-pro.2",
4
4
  "description": "Installer and launcher for licensed Feature Map Pro",
5
5
  "private": false,
6
6
  "type": "module",
@@ -18,10 +18,10 @@
18
18
  "node": ">=20"
19
19
  },
20
20
  "scripts": {
21
- "test": "node --test test/*.test.mjs"
21
+ "test": "node --test test/installer.test.mjs"
22
22
  },
23
23
  "author": "Ade Syofyan <ade.syofyan@gmail.com>",
24
- "license": "UNLICENSED",
24
+ "license": "SEE LICENSE IN LICENSE",
25
25
  "publishConfig": {
26
26
  "access": "public",
27
27
  "tag": "preview"
package/release.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "version": "0.21.0-pro.1",
3
+ "version": "0.21.0-pro.2",
4
4
  "artifacts": {
5
5
  "darwin-arm64": {
6
- "sha256": "5e085062ed806199dede8fc6c1fe522d4957439d1760693139d7823239f6bd66",
7
- "engine_sha256": "d5ec8f011975718bedaf1c7ff6368b13d1500210566c966da87e47f2d887b942",
8
- "size": 14049315,
9
- "url": "https://github.com/ade-syofyan/feature-map-installer/releases/download/v0.21.0-pro.1/feature-map-pro-0.21.0-pro.1-darwin-arm64.tar.gz"
6
+ "sha256": "fa90315978ee367eb169fb885d360d8e9830769752105e050eb7f95ac49b5a7d",
7
+ "engine_sha256": "189d9b537742f508de6bc2a296245a19d9422e91ce56edf7c55a9fee033266df",
8
+ "size": 14320567,
9
+ "url": "https://github.com/ade-syofyan/feature-map-installer/releases/download/v0.21.0-pro.2/feature-map-pro-0.21.0-pro.2-darwin-arm64.tar.gz"
10
+ },
11
+ "linux-x64": {
12
+ "sha256": "39bf4a0c239c0de291c27c7d7e684fef795f2de5e855072bc46868f2832c7ba4",
13
+ "engine_sha256": "5da00bbd833bc15c3ad0d98017e0a7127df861ac446455768b23b2950f7fee1a",
14
+ "size": 18223616,
15
+ "url": "https://github.com/ade-syofyan/feature-map-installer/releases/download/v0.21.0-pro.2/feature-map-pro-0.21.0-pro.2-linux-x64.tar.gz"
16
+ },
17
+ "win32-x64": {
18
+ "sha256": "948db51f8583753b68dd64d92db4f333601f4c51f9585e8924e2ab71f75c1ca0",
19
+ "engine_sha256": "9a4c4cb6cbe767eb02b9afa9a5e2425194ac6de6f2f593bd716ad53f87424ece",
20
+ "size": 11664438,
21
+ "url": "https://github.com/ade-syofyan/feature-map-installer/releases/download/v0.21.0-pro.2/feature-map-pro-0.21.0-pro.2-win32-x64.tar.gz"
10
22
  }
11
23
  }
12
24
  }