@shipstatic/ship 2.0.0-beta.2 → 2.0.0-beta.20

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@shipstatic/ship",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.20",
4
4
  "description": "SDK & CLI for ShipStatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
8
8
  "browser": "./dist/browser.js",
9
- "types": "./dist/index.d.ts",
9
+ "types": "./dist/index.d.cts",
10
10
  "exports": {
11
11
  ".": {
12
12
  "browser": {
@@ -21,11 +21,29 @@
21
21
  "types": "./dist/index.d.cts",
22
22
  "default": "./dist/index.cjs"
23
23
  }
24
- }
24
+ },
25
+ "./cli": "./dist/cli.cjs",
26
+ "./package.json": "./package.json"
25
27
  },
26
28
  "bin": {
27
29
  "ship": "./dist/cli.cjs"
28
30
  },
31
+ "scripts": {
32
+ "test": "vitest --project unit --project integration",
33
+ "test:unit": "vitest --project unit",
34
+ "test:integration": "vitest --project integration",
35
+ "test:e2e": "vitest --project e2e",
36
+ "test:ci": "vitest --run --project unit --project integration",
37
+ "typecheck": "tsc -p tsconfig.check.json --noEmit",
38
+ "clean": "rm -rf dist",
39
+ "build": "pnpm run clean && tsup && node scripts/post-build.cjs",
40
+ "prepare": "git config core.hooksPath scripts/githooks",
41
+ "lint": "biome check .",
42
+ "format": "biome format --write .",
43
+ "coverage": "vitest --run --project unit --project integration --coverage",
44
+ "check:package": "publint && attw --pack . --exclude-entrypoints cli",
45
+ "test:browser": "vitest --run --project browser"
46
+ },
29
47
  "files": [
30
48
  "dist",
31
49
  "README.md",
@@ -64,43 +82,32 @@
64
82
  "sideEffects": false,
65
83
  "dependencies": {
66
84
  "columnify": "^1.6.0",
67
- "commander": "^12.1.0",
68
- "cosmiconfig": "^9.0.1",
85
+ "commander": "^14.0.3",
69
86
  "form-data-encoder": "^4.1.0",
70
87
  "formdata-node": "^6.0.3",
71
88
  "junk": "^4.0.1",
72
89
  "spark-md5": "^3.0.2",
73
- "yocto-spinner": "^1.2.0",
74
- "yoctocolors": "^2.1.2",
75
- "zod": "^4.4.2"
90
+ "yocto-spinner": "^1.2.2",
91
+ "yoctocolors": "^2.2.0",
92
+ "zod": "^4.4.3"
76
93
  },
77
94
  "devDependencies": {
95
+ "@arethetypeswrong/cli": "^0.18.5",
78
96
  "@biomejs/biome": "2.5.5",
79
- "@shipstatic/types": "2.2.1-beta.0",
97
+ "@shipstatic/types": "2.5.0-beta.23",
80
98
  "@types/columnify": "^1.5.4",
81
- "@types/node": "^20.19.39",
99
+ "@types/node": "^20.19.43",
82
100
  "@types/spark-md5": "^3.0.5",
83
- "@vitest/coverage-v8": "^3.2.4",
84
- "esbuild": "^0.23.1",
101
+ "@vitest/browser-playwright": "4.1.10",
102
+ "@vitest/coverage-v8": "4.1.10",
103
+ "fast-check": "^4.9.0",
85
104
  "jsdom": "^24.1.3",
86
- "memfs": "4.50.0",
87
- "msw": "^2.14.2",
88
- "ts-node": "^10.9.2",
105
+ "playwright": "1.62.0",
106
+ "publint": "^0.3.22",
89
107
  "tsup": "^8.5.1",
90
108
  "typescript": "^5.9.3",
91
- "vite-tsconfig-paths": "^5.1.4",
92
- "vitest": "^3.2.4"
109
+ "vite": "^8.1.5",
110
+ "vitest": "4.1.10"
93
111
  },
94
- "scripts": {
95
- "test": "vitest",
96
- "test:unit": "vitest --project unit",
97
- "test:integration": "vitest --project integration",
98
- "test:e2e": "vitest --project e2e",
99
- "test:ci": "vitest --run",
100
- "typecheck": "tsc --noEmit",
101
- "clean": "rm -rf dist",
102
- "build": "pnpm run clean && tsup && node scripts/post-build.cjs",
103
- "lint": "biome check .",
104
- "format": "biome format --write ."
105
- }
106
- }
112
+ "packageManager": "pnpm@10.12.4"
113
+ }
@@ -1,117 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- _ship_completions() {
4
- # COMP_CWORD is the index of the current word
5
- # COMP_WORDS is an array of words in the current command
6
- local current_word="${COMP_WORDS[COMP_CWORD]}"
7
- local prev_word="${COMP_WORDS[COMP_CWORD-1]}"
8
- local completions
9
-
10
- # Delegate to native file completion if the word looks like a path
11
- if [[ "$current_word" == ~* || "$current_word" == /* || "$current_word" == .* ]]; then
12
- COMPREPLY=( $(compgen -f -- "${current_word}") )
13
- return
14
- fi
15
-
16
- # Context-aware completions based on command structure
17
- case "${COMP_WORDS[1]}" in
18
- "deployments")
19
- case "${COMP_WORDS[2]}" in
20
- "upload")
21
- # File/directory completion for deploy path
22
- COMPREPLY=( $(compgen -f -- "${current_word}") )
23
- return
24
- ;;
25
- "get"|"set"|"remove")
26
- # Deployment ID position
27
- COMPREPLY=()
28
- return
29
- ;;
30
- *)
31
- if [[ ${COMP_CWORD} -eq 2 ]]; then
32
- completions="list upload get set remove"
33
- COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
34
- return
35
- fi
36
- ;;
37
- esac
38
- ;;
39
- "domains")
40
- case "${COMP_WORDS[2]}" in
41
- "set")
42
- # Domain name or deployment ID positions
43
- COMPREPLY=()
44
- return
45
- ;;
46
- "get"|"validate"|"verify"|"remove")
47
- # Domain name position
48
- COMPREPLY=()
49
- return
50
- ;;
51
- *)
52
- if [[ ${COMP_CWORD} -eq 2 ]]; then
53
- completions="list get set validate verify remove"
54
- COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
55
- return
56
- fi
57
- ;;
58
- esac
59
- ;;
60
- "tokens")
61
- case "${COMP_WORDS[2]}" in
62
- "remove")
63
- # Token ID position
64
- COMPREPLY=()
65
- return
66
- ;;
67
- *)
68
- if [[ ${COMP_CWORD} -eq 2 ]]; then
69
- completions="list create remove"
70
- COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
71
- return
72
- fi
73
- ;;
74
- esac
75
- ;;
76
- "account")
77
- if [[ ${COMP_CWORD} -eq 2 ]]; then
78
- completions="get"
79
- COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
80
- return
81
- fi
82
- ;;
83
- "completion")
84
- if [[ ${COMP_CWORD} -eq 2 ]]; then
85
- completions="install uninstall"
86
- COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
87
- return
88
- fi
89
- ;;
90
- esac
91
-
92
- # Delegate for commands that expect files
93
- if [[ "$prev_word" == "upload" || "$prev_word" == "--config" ]]; then
94
- COMPREPLY=( $(compgen -f -- "${current_word}") )
95
- return
96
- fi
97
-
98
- # Flag completion
99
- if [[ "$current_word" == --* ]]; then
100
- completions="--token --config --api-url --label --password --no-path-detect --no-spa-detect --json --no-color --version --help"
101
- COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
102
- return
103
- fi
104
-
105
- # Top-level commands
106
- if [[ ${COMP_CWORD} -eq 1 ]]; then
107
- completions="ping whoami deployments domains tokens account config completion"
108
- COMPREPLY=( $(compgen -W "${completions}" -- "${current_word}") )
109
- return
110
- fi
111
-
112
- # Default: no completions
113
- COMPREPLY=()
114
- }
115
-
116
- # Register the completion function for the 'ship' command
117
- complete -F _ship_completions ship
@@ -1,87 +0,0 @@
1
- # ship.fish - Tab completion for Ship CLI
2
-
3
- # Helper function to check if we're completing a path
4
- function __ship_is_path
5
- set -l cmd (commandline -opc)
6
- if test (count $cmd) -gt 1
7
- set -l last_token $cmd[-1]
8
- if string match -q -- "*/*" "$last_token"
9
- return 0
10
- end
11
- if string match -q -- "~*" "$last_token"
12
- return 0
13
- end
14
- if string match -q -- ".*" "$last_token"
15
- return 0
16
- end
17
- end
18
- return 1
19
- end
20
-
21
- # Helper function to check if we should complete files for certain commands
22
- function __ship_needs_file
23
- set -l cmd (commandline -opc)
24
- if test (count $cmd) -ge 2
25
- set -l prev $cmd[-1]
26
- if test "$prev" = "upload" -o "$prev" = "--config"
27
- return 0
28
- end
29
- end
30
- return 1
31
- end
32
-
33
- # Top-level commands
34
- complete -c ship -f -n '__fish_use_subcommand' -a 'ping' -d 'Check API connectivity'
35
- complete -c ship -f -n '__fish_use_subcommand' -a 'whoami' -d 'Get current account information'
36
- complete -c ship -f -n '__fish_use_subcommand' -a 'deployments' -d 'Manage deployments'
37
- complete -c ship -f -n '__fish_use_subcommand' -a 'domains' -d 'Manage domains'
38
- complete -c ship -f -n '__fish_use_subcommand' -a 'tokens' -d 'Manage deploy tokens'
39
- complete -c ship -f -n '__fish_use_subcommand' -a 'account' -d 'Manage account'
40
- complete -c ship -f -n '__fish_use_subcommand' -a 'config' -d 'Create or update configuration'
41
- complete -c ship -f -n '__fish_use_subcommand' -a 'completion' -d 'Setup shell completion'
42
-
43
- # Global options
44
- complete -c ship -l token -d 'Any ship token: API key (ship-…) or deploy token (deploy-…)' -x
45
- complete -c ship -l config -d 'Custom config file path' -r
46
- complete -c ship -l api-url -d 'API URL (for development)' -x
47
- complete -c ship -l label -d 'Label (can be repeated)' -x
48
- complete -c ship -l password -d 'Password-protect this deployment' -x
49
- complete -c ship -l json -d 'Output results in JSON format'
50
- complete -c ship -l no-color -d 'Disable colored output'
51
- complete -c ship -l no-path-detect -d 'Disable automatic path optimization and flattening'
52
- complete -c ship -l no-spa-detect -d 'Disable automatic SPA detection and configuration'
53
- complete -c ship -l version -d 'Show version information'
54
- complete -c ship -l help -d 'Display help for command'
55
-
56
- # Deployments subcommands
57
- complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'list' -d 'List all deployments'
58
- complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'upload' -d 'Upload deployment from directory'
59
- complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'get' -d 'Show deployment information'
60
- complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'set' -d 'Set deployment labels'
61
- complete -c ship -f -n '__fish_seen_subcommand_from deployments' -a 'remove' -d 'Delete deployment permanently'
62
-
63
- # Domains subcommands
64
- complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'list' -d 'List all domains'
65
- complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'get' -d 'Show domain information'
66
- complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'set' -d 'Create domain, link to deployment, or update labels'
67
- complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'validate' -d 'Check if domain name is valid and available'
68
- complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'verify' -d 'Trigger DNS verification for external domain'
69
- complete -c ship -f -n '__fish_seen_subcommand_from domains' -a 'remove' -d 'Delete domain permanently'
70
-
71
- # Tokens subcommands
72
- complete -c ship -f -n '__fish_seen_subcommand_from tokens' -a 'list' -d 'List all deploy tokens'
73
- complete -c ship -f -n '__fish_seen_subcommand_from tokens' -a 'create' -d 'Create a new deploy token'
74
- complete -c ship -f -n '__fish_seen_subcommand_from tokens' -a 'remove' -d 'Delete token permanently'
75
-
76
- # Tokens create options
77
- complete -c ship -l ttl -d 'Time to live in seconds' -x
78
-
79
- # Account subcommands
80
- complete -c ship -f -n '__fish_seen_subcommand_from account' -a 'get' -d 'Show account information'
81
-
82
- # Completion subcommands
83
- complete -c ship -f -n '__fish_seen_subcommand_from completion' -a 'install' -d 'Install shell completion script'
84
- complete -c ship -f -n '__fish_seen_subcommand_from completion' -a 'uninstall' -d 'Uninstall shell completion script'
85
-
86
- # File completion for appropriate commands (only when not a path is being typed)
87
- complete -c ship -F -n '__ship_needs_file and not __ship_is_path'
@@ -1,126 +0,0 @@
1
- #compdef ship
2
-
3
- # Only define the completion function if we're in a completion context
4
- if [[ -n ${ZSH_VERSION-} ]]; then
5
- _ship() {
6
- local -a completions
7
- local state line
8
-
9
- # Only proceed if we're actually in a completion context
10
- if [[ -z ${words-} ]]; then
11
- return 1
12
- fi
13
-
14
- # The word being completed
15
- local current_word="${words[CURRENT]}"
16
- # The previous word
17
- local prev_word="${words[CURRENT-1]}"
18
-
19
- # --- File Path Logic ---
20
- # If the user is typing a path, use native file completion immediately.
21
- if [[ "$current_word" == \~* || "$current_word" == \/* || "$current_word" == \./* || "$current_word" == \.\./* ]]; then
22
- _files
23
- return
24
- fi
25
-
26
- # Context-aware completions based on command structure
27
- case "${words[2]}" in
28
- "deployments")
29
- case "${words[3]}" in
30
- "upload")
31
- # File/directory completion for deploy path
32
- _files
33
- return
34
- ;;
35
- "get"|"set"|"remove")
36
- # Deployment ID position
37
- return
38
- ;;
39
- *)
40
- if [[ $CURRENT -eq 3 ]]; then
41
- completions=("list:List all deployments" "upload:Upload deployment from directory" "get:Show deployment information" "set:Set deployment labels" "remove:Delete deployment permanently")
42
- _describe 'deployments commands' completions
43
- return
44
- fi
45
- ;;
46
- esac
47
- ;;
48
- "domains")
49
- case "${words[3]}" in
50
- "set")
51
- # Domain name or deployment ID positions
52
- return
53
- ;;
54
- "get"|"validate"|"verify"|"remove")
55
- # Domain name position
56
- return
57
- ;;
58
- *)
59
- if [[ $CURRENT -eq 3 ]]; then
60
- completions=("list:List all domains" "get:Show domain information" "set:Create domain, link to deployment, or update labels" "validate:Check if domain name is valid and available" "verify:Trigger DNS verification for external domain" "remove:Delete domain permanently")
61
- _describe 'domains commands' completions
62
- return
63
- fi
64
- ;;
65
- esac
66
- ;;
67
- "tokens")
68
- case "${words[3]}" in
69
- "remove")
70
- # Token ID position
71
- return
72
- ;;
73
- *)
74
- if [[ $CURRENT -eq 3 ]]; then
75
- completions=("list:List all deploy tokens" "create:Create a new deploy token" "remove:Delete token permanently")
76
- _describe 'tokens commands' completions
77
- return
78
- fi
79
- ;;
80
- esac
81
- ;;
82
- "account")
83
- if [[ $CURRENT -eq 3 ]]; then
84
- completions=("get:Show account information")
85
- _describe 'account commands' completions
86
- return
87
- fi
88
- ;;
89
- "completion")
90
- if [[ $CURRENT -eq 3 ]]; then
91
- completions=("install:Install shell completion script" "uninstall:Uninstall shell completion script")
92
- _describe 'completion commands' completions
93
- return
94
- fi
95
- ;;
96
- esac
97
-
98
- # If the previous command expects a file path, also use file completion.
99
- if [[ "$prev_word" == "upload" || "$prev_word" == "--config" ]]; then
100
- _files
101
- return
102
- fi
103
-
104
- # Flag completion
105
- if [[ "$current_word" == --* ]]; then
106
- completions=("--token:Any ship token — API key (ship-…) or deploy token (deploy-…)" "--config:Custom config file path" "--api-url:API URL (for development)" "--label:Label (can be repeated)" "--password:Password-protect this deployment" "--no-path-detect:Disable automatic path optimization and flattening" "--no-spa-detect:Disable automatic SPA detection and configuration" "--json:Output results in JSON format" "--no-color:Disable colored output" "--version:Show version information" "--help:Display help for command")
107
- _describe 'options' completions
108
- return
109
- fi
110
-
111
- # Top-level commands
112
- if [[ $CURRENT -eq 2 ]]; then
113
- completions=("ping:Check API connectivity" "whoami:Get current account information" "deployments:Manage deployments" "domains:Manage domains" "tokens:Manage deploy tokens" "account:Manage account" "config:Create or update configuration" "completion:Setup shell completion")
114
- _describe 'commands' completions
115
- return
116
- fi
117
-
118
- # Default: no completions
119
- return 1
120
- }
121
-
122
- # Only register the completion if compdef is available
123
- if (( ${+functions[compdef]} )); then
124
- compdef _ship ship
125
- fi
126
- fi