@ojokesusu/lintasai 1.1.3 → 1.2.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/CHANGELOG.md +70 -0
- package/bin/lintasai.js +16 -2
- package/docs/NPX_INSTALL.md +217 -0
- package/kit.ps1 +179 -6
- package/lib/kit-files.psd1 +0 -1
- package/package.json +1 -1
- package/tests/npx-init.Tests.ps1 +237 -0
- package/tests/package-bundle.Tests.ps1 +130 -0
- package/tests/setup-pola-b.Tests.ps1 +288 -0
- package/uninstall.ps1 +25 -3
- package/update-kit.ps1 +15 -2
- package/FIRST_SESSION_PROMPT_v1.md +0 -7
package/uninstall.ps1
CHANGED
|
@@ -63,9 +63,21 @@ param(
|
|
|
63
63
|
[switch]$DeleteAgents,
|
|
64
64
|
[switch]$KeepKit,
|
|
65
65
|
[switch]$Yes,
|
|
66
|
-
[switch]$AllowProjectRootMismatch
|
|
66
|
+
[switch]$AllowProjectRootMismatch,
|
|
67
|
+
[string]$ProjectRoot = $null
|
|
67
68
|
)
|
|
68
69
|
|
|
70
|
+
# ---- Resolve $ProjectRoot early (param-driven, fallback to script location) ----
|
|
71
|
+
# Kalau user pass -ProjectRoot via param (npx wrapper / smoke test / CI), TRUST it sebagai
|
|
72
|
+
# ground truth -- $PSBoundParameters check supaya kita honor explicit param meski empty string.
|
|
73
|
+
# Kalau tidak di-supply, derive dari $PSScriptRoot (script ada di .claude-kit\, parent = project root).
|
|
74
|
+
if ($PSBoundParameters.ContainsKey('ProjectRoot') -and $ProjectRoot) {
|
|
75
|
+
$ProjectRoot = (Resolve-Path $ProjectRoot -ErrorAction Stop).Path
|
|
76
|
+
} else {
|
|
77
|
+
$ProjectRoot = Split-Path -Parent $PSScriptRoot
|
|
78
|
+
}
|
|
79
|
+
Write-Host "Root proyek : $ProjectRoot"
|
|
80
|
+
|
|
69
81
|
# ---- Deprecation handling: -Force jadi alias backward-compat untuk -AllowModified ----
|
|
70
82
|
# Sebelumnya -Force overloaded (modified bypass + signature bypass). Pisahkan supaya
|
|
71
83
|
# intent jelas. -Force masih bekerja untuk backward-compat tapi warn user.
|
|
@@ -81,8 +93,8 @@ if ($Force) {
|
|
|
81
93
|
$ErrorActionPreference = 'Stop'
|
|
82
94
|
|
|
83
95
|
# ---- Resolve folder kit (tempat script ini berada) ----
|
|
96
|
+
# $ProjectRoot sudah di-resolve di awal (param-driven). Jangan override.
|
|
84
97
|
$KitDir = if ($PSScriptRoot) { $PSScriptRoot } elseif ($MyInvocation.MyCommand.Path) { Split-Path -Parent $MyInvocation.MyCommand.Path } else { (Get-Location).Path }
|
|
85
|
-
$ProjectRoot = Split-Path -Parent $KitDir
|
|
86
98
|
$ProjectName = Split-Path -Leaf $ProjectRoot
|
|
87
99
|
$Timestamp = Get-Date -Format 'yyyyMMdd-HHmmss'
|
|
88
100
|
|
|
@@ -270,8 +282,12 @@ if ($schemaVersion -ne 1) {
|
|
|
270
282
|
# ---- Sanity check: project_root manifest match folder kit saat ini? ----
|
|
271
283
|
# Default HARD-FAIL untuk mencegah manifest dari project lain delete file di project ini.
|
|
272
284
|
# Override pakai -AllowProjectRootMismatch (mis. legitimate rename folder).
|
|
285
|
+
#
|
|
286
|
+
# GUARD: Kalau -ProjectRoot di-supply EXPLICIT via param (npx/CI/wrapper mode), TRUST it
|
|
287
|
+
# sebagai ground truth -- skip mismatch check (caller sudah explicit override).
|
|
273
288
|
$manifestProjectRoot = [string]$manifest.project_root
|
|
274
|
-
|
|
289
|
+
$projectRootSupplied = $PSBoundParameters.ContainsKey('ProjectRoot')
|
|
290
|
+
if (-not $projectRootSupplied -and $manifestProjectRoot -and $manifestProjectRoot -ne $ProjectRoot -and $manifestProjectRoot -ne '<PROJECT_ROOT>') {
|
|
275
291
|
Write-Host ''
|
|
276
292
|
if (-not $AllowProjectRootMismatch) {
|
|
277
293
|
Write-Host 'ABORT: Project root di manifest TIDAK match lokasi sekarang.' -ForegroundColor Red
|
|
@@ -294,6 +310,12 @@ if ($manifestProjectRoot -and $manifestProjectRoot -ne $ProjectRoot -and $manife
|
|
|
294
310
|
Write-Host ' Script pakai lokasi sekarang ($ProjectRoot) sebagai base.' -ForegroundColor Yellow
|
|
295
311
|
Write-Host ''
|
|
296
312
|
}
|
|
313
|
+
} elseif ($projectRootSupplied -and $manifestProjectRoot -and $manifestProjectRoot -ne $ProjectRoot -and $manifestProjectRoot -ne '<PROJECT_ROOT>') {
|
|
314
|
+
Write-Host ''
|
|
315
|
+
Write-Host 'INFO: -ProjectRoot di-supply explicit, manifest project_root override di-skip.' -ForegroundColor DarkGray
|
|
316
|
+
Write-Host " Manifest installed di : $manifestProjectRoot" -ForegroundColor DarkGray
|
|
317
|
+
Write-Host " Param -ProjectRoot : $ProjectRoot (ground truth)" -ForegroundColor DarkGray
|
|
318
|
+
Write-Host ''
|
|
297
319
|
}
|
|
298
320
|
|
|
299
321
|
# ---- Setup canonical project root (consumed by lib/safety.ps1 helpers) ----
|
package/update-kit.ps1
CHANGED
|
@@ -70,11 +70,22 @@ param(
|
|
|
70
70
|
[switch]$DryRun,
|
|
71
71
|
[switch]$AllowUntrustedRepo,
|
|
72
72
|
[switch]$Force,
|
|
73
|
-
[switch]$AllowUnsignedTag
|
|
73
|
+
[switch]$AllowUnsignedTag,
|
|
74
|
+
[string]$ProjectRoot = $null
|
|
74
75
|
)
|
|
75
76
|
|
|
76
77
|
$ErrorActionPreference = 'Stop'
|
|
77
78
|
|
|
79
|
+
# ---- Resolve $ProjectRoot early (param-driven, fallback to script location) ----
|
|
80
|
+
# Kalau user pass -ProjectRoot pakai itu (untuk smoke test / CI). Kalau tidak, derive dari
|
|
81
|
+
# $PSScriptRoot (script ada di .claude-kit\, parent = project root).
|
|
82
|
+
if (-not $ProjectRoot) {
|
|
83
|
+
$ProjectRoot = Split-Path -Parent $PSScriptRoot
|
|
84
|
+
} else {
|
|
85
|
+
$ProjectRoot = (Resolve-Path $ProjectRoot -ErrorAction Stop).Path
|
|
86
|
+
}
|
|
87
|
+
Write-Host "Root proyek : $ProjectRoot"
|
|
88
|
+
|
|
78
89
|
# ---- Deprecation handling: -Force jadi alias backward-compat untuk -AllowUntrustedRepo ----
|
|
79
90
|
# Sebelumnya -Force overloaded (GPG bypass + RepoUrl bypass). GPG bypass sekarang lewat
|
|
80
91
|
# -AllowUnsignedTag; -Force narrowed jadi alias RepoUrl-allowlist-bypass saja, dengan warn.
|
|
@@ -89,9 +100,11 @@ if ($Force) {
|
|
|
89
100
|
}
|
|
90
101
|
|
|
91
102
|
# ---- Resolve paths (do this FIRST, sebelum Move-Item rename folder) ----
|
|
103
|
+
# $ProjectRoot (PascalCase) sudah di-resolve dari param di awal. $projectRoot (camelCase)
|
|
104
|
+
# di-alias supaya legacy code di bawah tetap jalan tanpa rename massal.
|
|
92
105
|
$kitDir = if ($PSScriptRoot) { $PSScriptRoot } elseif ($MyInvocation.MyCommand.Path) { Split-Path -Parent $MyInvocation.MyCommand.Path } else { (Get-Location).Path }
|
|
93
106
|
$kitFolderName = Split-Path -Leaf $kitDir
|
|
94
|
-
$projectRoot =
|
|
107
|
+
$projectRoot = $ProjectRoot
|
|
95
108
|
$timestamp = Get-Date -Format 'yyyyMMdd-HHmmss'
|
|
96
109
|
$backupDir = "$kitDir.backup-$timestamp"
|
|
97
110
|
|