cornhsu-polymigrate 1.1.2 → 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.
Files changed (2) hide show
  1. package/README.md +31 -6
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -13,10 +13,12 @@ PolyMigrate turns legacy dynamic sites (old PHP sites and the like) into clean,
13
13
  Markdown — and it treats multilingual content as a first-class concern, not an afterthought.
14
14
  Config-driven, fully offline-rerunnable, built on .NET.
15
15
 
16
- **Status: 1.0.** The extraction pipeline, pairing, verification, thumbnails and orphan-page
17
- recovery are complete and validated against a real full-site migration (see below). The CLI
18
- surface and the Phase output contracts are now stable: new features bump the minor version,
19
- fixes bump the patch version.
16
+ **Status: 2.0.** The extraction pipeline, pairing, verification, thumbnails and orphan-page
17
+ recovery are complete and validated against a real full-site migration (see below). The **CLI
18
+ surface and the Phase output contracts remain stable** (unchanged since 1.0): new features bump
19
+ the minor version, fixes bump the patch. 2.0 is an engineering release — it narrowed the
20
+ `Cornhsu.PolyMigrate.Core` public .NET API to its intended entry points and removed unused
21
+ config fields; see the [CHANGELOG](CHANGELOG.md) for the migration notes.
20
22
 
21
23
  ## Why
22
24
 
@@ -98,6 +100,9 @@ polymigrate probe-orphans site.yaml --section news --years 2021-2023
98
100
  polymigrate fetch-orphans site.yaml --section news
99
101
  ```
100
102
 
103
+ > No .NET? Every command above also runs with **zero install** via npm — just prefix it:
104
+ > `npx cornhsu-polymigrate extract site.yaml`, `npx cornhsu-polymigrate verify out/`, and so on.
105
+
101
106
  One YAML config per site describes everything site-specific — see
102
107
  [examples/ibps-austin.yaml](examples/ibps-austin.yaml) for a fully-annotated real example.
103
108
 
@@ -112,18 +117,38 @@ url_pattern:
112
117
  extract:
113
118
  content: "section[id]:not(#header):not(#footer)"
114
119
  pairing:
115
- strategy: symmetric_path
116
120
  fallback: [shared_media, date, title_similarity]
117
121
  ```
118
122
 
123
+ ## Use as a library
124
+
125
+ The CLI is a thin shell over `Cornhsu.PolyMigrate.Core`. To drive a migration from your own
126
+ .NET code, use the `PolyMigrator` facade — the single documented entry point:
127
+
128
+ ```
129
+ dotnet add package Cornhsu.PolyMigrate.Core
130
+ ```
131
+
132
+ ```csharp
133
+ using PolyMigrate.Core;
134
+
135
+ var migrator = PolyMigrator.FromConfigFile("site.yaml");
136
+ var report = migrator.Extract("out/"); // out/raw, out/media -> out/content + inventories
137
+ if (report.HasErrors) { /* unsafe paths were skipped; see path_issues.csv */ }
138
+
139
+ var verify = PolyMigrator.Verify("out/"); // no config needed; reads Phase 2 output only
140
+ Console.WriteLine($"{verify.Errors} errors, {verify.Warnings} warnings");
141
+ ```
142
+
119
143
  ## Layout
120
144
 
121
145
  | Path | Contents |
122
146
  |---|---|
123
147
  | `src/PolyMigrate.Core` | extraction / pairing / verification library (NuGet: `Cornhsu.PolyMigrate.Core`) |
124
148
  | `src/PolyMigrate.Cli` | the `polymigrate` CLI (NuGet tool package: `Cornhsu.PolyMigrate`) |
125
- | `tests/` | 119 unit/integration tests + an offline fixture site with golden-file baselines |
149
+ | `tests/` | unit/integration tests + an offline fixture site with golden-file baselines |
126
150
  | `docs/contracts.md` | file-format contracts between pipeline phases |
151
+ | `docs/搬遷工具_評估與規劃書.md` | the original design/planning doc (the `§X.Y` references throughout the source point here) |
127
152
 
128
153
  ## Development
129
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cornhsu-polymigrate",
3
- "version": "1.1.2",
3
+ "version": "2.0.1",
4
4
  "description": "The i18n-first static-site migrator — the only one that pairs your multilingual pages automatically. Mirrors a legacy site into frontmatter Markdown, auto-matches language versions, and honestly lists what it could not pair.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -35,9 +35,9 @@
35
35
  "node": ">=18"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@cornhsu/polymigrate-win32-x64": "1.1.2",
39
- "@cornhsu/polymigrate-linux-x64": "1.1.2",
40
- "@cornhsu/polymigrate-darwin-x64": "1.1.2",
41
- "@cornhsu/polymigrate-darwin-arm64": "1.1.2"
38
+ "@cornhsu/polymigrate-win32-x64": "2.0.1",
39
+ "@cornhsu/polymigrate-linux-x64": "2.0.1",
40
+ "@cornhsu/polymigrate-darwin-x64": "2.0.1",
41
+ "@cornhsu/polymigrate-darwin-arm64": "2.0.1"
42
42
  }
43
43
  }