costaff-workspace 0.1.1 → 0.1.3

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
@@ -2,91 +2,180 @@
2
2
 
3
3
  **English** · [繁體中文](README.zh-TW.md)
4
4
 
5
- Publish documents, decks and workbooks to [CoStaff Workspace](https://workspace.costaffs.app),
6
- and pull their source back out to keep working on them.
5
+ Turn a document you built on your own machine into a link you can send someone.
7
6
 
8
- Built for projects made with [open-doc](https://github.com/simonliu-ai-product/open-doc),
9
- open-slide and open-sheet.
7
+ Works with projects made using [open-doc](https://github.com/simonliu-ai-product/open-doc)
8
+ (documents), open-slide (decks) and open-sheet (workbooks).
9
+
10
+ ---
11
+
12
+ ## 1. Install it
13
+
14
+ You need [Node.js](https://nodejs.org) 20 or newer. Check with `node -v`.
10
15
 
11
16
  ```bash
12
17
  npm i -g costaff-workspace
18
+ ```
13
19
 
20
+ Confirm it is there:
21
+
22
+ ```bash
23
+ costaff-workspace --help
24
+ ```
25
+
26
+ <details>
27
+ <summary>If the command is not found</summary>
28
+
29
+ Your shell cannot see where npm puts global commands. `npm prefix -g` prints
30
+ that folder; add its `bin` to your `PATH`. With pnpm, run `pnpm setup` once.
31
+ </details>
32
+
33
+ ## 2. Build your project
34
+
35
+ Publishing sends the **built** files, so build first.
36
+
37
+ ```bash
14
38
  cd my-doc
39
+ pnpm install
40
+ pnpm build
41
+ ```
42
+
43
+ You should now have a `dist/` folder. If your project builds somewhere else,
44
+ remember the name — you will pass it in step 3.
45
+
46
+ ## 3. Push
47
+
48
+ ```bash
15
49
  costaff-workspace push
16
50
  ```
17
51
 
18
- That is the whole command. In a project folder it works the rest out: the folder
19
- name is the slug, `package.json` says whether this is a document, a deck or a
20
- workbook, `dist/` is the built bundle, and the source travels with it so the file
21
- can be pulled back and edited. Every guess is printed, and a guess it cannot make
22
- stops the push rather than inventing something.
52
+ ### The first time, it asks you to sign in
53
+
54
+ ```
55
+ Sign in to CoStaff Workspace
56
+ open https://workspace.costaffs.app/activate?code=WXYZ-1234
57
+ code WXYZ-1234
58
+ ```
59
+
60
+ Open that address in a browser. **The code is already in the link**, so you only
61
+ have to approve it. The command waits, then carries on by itself.
23
62
 
24
- The first push shows a device code to authorise in a browser. That machine stays
25
- signed in afterwards.
63
+ This machine stays signed in. You will not see this again.
26
64
 
27
- ## Commands
65
+ ### Then it publishes
66
+
67
+ ```
68
+ 4 documents — one bundle each
69
+ getting-started → https://workspace.costaffs.app/dcuk0lmf875ctrgxfppa
70
+ q3-numbers → https://workspace.costaffs.app/8fjq2ldk3nx7yrpv0aet
71
+ team-offsite → https://workspace.costaffs.app/pv0aet8fjq2ldk3nx7yr
72
+ budget-2027 → https://workspace.costaffs.app/3nx7yrpv0aet8fjq2ldk
73
+ ```
74
+
75
+ Those links are the files. Send one to someone and they can read it.
76
+
77
+ ## 4. Manage what you published
78
+
79
+ Go to **<https://workspace.costaffs.app>** to rename files, put them in folders,
80
+ and decide who may read each one.
81
+
82
+ > **A newly pushed file is private.** Only you can open it until you say
83
+ > otherwise in the file manager. Sending someone the link is not enough — you
84
+ > invite them, or you turn the file into a public link, there.
85
+
86
+ ---
87
+
88
+ ## Doing it again
89
+
90
+ **You changed something.** Build and push again. **The link stays the same** —
91
+ whoever you sent it to sees the new version.
92
+
93
+ ```bash
94
+ pnpm build && costaff-workspace push
95
+ ```
96
+
97
+ **You are on a different computer.** Fetch the project back with the token — the
98
+ last part of the link:
99
+
100
+ ```bash
101
+ costaff-workspace pull dcuk0lmf875ctrgxfppa my-doc
102
+ cd my-doc
103
+ pnpm install
104
+ ```
105
+
106
+ What comes back is a complete project. Edit it, build it, push it, and the same
107
+ link updates.
108
+
109
+ **You want to check before publishing.** This packages everything and reports
110
+ what it would send, without uploading and without needing a network:
28
111
 
29
112
  ```bash
30
- costaff-workspace push # push this folder
31
- costaff-workspace pull <token> [dir] # fetch a published file's source
32
- costaff-workspace login # sign this machine in
33
- costaff-workspace logout # forget this machine's sign-in
113
+ costaff-workspace push --dry-run
34
114
  ```
35
115
 
36
- Useful flags on `push`:
116
+ ---
117
+
118
+ ## You usually pass no options at all
37
119
 
38
- | Flag | |
120
+ Run in a project folder, `push` works out the rest and **prints every guess**:
121
+
122
+ ```
123
+ guessed --slug my-report --kind deck --source-dir .
124
+ ```
125
+
126
+ | It guesses | From |
39
127
  | --- | --- |
40
- | `--slug`, `--kind`, `--title` | override a guess |
41
- | `--site-dir <dir>` | the built bundle (default `dist`) |
42
- | `--no-source` | publish the bundle alone — nothing can be pulled back out of it |
43
- | `--dry-run` | package and report, without uploading or needing a network |
44
- | `--endpoint <url>` | a receiver you run yourself |
128
+ | the file's identity (`--slug`) | the folder's name |
129
+ | document, deck or workbook (`--kind`) | what your `package.json` depends on |
130
+ | the built files (`--site-dir`) | `dist` |
131
+ | the title | your `package.json` description, else the slug |
45
132
 
46
- ## A project is a site of many documents
133
+ If a guess is wrong, pass that one option. If it cannot guess at all it stops and
134
+ says so, rather than inventing something.
47
135
 
48
- An open-doc project is not one file — it is a site holding several documents
49
- under `docs/`, and one `open-doc build` puts all of their chunks in a single
50
- `assets/` directory. So `push` builds each document into a bundle of its own and
51
- pushes them one at a time.
136
+ ### Options
52
137
 
53
- That is not tidiness. A share can only withhold the rest of a workspace if the
54
- rest of the workspace is not in the bundle: inside a shared build, anyone holding
55
- a link to one document can fetch the chunks of the others. The cost is real — N
56
- builds instead of one, and assets repeated across them.
138
+ | Option | Use it when |
139
+ | --- | --- |
140
+ | `--title "Q3 report"` | you want a different name in the file manager |
141
+ | `--slug q3-report` | the folder name is not the identity you want |
142
+ | `--kind document\|deck\|workbook` | it guessed the wrong kind |
143
+ | `--site-dir build` | your build output is not in `dist` |
144
+ | `--dry-run` | you want to check before sending |
145
+ | `--no-source` | you want to publish the built files alone |
57
146
 
58
- ## The protocol is public
147
+ `costaff-workspace push --help` lists all of them.
59
148
 
60
- `src/protocol.ts` is a specification, not an implementation detail. Anyone can
61
- run their own receiver and point `--endpoint` at it; `COSTAFF_WORKSPACE_ENDPOINT`
62
- does the same thing for a whole shell.
149
+ ---
63
150
 
64
- Adding a required field is a breaking change for every third-party receiver, so
65
- optional is the default. `source` is optional: a push without it is still valid,
66
- and a receiver that ignores it still serves. `pull` is optional in the discovery
67
- document — a receiver that cannot hand source back omits the field rather than
68
- answering 404 to a command the CLI thought it had.
151
+ ## Worth knowing
69
152
 
70
- ## What travels with the source
153
+ **Your source goes up too, and that is on purpose.** It is what lets `pull` hand
154
+ you a working project back later, on any machine. `node_modules` and dotfiles are
155
+ never collected — **your `.env` does not travel**. `--no-source` opts out, and
156
+ then nothing can be pulled back out of that file afterwards.
71
157
 
72
- `node_modules` and dotfiles are not collected. `.env` is inside that.
158
+ **A project with several documents takes longer than one build.** Each document
159
+ is built into a bundle of its own. It has to be: inside one shared build, anyone
160
+ you send a single document to can reach all the others.
73
161
 
74
- Local dependency specs (`link:`, `file:`, `workspace:`, `portal:`) are replaced
75
- with the version actually installed, because a path on the author's disk exists
76
- on no other machine. A version that cannot be resolved refuses the push — a
77
- published path nobody can resolve buys an install failure that talks about a
78
- missing directory instead of a broken dependency.
162
+ **A file someone shared with you comes back as a copy.** It carries no link, so
163
+ pushing it publishes it under your own account. The original is untouched.
79
164
 
80
- ## What comes back depends on who you are
165
+ ---
81
166
 
82
- The server decides, not the client.
167
+ ## When something goes wrong
83
168
 
84
- | | You get | Pushing it back |
85
- | --- | --- | --- |
86
- | Owner | includes the token | updates the same link |
87
- | Shared with you | no token | publishes at a new link of your own; the original is untouched |
169
+ | It says | What it means, and what to do |
170
+ | --- | --- |
171
+ | `No site at dist build it first.` | There is nothing built to publish. Run your project's build. |
172
+ | `dist has no index.html it is not a publishable site.` | The build ran but produced no page. Check your build settings. |
173
+ | `cannot make a slug out of the folder name` | The folder's name has no letters or digits usable as an identity — a folder named in Chinese, for example. Pass `--slug my-report`. |
174
+ | `Sign in first — run with --login.` | Run `costaff-workspace login`. |
175
+ | `Sign-in code expired.` / `Sign-in timed out.` | The code only lasts a few minutes. Just push again for a new one. |
176
+ | `… is not a CoStaff Workspace endpoint` | The service could not be reached — check your connection, then try again. |
177
+ | `No file at that token.` | Wrong token, or the file is not yours and was not shared with you. |
88
178
 
89
- Two clients each deciding who owns a file would eventually disagree.
90
179
 
91
180
  ## Licence
92
181
 
package/README.zh-TW.md CHANGED
@@ -2,83 +2,171 @@
2
2
 
3
3
  [English](README.md) · **繁體中文**
4
4
 
5
- 把文件、簡報、試算表發佈到 [CoStaff Workspace](https://workspace.costaffs.app),
6
- 以及把原始碼取回來繼續改。
5
+ 把你在自己電腦上做好的文件,變成一條可以傳給別人的連結。
7
6
 
8
- [open-doc](https://github.com/simonliu-ai-product/open-doc)、open-slide、
9
- open-sheet 做的專案而寫。
7
+ 適用於用 [open-doc](https://github.com/simonliu-ai-product/open-doc)(文件)
8
+ open-slide(簡報)、open-sheet(試算表)做的專案。
9
+
10
+ ---
11
+
12
+ ## 1. 安裝
13
+
14
+ 需要 [Node.js](https://nodejs.org) 20 以上。用 `node -v` 確認。
10
15
 
11
16
  ```bash
12
17
  npm i -g costaff-workspace
18
+ ```
13
19
 
20
+ 確認裝好了:
21
+
22
+ ```bash
23
+ costaff-workspace --help
24
+ ```
25
+
26
+ <details>
27
+ <summary>如果顯示「找不到指令」</summary>
28
+
29
+ 你的 shell 看不到 npm 放全域指令的地方。`npm prefix -g` 會印出那個資料夾,把它底下的
30
+ `bin` 加進 `PATH`。如果你用 pnpm,跑一次 `pnpm setup` 就好。
31
+ </details>
32
+
33
+ ## 2. 先建置你的專案
34
+
35
+ 發佈送出去的是**建置後的檔案**,所以要先建置。
36
+
37
+ ```bash
14
38
  cd my-doc
39
+ pnpm install
40
+ pnpm build
41
+ ```
42
+
43
+ 跑完應該會出現一個 `dist/` 資料夾。如果你的專案輸出到別的地方,記住那個名字,
44
+ 第 3 步會用到。
45
+
46
+ ## 3. 推上去
47
+
48
+ ```bash
15
49
  costaff-workspace push
16
50
  ```
17
51
 
18
- 指令就這一行。在專案資料夾裡它會把其餘的推斷出來:資料夾名字是 slug、`package.json`
19
- 說出這是文件還是簡報還是試算表、`dist/` 是建置產物,原始碼也跟著走,所以之後拉得回來改。
20
- **每一個猜測都會印出來**,而猜不出來的時候它會停下來,不會憑空編一個。
52
+ ### 第一次會請你登入
53
+
54
+ ```
55
+ Sign in to CoStaff Workspace
56
+ open https://workspace.costaffs.app/activate?code=WXYZ-1234
57
+ code WXYZ-1234
58
+ ```
59
+
60
+ 用瀏覽器打開那個網址。**驗證碼已經在網址裡**,所以你只要按同意。指令會自己等著,
61
+ 授權完就繼續。
21
62
 
22
- 第一次推會顯示裝置授權碼,在瀏覽器授權後那台機器就記住登入。
63
+ 這台機器之後就記住登入了,不會再問。
23
64
 
24
- ## 指令
65
+ ### 然後它就發佈了
66
+
67
+ ```
68
+ 4 documents — one bundle each
69
+ getting-started → https://workspace.costaffs.app/dcuk0lmf875ctrgxfppa
70
+ q3-numbers → https://workspace.costaffs.app/8fjq2ldk3nx7yrpv0aet
71
+ team-offsite → https://workspace.costaffs.app/pv0aet8fjq2ldk3nx7yr
72
+ budget-2027 → https://workspace.costaffs.app/3nx7yrpv0aet8fjq2ldk
73
+ ```
74
+
75
+ 那些連結就是檔案本身。傳一條給別人,他就能讀。
76
+
77
+ ## 4. 管理你發佈的東西
78
+
79
+ 到 **<https://workspace.costaffs.app>** 改名字、分資料夾,以及決定每一份誰可以看。
80
+
81
+ > **剛推上去的檔案是私人的。** 在檔案管理員裡設定之前,只有你打得開。
82
+ > **光是把連結傳給別人是不夠的**——你要在那裡邀請他,或是把檔案改成公開連結。
83
+
84
+ ---
85
+
86
+ ## 之後要再做的事
87
+
88
+ **你改了內容。** 重新建置再推一次。**連結不會變**——你傳出去的那條會直接看到新版本。
89
+
90
+ ```bash
91
+ pnpm build && costaff-workspace push
92
+ ```
93
+
94
+ **你換了一台電腦。** 用 token(連結的最後一段)把專案取回來:
95
+
96
+ ```bash
97
+ costaff-workspace pull dcuk0lmf875ctrgxfppa my-doc
98
+ cd my-doc
99
+ pnpm install
100
+ ```
101
+
102
+ 拿回來的是一個完整的專案。改完、建置、推上去,同一條連結就更新了。
103
+
104
+ **你想在發佈前先確認。** 這會把東西打包好並回報要送出什麼,但不上傳,也不需要網路:
25
105
 
26
106
  ```bash
27
- costaff-workspace push # 推這個資料夾
28
- costaff-workspace pull <token> [dir] # 把某份已發佈檔案的原始碼取回來
29
- costaff-workspace login # 這台機器登入
30
- costaff-workspace logout # 忘掉這台機器的登入
107
+ costaff-workspace push --dry-run
31
108
  ```
32
109
 
33
- `push` 常用的旗標:
110
+ ---
111
+
112
+ ## 你通常一個參數都不用打
34
113
 
35
- | 旗標 | |
114
+ 在專案資料夾裡執行,`push` 會自己推斷,而且**每一個猜測都會印出來**:
115
+
116
+ ```
117
+ guessed --slug my-report --kind deck --source-dir .
118
+ ```
119
+
120
+ | 它會猜 | 依據 |
36
121
  | --- | --- |
37
- | `--slug`、`--kind`、`--title` | 蓋掉某一個猜測 |
38
- | `--site-dir <dir>` | 建置產物的位置(預設 `dist`) |
39
- | `--no-source` | 只推產物——之後就拉不回來改了 |
40
- | `--dry-run` | 只打包並回報,不上傳,也不需要網路 |
41
- | `--endpoint <url>` | 指向你自己架的 receiver |
122
+ | 檔案的身分(`--slug`) | 資料夾的名字 |
123
+ | 是文件、簡報還是試算表(`--kind`) | `package.json` 裡的相依套件 |
124
+ | 建置產物在哪(`--site-dir`) | `dist` |
125
+ | 標題 | `package.json` 的 description,沒有就用 slug |
42
126
 
43
- ## 一個專案是「一個站台含多份文件」
127
+ 猜錯就只補那一個參數。**完全猜不出來的時候它會停下來說明,不會憑空編一個。**
44
128
 
45
- open-doc 專案不是一份檔案,是一個站台底下有好幾份文件(`docs/`),而一次
46
- `open-doc build` 會把它們的 chunk 全部放進同一個 `assets/`。所以 `push` 會**把每一份
47
- 各自建置成獨立的 bundle**,再一份一份推。
129
+ ### 參數
48
130
 
49
- 這不是為了整齊。**分享設定唯一能擋住其餘東西的方式,是其餘的東西根本不在那個 bundle 裡**:
50
- 共用的建置產物裡,拿到其中一份連結的人就能抓到其他份的 chunk。代價是真的——N 次建置
51
- 而不是一次,資產也在各個 bundle 之間重複。
131
+ | 參數 | 什麼時候用 |
132
+ | --- | --- |
133
+ | `--title "第三季報告"` | 你想在檔案管理員裡顯示別的名字 |
134
+ | `--slug q3-report` | 資料夾名字不是你要的身分 |
135
+ | `--kind document\|deck\|workbook` | 它猜錯種類了 |
136
+ | `--site-dir build` | 你的建置產物不在 `dist` |
137
+ | `--dry-run` | 想先確認再送出 |
138
+ | `--no-source` | 只想發佈建置後的檔案 |
52
139
 
53
- ## 協定是公開的
140
+ `costaff-workspace push --help` 會列出全部。
54
141
 
55
- `src/protocol.ts` 是規格,不是實作細節。任何人都可以架自己的 receiver 並用
56
- `--endpoint` 指過去;`COSTAFF_WORKSPACE_ENDPOINT` 則是整個 shell 都指過去。
142
+ ---
57
143
 
58
- **加一個必填欄位,對每一個第三方 receiver 都是破壞性變更**,所以預設一律是選填。
59
- `source` 是選填的:不帶它的推送依然有效,忽略它的 receiver 依然能提供服務。`pull` 在
60
- 探索文件裡也是選填——不提供的 receiver 直接不寫這個欄位,而不是對 CLI 以為能用的指令回 404。
144
+ ## 值得知道的幾件事
61
145
 
62
- ## 原始碼會帶走什麼
146
+ **原始碼也會一起上去,那是刻意的。** 那正是之後 `pull` 能在任何機器上還你一個
147
+ 可以直接跑的專案的原因。`node_modules` 和點開頭的檔案永遠不會被收進去——
148
+ **你的 `.env` 不會跟著走**。`--no-source` 可以不送,但那之後這份檔案就拉不回來了。
63
149
 
64
- `node_modules` 和點開頭的檔案不會被收進去,`.env` 就在那個範圍裡。
150
+ **多份文件的專案會比單次建置久。** 每一份文件都會被建成獨立的 bundle。這是必要的:
151
+ 在一份共用的建置產物裡,你只傳一份給別人,他就能拿到其他全部。
65
152
 
66
- 本機的相依規格(`link:`、`file:`、`workspace:`、`portal:`)會被換成**實際安裝的版本**,
67
- 因為作者硬碟上的那條路徑在任何別的機器上都不存在。解不出版本就**拒絕推送**——把一條
68
- 沒人解得開的路徑發佈出去,換來的是一個講「找不到某個目錄」的安裝失敗,而不是講
69
- 「這個相依套件有問題」。
153
+ **別人分享給你的檔案,拉回來是一份副本。** 它不帶連結,所以推上去會發佈在你自己的
154
+ 帳號底下,原件不受影響。
70
155
 
71
- ## 拉回來的東西取決於你是誰
156
+ ---
72
157
 
73
- 伺服器決定,不是客戶端問。
158
+ ## 出問題的時候
74
159
 
75
- | | 拿到 | 推回去會 |
76
- | --- | --- | --- |
77
- | 擁有者 | token | 更新同一條連結 |
78
- | 被分享的人 | 不含 token | 在自己這邊產生新連結,原件不動 |
160
+ | 它說 | 意思,以及怎麼辦 |
161
+ | --- | --- |
162
+ | `No site at dist — build it first.` | 沒有建置產物可以發佈。先跑專案的建置指令。 |
163
+ | `dist has no index.html — it is not a publishable site.` | 建置有跑,但沒有產出頁面。檢查建置設定。 |
164
+ | `cannot make a slug out of the folder name` | 資料夾名字裡沒有可以當身分的英數字——例如中文資料夾名。加上 `--slug my-report`。 |
165
+ | `Sign in first — run with --login.` | 執行 `costaff-workspace login`。 |
166
+ | `Sign-in code expired.` / `Sign-in timed out.` | 驗證碼只有幾分鐘有效。再推一次就會拿到新的。 |
167
+ | `… is not a CoStaff Workspace endpoint` | 連不上服務 —— 檢查一下網路再試一次。 |
168
+ | `No file at that token.` | token 不對,或這份檔案不是你的、也沒有分享給你。 |
79
169
 
80
- 兩個客戶端如果各自判斷誰是擁有者,遲早會有一個判斷錯,而那個錯就是有人覆蓋掉不屬於
81
- 自己的文件。
82
170
 
83
171
  ## 授權
84
172
 
package/dist/cli.js CHANGED
@@ -152,11 +152,15 @@ export async function runPush(argv) {
152
152
  const root = opts.sourceRoot ?? process.cwd();
153
153
  const items = opts.given.slug ? [] : await scanProject(root);
154
154
  if (items.length > 0) {
155
+ /* kindLabel, not label: label is the workspace shell's Chinese wording, and
156
+ every other line this command prints is English. */
155
157
  const by = new Map();
156
- for (const it of items)
157
- by.set(it.surface.label, (by.get(it.surface.label) ?? 0) + 1);
158
- const shape = [...by].map(([label, n]) => `${n} ${label}`).join('、');
159
- process.stdout.write(` ${shape} —— 各自建置成獨立的 bundle\n`);
158
+ for (const it of items) {
159
+ const kind = it.surface.kindLabel.toLowerCase();
160
+ by.set(kind, (by.get(kind) ?? 0) + 1);
161
+ }
162
+ const shape = [...by].map(([kind, n]) => `${n} ${kind}${n === 1 ? '' : 's'}`).join(', ');
163
+ process.stdout.write(` ${shape} — one bundle each\n`);
160
164
  await pushProject({
161
165
  root,
162
166
  endpoint: opts.endpoint,
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAoB,IAAI,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,KAAK,GAAG;;;;;;;;2CAQ6B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;CAyB1D,CAAC;AAEF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAW,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAQlE,SAAS,KAAK,CAAC,IAAc;IAC3B,MAAM,KAAK,GAAqC,EAAE,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,SAA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K,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,sBAAsB,CAAC,CAAC;QACvD,MAAM,WAAW,CAAC;YAChB,IAAI;YACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,SAAS,EAAE,aAAa;YACxB,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SACnD,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;AACnB,CAAC"}
package/dist/defaults.js CHANGED
@@ -7,10 +7,7 @@
7
7
  */
8
8
  import fs from 'node:fs/promises';
9
9
  import path from 'node:path';
10
- /**
11
- * 正式站。自架 receiver 的人用 --endpoint 或 COSTAFF_WORKSPACE_ENDPOINT 指過去;
12
- * 協定是公開規格,這裡只是把最常見的那一個變成不必打的那一個。
13
- */
10
+ /** 正式站。--endpoint 和 COSTAFF_WORKSPACE_ENDPOINT 蓋得掉,開發時指向本機用。 */
14
11
  export const DEFAULT_ENDPOINT = 'https://workspace.costaffs.app';
15
12
  /** 伺服器認的 slug:小寫英數與連字號,開頭必須是英數,最長 63。 */
16
13
  const SLUG = /^[a-z0-9][a-z0-9-]{0,62}$/;
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG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AC,QAAyB;IACxD,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,CAAC,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC9C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;gBAAE,OAAO,IAAI,CAAC;IACrE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAyB,EAAE,IAAY;IACvE,MAAM,WAAW,GAAG,QAAQ,EAAE,WAAW,CAAC;IAC1C,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5F,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/protocol.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * The wire contract between the CLI and a receiver.
3
3
  *
4
- * Anyone may host a receiver `--endpoint` points the CLI at it so this file
5
- * is a public specification, not an implementation detail. Adding a required
6
- * field is a breaking change for every third-party receiver; bump
7
- * `PUSH_PROTOCOL` and keep reading the old shape when that happens.
4
+ * Fields are optional by default. A CLI that is already installed keeps talking
5
+ * to a receiver that has moved on, so adding a required field breaks every copy
6
+ * out there; bump `PUSH_PROTOCOL` and keep reading the old shape when an
7
+ * existing field has to change meaning.
8
8
  */
9
9
  export const PUSH_PROTOCOL = 1;
10
10
  export const DISCOVERY_PATH = '/.well-known/costaff-workspace-push';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costaff-workspace",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Publish documents, decks and workbooks to CoStaff Workspace, and pull their source back out",
5
5
  "keywords": [
6
6
  "costaff",