Skip to content

Commit b495edf

Browse files
authored
Migrated npm package to Typescript. (#242)
Fixes #240 and #239
1 parent e54be23 commit b495edf

24 files changed

+2743
-909
lines changed

scripts/package-npm.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,37 @@ try
135135
if ($LASTEXITCODE -ne 0) {
136136
Write-Warning "npm clean failed, continuing..."
137137
}
138+
139+
# Install dependencies and compile TypeScript
140+
Write-Host "[NPM] Installing dependencies..." -ForegroundColor Blue
141+
npm ci
142+
if ($LASTEXITCODE -ne 0) {
143+
Write-Error "npm ci failed"
144+
Pop-Location
145+
exit 1
146+
}
147+
148+
Write-Host "[NPM] Running format check, lint, and compile..." -ForegroundColor Blue
149+
npm run format:check
150+
if ($LASTEXITCODE -ne 0) {
151+
Write-Error "Format check failed - run 'npm run format' to fix"
152+
Pop-Location
153+
exit 1
154+
}
155+
156+
npm run lint
157+
if ($LASTEXITCODE -ne 0) {
158+
Write-Error "Lint failed"
159+
Pop-Location
160+
exit 1
161+
}
162+
163+
npm run compile
164+
if ($LASTEXITCODE -ne 0) {
165+
Write-Error "TypeScript compilation failed"
166+
Pop-Location
167+
exit 1
168+
}
138169

139170
# Backup original package.json
140171
Write-Host "[NPM] Setting package version to $Version..." -ForegroundColor Blue

src/winapp-npm/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ generated
88

99
# Ignore built CLI binaries (generated by npm run build)
1010
bin/
11+
12+
# Ignore TypeScript compiled output
13+
dist/
14+
15+
# Node modules
16+
node_modules/

src/winapp-npm/.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ obj/
77
.vs/
88
.vscode/
99

10+
# Exclude TypeScript source files (dist/ is included via package.json files field)
11+
*.ts
12+
tsconfig.json
13+
1014
# Exclude git files
1115
.git*
1216

@@ -20,6 +24,7 @@ tmp/
2024
test/
2125
tests/
2226
*.test.js
27+
*.test.ts
2328

2429
# Exclude CI/build scripts that aren't needed for end users
2530
.github/

src/winapp-npm/.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dist/
2+
bin/
3+
node_modules/
4+
*.exe
5+
*.pdb
6+
addon-template/
7+
cs-addon-template/

src/winapp-npm/.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 120,
7+
"bracketSpacing": true,
8+
"arrowParens": "always",
9+
"endOfLine": "auto"
10+
}

src/winapp-npm/buildtools-utils.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)