Browse Source

Updated the build system

main v6.0.0
Cédric Belin 6 months ago
parent
commit
0c5130fe3e
11 changed files with 11 additions and 47 deletions
  1. +5
    -3
      package.json
  2. +2
    -1
      src/web_storage.ts
  3. +2
    -2
      tool/clean.ps1
  4. +0
    -4
      tool/coverage.ps1
  5. +1
    -2
      tool/dist.ps1
  6. +0
    -6
      tool/doc.ps1
  7. +0
    -4
      tool/lint.ps1
  8. +0
    -10
      tool/publish.ps1
  9. +0
    -4
      tool/test.ps1
  10. +0
    -10
      tool/upgrade.ps1
  11. +1
    -1
      tool/watch.ps1

+ 5
- 3
package.json View File

@ -77,11 +77,13 @@
},
"scripts": {
"build": "ng build",
"clean": "pwsh tool/clean.ps1",
"coverage": "coveralls var/lcov.info",
"doc": "compodoc --config=etc/compodoc.yaml",
"doc": "compodoc --config=etc/compodoc.yaml && mkdocs build --config-file=etc/mkdocs.yaml",
"lint": "eslint --config=etc/eslint.yaml src/**/*.ts",
"prepack": "pwsh tool/build.ps1",
"prepack": "npm run build && pwsh tool/dist.ps1",
"prepublishOnly": "npm run clean",
"test": "ng test"
"test": "ng test",
"watch": "pwsh tool/watch.ps1"
}
}

+ 2
- 1
src/web_storage.ts View File

@ -1,7 +1,8 @@
import {OnDestroy} from "@angular/core";
import {Injectable, OnDestroy} from "@angular/core";
import {fromEvent, Observable, Subject, Subscription} from "rxjs";
/** Provides access to the [Web Storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage). */
@Injectable()
export abstract class WebStorage implements Iterable<[string, string|undefined]>, OnDestroy {
/** The handler of "change" events. */


+ 2
- 2
tool/clean.ps1 View File

@ -3,7 +3,7 @@ Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
foreach ($item in "build", "doc/api", "lib", "www") {
if (Test-Path $item) { Remove-Item $item -Recurse }
if (Test-Path $item) { Remove-Item $item -Force -Recurse }
}
Get-ChildItem var -Exclude .gitkeep | Remove-Item -Recurse
Get-ChildItem var -Exclude .gitkeep | Remove-Item -Force -Recurse

+ 0
- 4
tool/coverage.ps1 View File

@ -1,4 +0,0 @@
#!/usr/bin/env pwsh
Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
node_modules/.bin/coveralls var/lcov.info

tool/build.ps1 → tool/dist.ps1 View File

@ -2,7 +2,6 @@
Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
node_modules/.bin/ng build
if (-not (Test-Path lib)) { New-Item lib -ItemType Directory | Out-Null }
$regex = '(export|import)\s+(.+)\s+from\s+"((?!.*\.js)\.[^"]+)"'
@ -15,4 +14,4 @@ foreach ($item in Get-ChildItem build -File -Filter "*.d.ts") {
Copy-Item $item "lib/$($item.Name)"
}
Remove-Item build -Recurse
Remove-Item build -Force -Recurse

+ 0
- 6
tool/doc.ps1 View File

@ -1,6 +0,0 @@
#!/usr/bin/env pwsh
Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
node_modules/.bin/compodoc --config=etc/compodoc.yaml
mkdocs build --config-file=etc/mkdocs.yaml

+ 0
- 4
tool/lint.ps1 View File

@ -1,4 +0,0 @@
#!/usr/bin/env pwsh
Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
node_modules/.bin/eslint --config=etc/eslint.yaml src/**/*.ts

+ 0
- 10
tool/publish.ps1 View File

@ -1,10 +0,0 @@
#!/usr/bin/env pwsh
Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
tool/clean.ps1
npm publish
$version = (Get-Content package.json | ConvertFrom-Json).version
git tag "v$version"
git push origin "v$version"

+ 0
- 4
tool/test.ps1 View File

@ -1,4 +0,0 @@
#!/usr/bin/env pwsh
Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
node_modules/.bin/ng test

+ 0
- 10
tool/upgrade.ps1 View File

@ -1,10 +0,0 @@
#!/usr/bin/env pwsh
Set-StrictMode -Version Latest
Set-Location (Split-Path $PSScriptRoot)
git reset --hard
git fetch --all --prune
git pull --rebase
npm install --ignore-scripts --production=false
npm update --dev

+ 1
- 1
tool/watch.ps1 View File

@ -7,7 +7,7 @@ $action = {
if ($EventArgs.Name -notlike "*.g.ts") {
$changeType = [String] $EventArgs.ChangeType
Write-Host "'$($EventArgs.Name)' was $($changeType.ToLower()): starting a new build..."
$timeSpan = Measure-Command { tool/build.ps1 }
$timeSpan = Measure-Command { npm run build 2>&1 | Out-Host }
Write-Host "> Finished the build after $($timeSpan.TotalSeconds) seconds."
}
}


Loading…
Cancel
Save