@willh/now 0.2.1 → 0.4.0
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 +35 -2
- package/README.md +50 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,12 +10,43 @@
|
|
|
10
10
|
|
|
11
11
|
* * *
|
|
12
12
|
|
|
13
|
+
## [0.4.0] - 2026-08-31
|
|
14
|
+
|
|
15
|
+
### 新增
|
|
16
|
+
|
|
17
|
+
- 支援指定單一檔案直接部署:
|
|
18
|
+
- `now [PATH]`、`now deploy [PATH]` 與 `now --source [PATH]` 現在皆可直接指定單檔(例如 `now document.pdf`、`now deploy bundle.js` 或 `now --source dist/app.js`)。
|
|
19
|
+
- 單檔模式下不啟用目錄排除規則(`excludes_enabled = false`),直接以該檔案為目標進行部署。
|
|
20
|
+
- 預設 URL 判定在單檔來源時自動以該檔案名稱結合 `base_url` 或 provider 自動推導之公開 URL 生成 Default URL。
|
|
21
|
+
- Azure Storage Blob 支援透過 REST API PUT BlockBlob 直接上傳單一檔案至容器與 prefix 路徑。
|
|
22
|
+
- Any Website (FTP) 當來源為單檔時,自動將 `lftp` 命令由目錄鏡像(`mirror -R`)切換為單檔上傳(`put <source> -o <remote_dest>`)。
|
|
23
|
+
- 靜態伺服器(`now tunnel`)支援單檔作為根路徑,可於根路徑 `/` 與 `/<file_name>` 直接存取該檔案。
|
|
24
|
+
|
|
25
|
+
### 變更
|
|
26
|
+
|
|
27
|
+
- 優化 Azure Storage Blob 自動生成隨機 GUID prefix 的行為:當使用者未輸入 prefix 且選擇使用隨機 GUID 時,僅於當次部署記憶體中使用,不再建立或寫入 `.now.json`,確保每次部署皆使用全新不重複的 GUID。若使用者手動輸入自訂 prefix,則仍會保存至 `.now.json`。
|
|
28
|
+
|
|
29
|
+
* * *
|
|
30
|
+
|
|
31
|
+
## [0.3.0] - 2026-08-24
|
|
32
|
+
|
|
33
|
+
### 新增
|
|
34
|
+
|
|
35
|
+
- 新增 `now tunnel` 命令:在本機啟動內建靜態檔案伺服器,並透過已安裝的 Cloudflare Tunnel(`cloudflared`)或 Microsoft dev tunnels(`devtunnel`)把目前資料夾臨時分享到公開網址,完全免設定,也不需要 `.now.json`。
|
|
36
|
+
- `now tunnel` 未指定 `--provider` 時會自動挑選第一個已安裝的通道 CLI,優先使用免登入的 Cloudflare quick tunnel;兩者都沒安裝時,依作業系統平臺顯示繁體中文安裝說明,不會自動安裝任何工具。
|
|
37
|
+
- 使用 `devtunnel` 時會先檢查登入狀態,尚未登入時在互動式終端機詢問是否立即執行 `devtunnel user login`,非互動式環境則提示該命令後結束。
|
|
38
|
+
- `now tunnel` 支援 `[PATH]`、`--port`、`--provider` 與 `--verbose`;來源目錄判斷規則與 `now deploy` 一致,且永遠不會提供 `.git`、`node_modules`、`target`、`.env`、`.now.json` 等排除清單中的檔案,同時拒絕上層目錄穿越與指向資料夾外的符號連結。
|
|
39
|
+
- 公開網站新增「臨時通道」章節與導覽項目,並補齊繁中、簡中、英、日、韓五種語言的翻譯與 SEO 描述。
|
|
40
|
+
- 新增可直接執行的 Azurite 本機儲存模擬器設定(`azurite/`),提供 `make run`、`init-env`、`sas` 與 `clean` 工作,供本機測試 Azure Storage Blob 部署使用;此為開發用工具,不影響發布的 CLI 與 npm 套件內容。
|
|
41
|
+
|
|
42
|
+
* * *
|
|
43
|
+
|
|
13
44
|
## [0.2.1] - 2026-08-24
|
|
14
45
|
|
|
15
46
|
### 新增
|
|
16
47
|
|
|
17
48
|
- Azure Storage Blob 設定時,若 `azure_blob.prefix`(folder prefix)留空,自動詢問是否以隨機 UUID v4 作為路徑前綴(預設為 Y),避免多個專案共用同一 Container 時發生檔案衝突或覆蓋。
|
|
18
|
-
- 同樣的 GUID 補問邏輯同時套用於首次設定流程(`now
|
|
49
|
+
- 同樣的 GUID 補問邏輯同時套用於首次設定流程(`now init`)與部署時的補問流程(`now`),確保兩個入口行為一致。
|
|
19
50
|
|
|
20
51
|
* * *
|
|
21
52
|
|
|
@@ -113,7 +144,9 @@
|
|
|
113
144
|
- 提供 macOS Apple Silicon、macOS Intel、Linux x64 glibc 與 Windows x64 原生執行檔及 SHA-256 checksum。
|
|
114
145
|
- 提供 npm、Unix-like 安裝腳本、Windows PowerShell 安裝腳本與 GitHub Release 發布流程。
|
|
115
146
|
|
|
116
|
-
[Unreleased]: https://github.com/doggy8088/now/compare/v0.
|
|
147
|
+
[Unreleased]: https://github.com/doggy8088/now/compare/v0.4.0...HEAD
|
|
148
|
+
[0.4.0]: https://github.com/doggy8088/now/compare/v0.3.0...v0.4.0
|
|
149
|
+
[0.3.0]: https://github.com/doggy8088/now/compare/v0.2.1...v0.3.0
|
|
117
150
|
[0.2.1]: https://github.com/doggy8088/now/compare/v0.2.0...v0.2.1
|
|
118
151
|
[0.2.0]: https://github.com/doggy8088/now/compare/v0.1.4...v0.2.0
|
|
119
152
|
[0.1.4]: https://github.com/doggy8088/now/compare/v0.1.3...v0.1.4
|
package/README.md
CHANGED
|
@@ -340,6 +340,54 @@ now deploy --timeout-secs 600
|
|
|
340
340
|
|
|
341
341
|
* * *
|
|
342
342
|
|
|
343
|
+
## 臨時通道
|
|
344
|
+
|
|
345
|
+
`now tunnel` 會在本機啟動一個內建的靜態檔案伺服器,並透過已安裝的通道 CLI 把目前資料夾**臨時**分享到公開網址。完全免設定,不需要 `.now.json`,也不會部署任何檔案。
|
|
346
|
+
|
|
347
|
+
```sh
|
|
348
|
+
now tunnel
|
|
349
|
+
now tunnel dist
|
|
350
|
+
now tunnel --provider devtunnel
|
|
351
|
+
now tunnel --port 8080
|
|
352
|
+
now tunnel --verbose
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
輸出範例:
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
Source: /Users/will/projects/demo/public
|
|
359
|
+
Local: http://127.0.0.1:56160
|
|
360
|
+
Tunnel: Cloudflare Tunnel (cloudflared)
|
|
361
|
+
Starting tunnel, press Ctrl+C to stop...
|
|
362
|
+
|
|
363
|
+
Public URL: https://fuji-mba-fourth-arthritis.trycloudflare.com
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
按 `Ctrl+C` 即可同時關閉通道與本機伺服器。
|
|
367
|
+
|
|
368
|
+
### 支援的通道服務
|
|
369
|
+
|
|
370
|
+
未指定 `--provider` 時,依下列順序自動挑選第一個已安裝的工具:
|
|
371
|
+
|
|
372
|
+
| 順序 | 服務 | CLI | 是否需要帳號 |
|
|
373
|
+
| --- | --- | --- | --- |
|
|
374
|
+
| 1 | Cloudflare Tunnel | `cloudflared` | 不需要,直接建立匿名臨時通道 |
|
|
375
|
+
| 2 | Microsoft dev tunnels | `devtunnel` | 需要 Microsoft Entra ID、Microsoft 或 GitHub 帳號 |
|
|
376
|
+
|
|
377
|
+
兩個 CLI 都沒安裝時,now 會依照目前作業系統平臺顯示中文安裝說明,不會嘗試自動安裝。
|
|
378
|
+
|
|
379
|
+
使用 `devtunnel` 時,now 會先檢查登入狀態;尚未登入時會在互動式終端機詢問是否立即執行 `devtunnel user login`,非互動式環境則直接提示該命令並結束。
|
|
380
|
+
|
|
381
|
+
### 來源目錄與安全性
|
|
382
|
+
|
|
383
|
+
`now tunnel` 使用與 `now deploy` 相同的來源目錄判斷規則:明確指定的路徑 → `.now.json` 的 `source` → 自動偵測 `dist`/`build`/`public` → 目前資料夾。實際分享的目錄會顯示在 `Source:` 這一行。
|
|
384
|
+
|
|
385
|
+
本機伺服器只綁定 `127.0.0.1`,只接受 `GET` 與 `HEAD`,並且永遠不會提供部署排除清單中的檔案(`.git`、`node_modules`、`target`、`.env`、`.env.*`、`.now.json` 與編輯器暫存檔),也會拒絕上層目錄穿越與指向資料夾外的符號連結。目錄若沒有 `index.html` 則會列出檔案清單。
|
|
386
|
+
|
|
387
|
+
**通道網址是公開的。** Cloudflare quick tunnel 與帶有 `--allow-anonymous` 的 dev tunnel 任何人拿到網址都能存取,請只用於臨時預覽或分享,並在完成後立即按 `Ctrl+C` 關閉。
|
|
388
|
+
|
|
389
|
+
* * *
|
|
390
|
+
|
|
343
391
|
## 常用命令
|
|
344
392
|
|
|
345
393
|
```sh
|
|
@@ -352,6 +400,8 @@ now deploy --dry-run
|
|
|
352
400
|
now deploy --dry-run --json
|
|
353
401
|
now config get --global
|
|
354
402
|
now config doctor
|
|
403
|
+
now tunnel
|
|
404
|
+
now tunnel dist --provider cloudflare
|
|
355
405
|
```
|
|
356
406
|
|
|
357
407
|
### 詳細記錄
|