#!/usr/bin/env node
// Packages
const chalk = require ( 'chalk' )
const minimist = require ( 'minimist' )
const table = require ( 'text-table' )
const ms = require ( 'ms' )
// Ours
const strlen = require ( '../lib/strlen' )
const NowAlias = require ( '../lib/alias' )
const NowDomains = require ( '../lib/domains' )
const login = require ( '../lib/login' )
const cfg = require ( '../lib/cfg' )
const { error } = require ( '../lib/error' )
const toHost = require ( '../lib/to-host' )
const { reAlias } = require ( '../lib/re-alias' )
const exit = require ( '../lib/utils/exit' )
const logo = require ( '../lib/utils/output/logo' )
const promptBool = require ( '../lib/utils/input/prompt-bool' )
const argv = minimist ( process . argv . slice ( 2 ) , {
string : [ 'config' , 'token' , 'rules' ] ,
boolean : [ 'help' , 'debug' ] ,
alias : {
help : 'h' ,
config : 'c' ,
rules : 'r' ,
debug : 'd' ,
token : 't'
}
} )
const subcommand = argv . _ [ 0 ]
// Options
const help = ( ) => {
console . log (
`
$ { chalk . bold ( ` ${ logo } now alias ` ) } < ls | set | rm > < deployment > < alias >
$ { chalk . dim ( 'Options:' ) }
- h , -- help Output usage information
- c $ { chalk . bold . underline ( 'FILE' ) } , -- config = $ { chalk . bold . underline ( 'FILE' ) } Config file
- r $ { chalk . bold . underline ( 'RULES_FILE' ) } , -- rules = $ { chalk . bold . underline ( 'RULES_FILE' ) } Rules file
- d , -- debug Debug mode [ off ]
- t $ { chalk . bold . underline ( 'TOKEN' ) } , -- token = $ { chalk . bold . underline ( 'TOKEN' ) } Login token
$ { chalk . dim ( 'Examples:' ) }
$ { chalk . gray ( '–' ) } Lists all your aliases :
$ { chalk . cyan ( '$ now alias ls' ) }
$ { chalk . gray ( '–' ) } Adds a new alias to $ { chalk . underline ( 'my-api.now.sh' ) } :
$ { chalk . cyan ( ` $ now alias set ${ chalk . underline ( 'api-ownv3nc9f8.now.sh' ) } ${ chalk . underline ( 'my-api.now.sh' ) } ` ) }
The $ { chalk . dim ( '`.now.sh`' ) } suffix can be ommited :
$ { chalk . cyan ( '$ now alias set api-ownv3nc9f8 my-api' ) }
The deployment id can be used as the source :
$ { chalk . cyan ( '$ now alias set deploymentId my-alias' ) }
Custom domains work as alias targets :
$ { chalk . cyan ( ` $ now alias set ${ chalk . underline ( 'api-ownv3nc9f8.now.sh' ) } ${ chalk . underline ( 'my-api.com' ) } ` ) }
$ { chalk . dim ( '–' ) } The subcommand $ { chalk . dim ( '`set`' ) } is the default and can be skipped .
$ { chalk . dim ( '–' ) } $ { chalk . dim ( '`http(s)://`' ) } in the URLs is unneeded / ignored .
$ { chalk . gray ( '–' ) } Add and modify path based aliases for $ { chalk . underline ( 'zeit.ninja' ) } :
$ { chalk . cyan ( ` $ now alias ${ chalk . underline ( 'zeit.ninja' ) } -r ${ chalk . underline ( 'rules.json' ) } ` ) }
Export effective routing rules :
$ { chalk . cyan ( ` $ now alias ls aliasId --json > ${ chalk . underline ( 'rules.json' ) } ` ) }
$ { chalk . cyan ( ` $ now alias ls zeit.ninja ` ) }
$ { chalk . gray ( '–' ) } Removing an alias :
$ { chalk . cyan ( '$ now alias rm aliasId' ) }
To get the list of alias ids , use $ { chalk . dim ( '`now alias ls`' ) } .
$ { chalk . dim ( 'Alias:' ) } ln
`
)
}
// Options
const debug = argv . debug
const apiUrl = argv . url || 'https://api.zeit.co'
if ( argv . config ) {
cfg . setConfigFile ( argv . config )
}
if ( argv . help ) {
help ( )
exit ( 0 )
} else {
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
Promise . resolve ( ) . then ( async ( ) => {
const config = await cfg . read ( )
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
let token
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
try {
token = argv . token || config . token || ( await login ( apiUrl ) )
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
} catch ( err ) {
error ( ` Authentication error – ${ err . message } ` )
exit ( 1 )
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
}
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
try {
await run ( { token , config } )
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
} catch ( err ) {
if ( err . userError ) {
error ( err . message )
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
} else {
error ( ` Unknown error: ${ err } \n ${ err . stack } ` )
}
exit ( 1 )
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
}
} )
}
async function run ( { token , config : { currentTeam , user } } ) {
const alias = new NowAlias ( { apiUrl , token , debug , currentTeam } )
const domains = new NowDomains ( { apiUrl , token , debug , currentTeam } )
const args = argv . _ . slice ( 1 )
switch ( subcommand ) {
case 'ls' :
case 'list' : {
if ( args . length === 1 ) {
const list = await alias . listAliases ( )
const item = list . find (
e => e . uid === argv . _ [ 1 ] || e . alias === argv . _ [ 1 ]
)
if ( ! item || ! item . rules ) {
error ( ` Could not match path alias for: ${ argv . _ [ 1 ] } ` )
return exit ( 1 )
}
if ( argv . json ) {
console . log ( JSON . stringify ( { rules : item . rules } , null , 2 ) )
} else {
const header = [
[ '' , 'pathname' , 'method' , 'dest' ] . map ( s => chalk . dim ( s ) )
]
const text = list . length === 0
? null
: table (
header . concat (
item . rules . map ( rule => {
return [
'' ,
rule . pathname ? rule . pathname : '' ,
rule . method ? rule . method : '*' ,
rule . dest
]
} )
) ,
{
align : [ 'l' , 'l' , 'l' , 'l' ] ,
hsep : ' ' . repeat ( 2 ) ,
stringLength : strlen
}
)
console . log ( text )
}
break
} else if ( args . length !== 0 ) {
error (
` Invalid number of arguments. Usage: ${ chalk . cyan ( '`now alias ls`' ) } `
)
return exit ( 1 )
}
const start_ = new Date ( )
const list = await alias . list ( )
const urls = new Map ( list . map ( l => [ l . uid , l . url ] ) )
const aliases = await alias . ls ( )
aliases . sort ( ( a , b ) => new Date ( b . created ) - new Date ( a . created ) )
const current = new Date ( )
const header = [
[ '' , 'id' , 'source' , 'url' , 'created' ] . map ( s => chalk . dim ( s ) )
]
const text = list . length === 0
? null
: table (
header . concat (
aliases . map ( _ alias => {
const _ url = chalk . underline ( ` https:// ${ _ alias . alias } ` )
const target = _ alias . deploymentId
let _ sourceUrl
if ( urls . get ( target ) ) {
_ sourceUrl = chalk . underline ( ` https:// ${ urls . get ( target ) } ` )
} else if ( _ alias . rules ) {
_ sourceUrl = chalk . gray (
` [ ${ _ alias . rules . length } custom rule ${ _ alias . rules . length > 1 ? 's' : '' } ] `
)
} else {
_ sourceUrl = chalk . gray ( '<null>' )
}
const time = chalk . gray (
ms ( current - new Date ( _ alias . created ) ) + ' ago'
)
return [
'' ,
// We default to `''` because some early aliases didn't
// have an uid associated
_ alias . uid === null ? '' : _ alias . uid ,
_ sourceUrl ,
_ url ,
time
]
} )
) ,
{
align : [ 'l' , 'r' , 'l' , 'l' ] ,
hsep : ' ' . repeat ( 2 ) ,
stringLength : strlen
}
)
const elapsed_ = ms ( new Date ( ) - start_ )
console . log (
` > ${ aliases . length } alias ${ aliases . length === 1 ? '' : 'es' } found ${ chalk . gray ( ` [ ${ elapsed_ } ] ` ) } under ${ chalk . bold ( ( currentTeam && currentTeam . slug ) || user . username || user . email ) } `
)
if ( text ) {
console . log ( '\n' + text + '\n' )
}
break
}
case 'rm' :
case 'remove' : {
const _ target = String ( args [ 0 ] )
if ( ! _ target ) {
const err = new Error ( 'No alias id specified' )
err . userError = true
throw err
}
if ( args . length !== 1 ) {
error (
` Invalid number of arguments. Usage: ${ chalk . cyan ( '`now alias rm <id>`' ) } `
)
return exit ( 1 )
}
const _ aliases = await alias . ls ( )
const _ alias = findAlias ( _ target , _ aliases )
if ( ! _ alias ) {
const err = new Error (
` Alias not found by " ${ _ target } " under ${ chalk . bold ( ( currentTeam && currentTeam . slug ) || user . username || user . email ) } . Run ${ chalk . dim ( '`now alias ls`' ) } to see your aliases. `
)
err . userError = true
throw err
}
try {
const confirmation = await confirmDeploymentRemoval ( alias , _ alias )
if ( ! confirmation ) {
console . log ( '\n> Aborted' )
process . exit ( 0 )
}
const start = new Date ( )
await alias . rm ( _ alias )
const elapsed = ms ( new Date ( ) - start )
console . log (
` ${ chalk . cyan ( '> Success!' ) } Alias ${ chalk . bold ( _ alias . uid ) } removed [ ${ elapsed } ] `
)
} catch ( err ) {
error ( err )
exit ( 1 )
}
break
}
case 'add' :
case 'set' : {
if ( argv . rules ) {
await updatePathAlias ( alias , argv . _ [ 0 ] , argv . rules , domains )
break
}
if ( args . length !== 2 ) {
error (
` Invalid number of arguments. Usage: ${ chalk . cyan ( '`now alias set <id> <domain>`' ) } `
)
return exit ( 1 )
}
await alias . set ( String ( args [ 0 ] ) , String ( args [ 1 ] ) , domains , currentTeam , user )
break
}
default : {
if ( argv . _ . length === 0 ) {
await reAlias ( token , null , null , help , exit , apiUrl , debug , alias , currentTeam , user )
break
}
if ( argv . _ . length === 1 ) {
await reAlias (
token ,
null ,
String ( argv . _ [ 0 ] ) ,
help ,
exit ,
apiUrl ,
debug ,
alias ,
currentTeam ,
user
)
break
}
if ( argv . rules ) {
await updatePathAlias ( alias , argv . _ [ 0 ] , argv . rules , domains )
} else if ( argv . _ . length === 2 ) {
await alias . set (
String ( argv . _ [ 0 ] ) ,
String ( argv . _ [ 1 ] ) ,
domains ,
currentTeam ,
user
)
} else if ( argv . _ . length >= 3 ) {
error ( 'Invalid number of arguments' )
help ( )
exit ( 1 )
} else {
error ( 'Please specify a valid subcommand: ls | set | rm' )
help ( )
exit ( 1 )
}
}
}
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
domains . close ( )
alias . close ( )
}
async function confirmDeploymentRemoval ( alias , _ alias ) {
const deploymentsList = await alias . list ( )
const urls = new Map ( deploymentsList . map ( l => [ l . uid , l . url ] ) )
const time = chalk . gray ( ms ( new Date ( ) - new Date ( _ alias . created ) ) + ' ago' )
const _ sourceUrl = chalk . underline ( ` https:// ${ urls . get ( _ alias . deploymentId ) } ` )
const tbl = table (
[
[ _ alias . uid , _ sourceUrl , chalk . underline ( ` https:// ${ _ alias . alias } ` ) , time ]
] ,
{ align : [ 'l' , 'r' , 'l' ] , hsep : ' ' . repeat ( 6 ) }
)
const msg =
'> The following alias will be removed permanently\n' +
` ${ tbl } \n Are you sure? `
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
return promptBool ( msg , {
trailing : '\n'
} )
}
function findAlias ( alias , list ) {
let key
let val
if ( /\./ . test ( alias ) ) {
val = toHost ( alias )
key = 'alias'
} else {
val = alias
key = 'uid'
}
const _ alias = list . find ( d => {
if ( d [ key ] === val ) {
if ( debug ) {
console . log ( ` > [debug] matched alias ${ d . uid } by ${ key } ${ val } ` )
}
return true
}
// Match prefix
if ( ` ${ val } .now.sh ` === d . alias ) {
if ( debug ) {
console . log ( ` > [debug] matched alias ${ d . uid } by url ${ d . host } ` )
}
return true
}
return false
} )
return _ alias
}
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468)
* Feature/teams (#25)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* Feature/domains (#26)
* Add the skeleton of `now teams`
* Add support for "complex" command aliases
This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.
* `now switch` => `now teams switch`
* Extract `rightPad`
* Extract `eraseLines`
* Extract `✓`
* Text input: add `valid` option
* Text input: add `forceLowerCase` option
* Add preliminary `now teams add`
* Make the linter happy
* Extract `> NOTE: ...`
* Add missing labels
* Fix typos
* Add missing parameters
* Change the section label after inviting all specified team mates
* Call the API after each email submission
* Show the elapsed time after each `inviteUser` api call
* Handle user aborts
* We don't need `args` for `now teams add`
* Add missing `await`
* Extract regex
* `process.exit()` => `exit(1)`
* `prompt-bool` is an `input` util, not an `output` one
* Add the ability to delete a key from the config file
* Add `fatal-error`
* Add `now teams invite`
* This shouldn't be black
* Save the username in `~/.now.json` upon login
* Save the token and userId instead of token and email
* Fix typo
* Save more info about the user to `~/.now.json` upon login
* `~/.now.json`: Persist the current time when login in
* Add `user` helper
* `user.userId` => `user.id`
* Tweak code organization
* Add caching system to `.now.json`
* Automatically switch to a team after its creation
* Introduce the concept of `inactive` teams
* Use bold for `payment method`
* Remove duplicated code
* Add line breaks
* Auto complete with the first match
* Remove placeholder stuff
* Add the user's email to the list of suggestions
* FIx bad merge
* Add `now switch`
* Make `now teams invite` more reliable and faster
* Shut up XO
* Improve autocompletion
* Fix TypeError
* Make stuff pretty
* Not sure how this got overwritten
* `prompt-bool` is an `input` util, not an `output` one
* Make stuff pretty
* Not sure how this got overwritten
* Add domains.status, price and buy
* Add `now domains buy`
* Add the ability to buy a domain when running `now alias`
* Logs (#27)
* Added `logs` sub command
* add missing dependencies
* use utils/output/logo
* logs: fix wrong reference
* logs: fix buffer time
* sort build logs (#19)
* logs: use lib/logs
* lib/logs: fix
* logs: resolve url to id
* logs: default to follow
* logs: don't resolve URL to id
* logs: revert to default unfollow
* logs: add since option and until option
* logs: fix default number of logs
* fix logs auth
* logs: listen ready event
* logs: new endpoint
* log: remove v query param
* logs: default to not include access logs
* fix styles of now-logs
* logs: remove relative time
* Fix bad merge conflict
* Add `now scale` (#28)
* Inital drafts fro `now-scale`
* More final draft
* sketch new `now ls` format
* Add sketch for `now ls --all`
* Placeholder for `now scale ls`
* "Prettify" and improve scale command
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Adopt to now-list api changes
* Improve now-list --all colors
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Add now scale ls
Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>
* Prettify
* Show auto correctly
* Add partial match scale for now alias
* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes
* Replace spinners with help text
* Make the list :nice:
* Make now-list great again
* Final touches
* Allow --all only when app is defined
* Add progress tracking to scale
* Correctly use --all for > 0 deployments found [1s] and improve scale info ux
* Show --all info if we are hiding stuff
* Fixes
* Refactor scale info and unfreeze
* Fixes
* Proper progress bar
* Fix bad merge
* Fix auth for now-scale
* logs: fix reading config
* Fix reference
* Small ux tweaks
* Improve now alias ux
* Fix a ton of lint errors
* Fix scaling up and alias ux
* Fix lint errors + prettify
* Make `bin/now-scale.js` available via `now scale`
* Fix errornous syntax for domains list
* And use correct header for domains list
* Update now-scale help to match new spec
* `await` for `cfg.read()` on `cfg.remove()`
* Update scale command
* Cleanu
p
* Fetch the teams from the api on teams.ls()
Plus prettier shit
* Run prettier hooks manually
* Make `now switch` perfect
* Rm unused variables
* Lint
* Ruin ux but lint
* Consume `POST /teams`
* Consume `PATCH /teams/:id`
* Fix/teams support (#29)
* Add teams support for lib/index.js
* Consume `POST /teams/:id/members`
* Make `now teams create` and `now teams invite` perfect
* Add a way to not send `?teamId` if necessary
* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands
* Display the username only if it's available
* Consume the preoduction endpoits for domain purchase
* Fix typo
* Fix grammar
* Fix grammar
* Remove useless require
* Display the user name/team slug on creation/list commands
* Remove use of old, now undefined variable
* Show domains in bold on `now domains ls`
* `user.userId` => `user.uid`
* Remove console.log
* Show a better messsage upon unexpected `domains.buy()` error
* typo
* Consume new `/plan` API and fix plan check
* Update `now upgrade` – consume new APIs and expose new plans
* Fix `now ugprade` info message
* `now cc`: consume new APIs and fix error messages
* Add team/user context to `now alias` when buying a domain
* Fix wording on `now domains buy`
* Add stamp to domain purchase
* Improve scale ux
* Remove ToS prompt upon login
* Fix `prompt-bool` trailing issues
* Remove useless `require`
* Allow `now switch <username>`
* Make `now help` better
* This shouldn't be here
* Make `now switch` incredible
* Remove old stuff from ~/.now.json
* Add comments
* `now team` => `now teams`
* 5.0.0
* Fix linter
* Fix DNS
* Parse subdomain
* FIx lint
* drop IDs for certs
* Make now ls look nice also when noTTY
* Make now list look nice when colors are not supported
* Mane certs ls look nice when we have no colers
* Now ls --all can also take uniq url as a parameter
* Improve now ls --all
* Now ls -all takes alias as an argument
8 years ago
async function updatePathAlias ( alias , aliasName , rules , domains ) {
const start = new Date ( )
const res = await alias . updatePathBasedroutes (
String ( aliasName ) ,
rules ,
domains
)
const elapsed = ms ( new Date ( ) - start )
if ( res . error ) {
const err = new Error ( res . error . message )
err . userError = true
throw err
} else {
console . log (
` ${ chalk . cyan ( '> Success!' ) } ${ res . ruleCount } rules configured for ${ chalk . underline ( res . alias ) } [ ${ elapsed } ] `
)
}
}