You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

385 lines
9.6 KiB

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
#!/usr/bin/env node
// Packages
const chalk = require('chalk')
const isURL = require('is-url')
const minimist = require('minimist')
const ms = require('ms')
const printf = require('printf')
require('epipebomb')()
const supportsColor = require('supports-color')
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
// Ours
const cfg = require('../lib/cfg')
const { handleError, error } = require('../lib/error')
const NowScale = require('../lib/scale')
const login = require('../lib/login')
const exit = require('../lib/utils/exit')
const logo = require('../lib/utils/output/logo')
const info = require('../lib/scale-info')
8 years ago
const sort = require('../lib/sort-deployments')
const success = require('../lib/utils/output/success')
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
const argv = minimist(process.argv.slice(2), {
string: ['config', 'token'],
boolean: ['help', 'debug'],
alias: { help: 'h', config: 'c', debug: 'd', token: 't' }
})
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 id = argv._[0]
const scaleArg = argv._[1]
const optionalScaleArg = argv._[2]
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
// Options
const help = () => {
8 years ago
console.log(`
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
${chalk.bold(`${logo} now scale`)} ls
${chalk.bold(`${logo} now scale`)} <url>
${chalk.bold(`${logo} now scale`)} <url> <min> [max]
${chalk.dim('Options:')}
-h, --help Output usage information
-c ${chalk.bold.underline('FILE')}, --config=${chalk.bold.underline(
'FILE'
)} Config file
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
-d, --debug Debug mode [off]
${chalk.dim('Examples:')}
${chalk.gray('–')} Create a deployment with 3 instances, never sleeps:
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
${chalk.cyan('$ now scale my-deployment-ntahoeato.now.sh 3')}
${chalk.gray('–')} Create an automatically scaling deployment:
${chalk.cyan('$ now scale my-deployment-ntahoeato.now.sh 1 5')}
${chalk.gray(
'–'
)} Create an automatically scaling deployment without specifying max:
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
${chalk.cyan('$ now scale my-deployment-ntahoeato.now.sh 1 auto')}
${chalk.gray(
'–'
)} Create an automatically scaling deployment without specifying min or max:
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
${chalk.cyan('$ now scale my-deployment-ntahoeato.now.sh auto')}
${chalk.gray(
'–'
)} Create a deployment that is always active and never "sleeps":
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
${chalk.cyan('$ now scale my-deployment-ntahoeato.now.sh 1')}
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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
// Options
const debug = argv.debug
const apiUrl = argv.url || 'https://api.zeit.co'
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (argv.config) {
cfg.setConfigFile(argv.config)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
if (argv.help) {
help()
exit(0)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 {
Promise.resolve()
.then(async () => {
const config = await cfg.read({ token: argv.token })
let token
try {
token = config.token || (await login(apiUrl))
} 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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 })
} catch (err) {
if (err.userError) {
error(err.message)
} else {
error(`Unknown error: ${err}\n${err.stack}`)
}
exit(1)
}
})
.catch(err => {
handleError(err)
process.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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
function guessParams() {
if (Number.isInteger(scaleArg) && !optionalScaleArg) {
return { min: scaleArg, max: scaleArg }
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 if (Number.isInteger(scaleArg) && Number.isInteger(optionalScaleArg)) {
return { min: scaleArg, max: optionalScaleArg }
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 if (Number.isInteger(scaleArg) && optionalScaleArg === 'auto') {
return { min: scaleArg, max: 'auto' }
} else if (
(!scaleArg && !optionalScaleArg) ||
(scaleArg === 'auto' && !optionalScaleArg)
) {
return { min: 1, max: 'auto' }
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
help()
process.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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
function isHostNameOrId(str) {
return (
/(https?:\/\/)?((?:(?=[a-z0-9-]{1,63}\.)(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]{2,63})/.test(
str
) || str.length === 28
)
}
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 } }) {
const scale = new NowScale({ apiUrl, token, debug, currentTeam })
const start = Date.now()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (id === 'ls') {
await list(scale)
process.exit(0)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 if (id === 'info') {
await info(scale)
process.exit(0)
} else if (id && isHostNameOrId(id)) {
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
// Normalize URL by removing slash from the end
if (isURL(id)) {
id = id.replace(/^https:\/\//i, '')
if (id.slice(-1) === '/') {
id = id.slice(0, -1)
}
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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('Please specify a deployment: now scale <id|url>')
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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
const deployments = await scale.list()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 match = deployments.find(d => {
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
// `url` should match the hostname of the deployment
let u = id.replace(/^https:\/\//i, '')
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (u.indexOf('.') === -1) {
// `.now.sh` domain is implied if just the subdomain is given
u += '.now.sh'
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 d.uid === id || d.name === id || d.url === u
})
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (!match) {
// Maybe it's an alias
const aliasDeployment = (await scale.listAliases()).find(
e => e.alias === id
)
if (!aliasDeployment) {
error(`Could not find any deployments matching ${id}`)
return process.exit(1)
}
match = deployments.find(d => {
return d.uid === aliasDeployment.deploymentId
})
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
const { min, max } = guessParams()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (
!(Number.isInteger(min) || min === 'auto') &&
!(Number.isInteger(max) || max === 'auto')
) {
help()
return 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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
if (match.type === 'STATIC') {
if (min === 0 && max === 0) {
error("Static deployments can't be FROZEN. Use `now rm` to remove")
return process.exit(1)
}
console.log('> Static deployments are automatically scaled!')
return process.exit(0)
}
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
const {
max: currentMax,
min: currentMin,
current: currentCurrent
} = match.scale
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (
max === currentMax &&
min === currentMin &&
Number.isInteger(min) &&
currentCurrent >= min &&
Number.isInteger(max) &&
currentCurrent <= max
) {
// Nothing to do, let's print the rules
printScaleingRules(match.url, currentCurrent, min, max)
return
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
if ((match.state === 'FROZEN' || match.scale.current === 0) && min > 0) {
console.log(
`> Deployment is currently in 0 replicas, preparing deployment for scaling...`
)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (match.scale.max < 1) {
await scale.setScale(match.uid, { min: 0, max: 1 })
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
await scale.unfreeze(match)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
const { min: newMin, max: newMax } = await scale.setScale(match.uid, {
min,
max
})
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
const elapsed = ms(new Date() - start)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
const currentReplicas = match.scale.current
printScaleingRules(match.url, currentReplicas, newMin, newMax, elapsed)
await info(scale, match.url)
scale.close()
}
function printScaleingRules(url, currentReplicas, min, max, elapsed) {
const log = console.log
success(
`Configured scaling rules ${chalk.gray(elapsed ? '[' + elapsed + ']' : '')}`
)
log()
log(
`${chalk.bold(url)} (${chalk.gray(currentReplicas)} ${chalk.gray(
'current'
)})`
)
log(printf('%6s %s', 'min', chalk.bold(min)))
log(printf('%6s %s', 'max', chalk.bold(max)))
log(printf('%6s %s', 'auto', chalk.bold(min === max ? '✖' : '✔')))
log()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 list(scale) {
let deployments
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 {
const app = argv._[1]
deployments = await scale.list(app)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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) {
handleError(err)
process.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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
scale.close()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
const apps = new Map()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
for (const dep of deployments) {
const deps = apps.get(dep.name) || []
apps.set(dep.name, deps.concat(dep))
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
8 years ago
const sorted = await sort([...apps])
8 years ago
const timeNow = new Date()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
const urlLength =
deployments.reduce((acc, i) => {
return Math.max(acc, (i.url && i.url.length) || 0)
}, 0) + 5
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
for (const app of sorted) {
8 years ago
const depls = argv.all ? app[1] : app[1].slice(0, 5)
console.log(
`${chalk.bold(app[0])} ${chalk.gray(
'(' + depls.length + ' of ' + app[1].length + ' total)'
)}`
)
console.log()
const urlSpec = `%-${urlLength}s`
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
console.log(
printf(
` ${chalk.grey(urlSpec + ' %8s %8s %8s %8s %8s')}`,
'url',
'cur',
'min',
'max',
'auto',
'age'
)
)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
for (const instance of depls) {
if (!instance.scale) {
let spec
if (supportsColor) {
spec = ` %-${urlLength + 10}s %8s %8s %8s %8s %8s`
} else {
spec = ` %-${urlLength + 1}s %8s %8s %8s %8s %8s`
}
const infinite = '∞'
console.log(
printf(
spec,
chalk.underline(instance.url),
infinite,
1,
infinite,
'✔',
ms(timeNow - instance.created)
)
)
} else if (instance.scale.current > 0) {
let spec
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (supportsColor) {
spec = ` %-${urlLength + 10}s %8s %8s %8s %8s %8s`
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 {
spec = ` %-${urlLength + 1}s %8s %8s %8s %8s %8s`
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
console.log(
printf(
spec,
chalk.underline(instance.url),
instance.scale.current,
instance.scale.min,
instance.scale.max,
instance.scale.max === instance.scale.min ? '✖' : '✔',
ms(timeNow - instance.created)
)
)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 {
let spec
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
if (supportsColor) {
spec = ` %-${urlLength + 10}s ${chalk.gray('%8s %8s %8s %8s %8s')}`
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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 {
spec = ` %-${urlLength + 1}s ${chalk.gray('%8s %8s %8s %8s %8s')}`
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
console.log(
printf(
spec,
chalk.underline(instance.url),
instance.scale.current,
instance.scale.min,
instance.scale.max,
instance.scale.max === instance.scale.min ? '✖' : '✔',
ms(timeNow - instance.created)
)
)
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
}
console.log()
Add `logs`, `teams`, `switch`, `scale`, new `ls` and much more (#468) * Feature/teams (#25) * Add the skeleton of `now teams` * Add support for &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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 &#34;complex&#34; 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` =&gt; `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 `&gt; 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&#39;t need `args` for `now teams add` * Add missing `await` * Extract regex * `process.exit()` =&gt; `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&#39;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` =&gt; `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&#39;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&#39;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` * &#34;Prettify&#34; and improve scale command Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Adopt to now-list api changes * Improve now-list --all colors Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * Add now scale ls Signed-off-by: Jarmo Isotalo &lt;jamo@isotalo.fi&gt; * 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 &gt; 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&#39;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` =&gt; `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 &lt;username&gt;` * Make `now help` better * This shouldn&#39;t be here * Make `now switch` incredible * Remove old stuff from ~/.now.json * Add comments * `now team` =&gt; `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
}
}
process.on('uncaughtException', err => {
handleError(err)
exit(1)
})