Initial commit

parent 4aabfbb5
Pipeline #1193 failed with stages
in 0 seconds

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -16,9 +16,9 @@ end
group :development do
gem 'web-console', '4.1.0'
gem 'rack-mini-profiler', '2.3.1'
gem 'listen', '3.4.1'
gem 'spring', '2.1.1'
gem 'spring-watcher-listen', '2.0.1'
end
group :test do
......
......@@ -108,6 +108,8 @@ GEM
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
rack-mini-profiler (2.3.1)
rack (>= 1.2.0)
rack-proxy (0.7.0)
rack
rack-test (1.1.0)
......@@ -159,9 +161,6 @@ GEM
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
......@@ -209,11 +208,11 @@ DEPENDENCIES
listen (= 3.4.1)
pg (= 1.2.3)
puma (= 5.3.1)
rack-mini-profiler (= 2.3.1)
rails (= 6.1.3.2)
sass-rails (= 6.0.0)
selenium-webdriver (= 3.142.7)
spring (= 2.1.1)
spring-watcher-listen (= 2.0.1)
sqlite3 (= 1.4.2)
turbolinks (= 5.2.1)
web-console (= 4.1.0)
......
// Place all the styles related to the Microposts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
body {
background-color: #fff;
color: #333;
margin: 33px; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px; }
pre {
background-color: #eee;
padding: 10px;
font-size: 11px; }
a {
color: #000; }
a:visited {
color: #666; }
a:hover {
color: #fff;
background-color: #000; }
th {
padding-bottom: 5px; }
td {
padding: 0 5px 7px; }
div.field,
div.actions {
margin-bottom: 10px; }
#notice {
color: green; }
.field_with_errors {
padding: 2px;
background-color: red;
display: table; }
#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px 7px 0;
margin-bottom: 20px;
background-color: #f0f0f0; }
#error_explanation h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px -7px 0;
background-color: #c00;
color: #fff; }
#error_explanation ul li {
font-size: 12px;
list-style: square; }
label {
display: block; }
// Place all the styles related to the Users controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
class MicropostsController < ApplicationController
before_action :set_micropost, only: [:show, :edit, :update, :destroy]
# GET /microposts
# GET /microposts.json
def index
@microposts = Micropost.all
end
# GET /microposts/1
# GET /microposts/1.json
def show
end
# GET /microposts/new
def new
@micropost = Micropost.new
end
# GET /microposts/1/edit
def edit
end
# POST /microposts
# POST /microposts.json
def create
@micropost = Micropost.new(micropost_params)
respond_to do |format|
if @micropost.save
format.html { redirect_to @micropost, notice: 'Micropost was successfully created.' }
format.json { render :show, status: :created, location: @micropost }
else
format.html { render :new }
format.json { render json: @micropost.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /microposts/1
# PATCH/PUT /microposts/1.json
def update
respond_to do |format|
if @micropost.update(micropost_params)
format.html { redirect_to @micropost, notice: 'Micropost was successfully updated.' }
format.json { render :show, status: :ok, location: @micropost }
else
format.html { render :edit }
format.json { render json: @micropost.errors, status: :unprocessable_entity }
end
end
end
# DELETE /microposts/1
# DELETE /microposts/1.json
def destroy
@micropost.destroy
respond_to do |format|
format.html { redirect_to microposts_url, notice: 'Micropost was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_micropost
@micropost = Micropost.find(params[:id])
end
# Only allow a list of trusted parameters through.
def micropost_params
params.require(:micropost).permit(:content, :user_id)
end
end
class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
@users = User.all
end
# GET /users/1
# GET /users/1.json
def show
end
# GET /users/new
def new
@user = User.new
end
# GET /users/1/edit
def edit
end
# POST /users
# POST /users.json
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
format.html { redirect_to @user, notice: 'User was successfully created.' }
format.json { render :show, status: :created, location: @user }
else
format.html { render :new }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /users/1
# PATCH/PUT /users/1.json
def update
respond_to do |format|
if @user.update(user_params)
format.html { redirect_to @user, notice: 'User was successfully updated.' }
format.json { render :show, status: :ok, location: @user }
else
format.html { render :edit }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end
# DELETE /users/1
# DELETE /users/1.json
def destroy
@user.destroy
respond_to do |format|
format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_user
@user = User.find(params[:id])
end
# Only allow a list of trusted parameters through.
def user_params
params.require(:user).permit(:name, :email)
end
end
module MicropostsHelper
end
module UsersHelper
end
class Micropost < ApplicationRecord
validates :content, length: { maximum: 140}
end
class User < ApplicationRecord
end
<%= form_with(model: micropost) do |form| %>
<% if micropost.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(micropost.errors.count, "error") %> prohibited this micropost from being saved:</h2>
<ul>
<% micropost.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= form.label :content %>
<%= form.text_area :content %>
</div>
<div class="field">
<%= form.label :user_id %>
<%= form.number_field :user_id %>
</div>
<div class="actions">
<%= form.submit %>
</div>
<% end %>
json.extract! micropost, :id, :content, :user_id, :created_at, :updated_at
json.url micropost_url(micropost, format: :json)
<h1>Editing Micropost</h1>
<%= render 'form', micropost: @micropost %>
<%= link_to 'Show', @micropost %> |
<%= link_to 'Back', microposts_path %>
<p id="notice"><%= notice %></p>
<h1>Microposts</h1>
<table>
<thead>
<tr>
<th>Content</th>
<th>User</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @microposts.each do |micropost| %>
<tr>
<td><%= micropost.content %></td>
<td><%= micropost.user_id %></td>
<td><%= link_to 'Show', micropost %></td>
<td><%= link_to 'Edit', edit_micropost_path(micropost) %></td>
<td><%= link_to 'Destroy', micropost, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Micropost', new_micropost_path %>
json.array! @microposts, partial: "microposts/micropost", as: :micropost
<h1>New Micropost</h1>
<%= render 'form', micropost: @micropost %>
<%= link_to 'Back', microposts_path %>
<p id="notice"><%= notice %></p>
<p>
<strong>Content:</strong>
<%= @micropost.content %>
</p>
<p>
<strong>User:</strong>
<%= @micropost.user_id %>
</p>
<%= link_to 'Edit', edit_micropost_path(@micropost) %> |
<%= link_to 'Back', microposts_path %>
json.partial! "microposts/micropost", micropost: @micropost
<%= form_with(model: user) do |form| %>
<% if user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% user.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= form.label :name %>
<%= form.text_field :name %>
</div>
<div class="field">
<%= form.label :email %>
<%= form.text_field :email %>
</div>
<div class="actions">
<%= form.submit %>
</div>
<% end %>
json.extract! user, :id, :name, :email, :created_at, :updated_at
json.url user_url(user, format: :json)
<h1>Editing User</h1>
<%= render 'form', user: @user %>
<%= link_to 'Show', @user %> |
<%= link_to 'Back', users_path %>
<p id="notice"><%= notice %></p>
<h1>Users</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @users.each do |user| %>
<tr>
<td><%= user.name %></td>
<td><%= user.email %></td>
<td><%= link_to 'Show', user %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>
<td><%= link_to 'Destroy', user, method: :delete,
data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New User', new_user_path %>
\ No newline at end of file
json.array! @users, partial: "users/user", as: :user
<h1>New User</h1>
<%= render 'form', user: @user %>
<%= link_to 'Back', users_path %>
<p id="notice"><%= notice %></p>
<p>
<strong>Name:</strong>
<%= @user.name %>
</p>
<p>
<strong>Email:</strong>
<%= @user.email %>
</p>
<%= link_to 'Edit', edit_user_path(@user) %> |
<%= link_to 'Back', users_path %>
json.partial! "users/user", user: @user
......@@ -73,4 +73,5 @@ Rails.application.configure do
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
config.hosts.clear
end
......@@ -28,8 +28,7 @@ Rails.application.configure do
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
config.assets.compile = true
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.asset_host = 'http://assets.example.com'
......
Rails.application.routes.draw do
root 'application#hello'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
resources :microposts
resources :users
root 'users#index'
get "/auth/:provider/callback" => "sessions#create"
get "/signout"=>"sessions#destroy", :as => :signout
end
class CreateUsers < ActiveRecord::Migration[6.1]
def change
create_table :users do |t|
t.string :name
t.string :email
t.timestamps
end
end
end
class CreateMicroposts < ActiveRecord::Migration[6.1]
def change
create_table :microposts do |t|
t.text :content
t.integer :user_id
t.timestamps
end
end
end
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_06_01_065029) do
create_table "microposts", force: :cascade do |t|
t.text "content"
t.integer "user_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "users", force: :cascade do |t|
t.string "name"
t.string "email"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
end
The ISC License (ISC)
Copyright © Heroku 2017
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Heroku CLI
==========
![Heroku logo](https://d4yt8xl9b7in.cloudfront.net/assets/home/logotype-heroku.png)
[![CircleCI](https://circleci.com/gh/heroku/cli.svg?style=svg&circle-token=40b6a6c06ece93bccf45e2c648b39e1db3763c97)](https://circleci.com/gh/heroku/cli/tree/master)
[![CircleCI](https://circleci.com/gh/heroku/cli-macos-installer/tree/master.svg?style=svg&circle-token=90b3b4392dc1668e97108edabdfc2c6baddc3a17)](https://circleci.com/gh/heroku/cli-macos-installer/tree/master)
[![Snap Status](https://build.snapcraft.io/badge/heroku/cli.svg)](https://build.snapcraft.io/user/heroku/cli)
[![npm](https://img.shields.io/npm/v/heroku.svg)](https://www.npmjs.com/package/heroku)
[![ISC License](https://img.shields.io/github/license/heroku/cli.svg)](https://github.com/heroku/cli/blob/master/LICENSE)
The Heroku CLI is used to manage Heroku apps from the command line. It is built using [oclif](https://oclif.io).
For more about Heroku see <https://www.heroku.com/home>
To get started see <https://devcenter.heroku.com/start>
Overview
========
This is the next generation Node-based Heroku CLI. The goals of this project were to make plugins more flexible, remove Ruby as a runtime dependency, and make the CLI faster.
It has identical functionality to the old Ruby CLI. Under the hood, it is a modular CLI made up of node.js plugins.
For more on developing plugins, read [Developing CLI Plugins](https://devcenter.heroku.com/articles/developing-cli-plugins)
Issues
======
For problems directly related to the CLI, [add an issue on GitHub](https://github.com/heroku/cli/issues/new).
For other issues, [submit a support ticket](https://help.heroku.com/).
[Contributors](https://github.com/heroku/cli/contributors)
<!-- commands -->
# Command Topics
* [`heroku access`](docs/access.md) - manage user access to apps
* [`heroku addons`](docs/addons.md) - tools and services for developing, extending, and operating your app
* [`heroku apps`](docs/apps.md) - manage apps on Heroku
* [`heroku auth`](docs/auth.md) - check 2fa status
* [`heroku authorizations`](docs/authorizations.md) - OAuth authorizations
* [`heroku autocomplete`](docs/autocomplete.md) - display autocomplete installation instructions
* [`heroku buildpacks`](docs/buildpacks.md) - scripts used to compile apps
* [`heroku certs`](docs/certs.md) - a topic for the ssl plugin
* [`heroku ci`](docs/ci.md) - run an application test suite on Heroku
* [`heroku clients`](docs/clients.md) - OAuth clients on the platform
* [`heroku config`](docs/config.md) - environment variables of apps
* [`heroku container`](docs/container.md) - Use containers to build and deploy Heroku apps
* [`heroku domains`](docs/domains.md) - custom domains for apps
* [`heroku drains`](docs/drains.md) - forward logs to syslog or HTTPS
* [`heroku features`](docs/features.md) - add/remove app features
* [`heroku git`](docs/git.md) - manage local git repository for app
* [`heroku help`](docs/help.md) - display help for heroku
* [`heroku keys`](docs/keys.md) - add/remove account ssh keys
* [`heroku labs`](docs/labs.md) - add/remove experimental features
* [`heroku local`](docs/local.md) - run Heroku app locally
* [`heroku logs`](docs/logs.md) - display recent log output
* [`heroku maintenance`](docs/maintenance.md) - enable/disable access to app
* [`heroku members`](docs/members.md) - manage organization members
* [`heroku notifications`](docs/notifications.md) - display notifications
* [`heroku orgs`](docs/orgs.md) - manage organizations
* [`heroku pg`](docs/pg.md) - manage postgresql databases
* [`heroku pipelines`](docs/pipelines.md) - manage pipelines
* [`heroku plugins`](docs/plugins.md) - list installed plugins
* [`heroku ps`](docs/ps.md) - Client tools for Heroku Exec
* [`heroku psql`](docs/psql.md) - open a psql shell to the database
* [`heroku redis`](docs/redis.md) - manage heroku redis instances
* [`heroku regions`](docs/regions.md) - list available regions for deployment
* [`heroku releases`](docs/releases.md) - display the releases for an app
* [`heroku reviewapps`](docs/reviewapps.md) - manage reviewapps in pipelines
* [`heroku run`](docs/run.md) - run a one-off process inside a Heroku dyno
* [`heroku sessions`](docs/sessions.md) - OAuth sessions
* [`heroku spaces`](docs/spaces.md) - manage heroku private spaces
* [`heroku status`](docs/status.md) - status of the Heroku platform
* [`heroku teams`](docs/teams.md) - manage teams
* [`heroku update`](docs/update.md) - update the Heroku CLI
* [`heroku webhooks`](docs/webhooks.md) - list webhooks on an app
<!-- commandsstop -->
Developing
==========
This project is built with [lerna](https://lerna.js.org/). The core plugins are located in [./packages](./packages). Run `lerna bootstrap` after cloning the repository to set it up.
The standard `oclif` `./bin/run` script serves as your entry point to the CLI in your local development environment.
Releasing
=========
See the [Heroku CLI Release Steps](https://salesforce.quip.com/aPLDA1ZwjNlW).
Review our [PR guidelines](./.github/PULL_REQUEST_TEMPLATE.md).
#!/usr/bin/env bash
set -e
echoerr() { echo "$@" 1>&2; }
get_script_dir () {
SOURCE="${BASH_SOURCE[0]}"
# While $SOURCE is a symlink, resolve it
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
# If $SOURCE was a relative symlink (so no "/" as prefix, need to resolve it relative to the symlink base directory
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
echo "$DIR"
}
DIR=$(get_script_dir)
CLI_HOME=$(cd && pwd)
XDG_DATA_HOME=${XDG_DATA_HOME:="$CLI_HOME/.local/share"}
CLIENT_HOME=${HEROKU_OCLIF_CLIENT_HOME:=$XDG_DATA_HOME/heroku/client}
BIN_PATH="$CLIENT_HOME/bin/heroku"
if [ -z "$HEROKU_REDIRECTED" ] && [ -x "$BIN_PATH" ] && [[ ! "$DIR/heroku" -ef "$BIN_PATH" ]]; then
if [ "$DEBUG" == "*" ]; then
echoerr "$BIN_PATH" "$@"
fi
HEROKU_BINPATH="$BIN_PATH" HEROKU_REDIRECTED=1 "$BIN_PATH" "$@"
else
export HEROKU_BINPATH=${HEROKU_BINPATH:="$DIR/heroku"}
if [ -x "$(command -v "$XDG_DATA_HOME/oclif/node/node-custom")" ]; then
NODE="$XDG_DATA_HOME/oclif/node/node-custom"
elif [ -x "$(command -v "$DIR/node")" ]; then
NODE="$DIR/node"
elif [ -x "$(command -v "$XDG_DATA_HOME/oclif/node/node-12.21.0")" ]; then
NODE="$XDG_DATA_HOME/oclif/node/node-12.21.0"
elif [ -x "$(command -v node)" ]; then
NODE=node
else
echoerr 'Error: node is not installed.' >&2
exit 1
fi
if [ "$DEBUG" == "*" ]; then
echoerr HEROKU_BINPATH="$HEROKU_BINPATH" "$NODE" "$DIR/run" "$@"
fi
"$NODE" "$DIR/run" "$@"
fi
@echo off
setlocal enableextensions
if not "%HEROKU_REDIRECTED%"=="1" if exist "%LOCALAPPDATA%\heroku\client\bin\heroku.cmd" (
set HEROKU_REDIRECTED=1
"%LOCALAPPDATA%\heroku\client\bin\heroku.cmd" %*
goto:EOF
)
if not defined HEROKU_BINPATH set HEROKU_BINPATH="%~dp0heroku.cmd"
if exist "%~dp0..\bin\node.exe" (
"%~dp0..\bin\node.exe" "%~dp0..\bin\run" %*
) else if exist "%LOCALAPPDATA%\oclif\node\node-12.21.0.exe" (
"%LOCALAPPDATA%\oclif\node\node-12.21.0.exe" "%~dp0..\bin\run" %*
) else (
node "%~dp0..\bin\run" %*
)
File added
#!/usr/bin/env node
process.env.HEROKU_UPDATE_INSTRUCTIONS = process.env.HEROKU_UPDATE_INSTRUCTIONS || 'update with: "npm update -g heroku"'
require('@oclif/command').run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
import * as Config from '@oclif/config';
import deps from './deps';
export interface RecordOpts {
Command: Config.Command.Class;
argv: string[];
}
export interface AnalyticsInterface {
source: string;
event: string;
properties: {
cli: string;
command: string;
completion: number;
version: string;
plugin: string;
plugin_version: string;
os: string;
shell: string;
valid: boolean;
language: string;
install_id: string;
};
}
export default class AnalyticsCommand {
config: Config.IConfig;
userConfig: typeof deps.UserConfig.prototype;
http: typeof deps.HTTP;
constructor(config: Config.IConfig);
record(opts: RecordOpts): Promise<any>;
get url(): string;
get authorizationToken(): string | undefined;
get netrcToken(): string | undefined;
get usingHerokuAPIKey(): boolean;
get netrcLogin(): string | undefined;
get user(): string | undefined;
_acAnalytics(id: string): Promise<number>;
private init;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const command_1 = require("@heroku-cli/command");
const netrc_parser_1 = tslib_1.__importDefault(require("netrc-parser"));
const path = tslib_1.__importStar(require("path"));
const deps_1 = tslib_1.__importDefault(require("./deps"));
const debug = require('debug')('heroku:analytics');
class AnalyticsCommand {
constructor(config) {
this.config = config;
this.http = deps_1.default.HTTP.create({
headers: { 'user-agent': config.userAgent },
});
}
async record(opts) {
await this.init();
const plugin = opts.Command.plugin;
if (!plugin) {
debug('no plugin found for analytics');
return;
}
if (this.userConfig.skipAnalytics)
return;
const analyticsData = {
source: 'cli',
event: opts.Command.id,
properties: {
cli: this.config.name,
command: opts.Command.id,
completion: await this._acAnalytics(opts.Command.id),
version: this.config.version,
plugin: plugin.name,
plugin_version: plugin.version,
os: this.config.platform,
shell: this.config.shell,
valid: true,
language: 'node',
install_id: this.userConfig.install,
},
};
const data = Buffer.from(JSON.stringify(analyticsData)).toString('base64');
if (this.authorizationToken) {
return this.http.get(`${this.url}?data=${data}`, { headers: { authorization: `Bearer ${this.authorizationToken}` } }).catch(error => debug(error));
}
return this.http.get(`${this.url}?data=${data}`).catch(error => debug(error));
}
get url() {
return process.env.HEROKU_ANALYTICS_URL || 'https://backboard.heroku.com/hamurai';
}
get authorizationToken() {
return process.env.HEROKU_API_KEY || this.netrcToken;
}
get netrcToken() {
return netrc_parser_1.default.machines[command_1.vars.apiHost] && netrc_parser_1.default.machines[command_1.vars.apiHost].password;
}
get usingHerokuAPIKey() {
const k = process.env.HEROKU_API_KEY;
return Boolean(k && k.length > 0);
}
get netrcLogin() {
return netrc_parser_1.default.machines[command_1.vars.apiHost] && netrc_parser_1.default.machines[command_1.vars.apiHost].login;
}
get user() {
if (this.usingHerokuAPIKey)
return;
return this.netrcLogin;
}
async _acAnalytics(id) {
if (id === 'autocomplete:options')
return 0;
const root = path.join(this.config.cacheDir, 'autocomplete', 'completion_analytics');
const meta = {
cmd: deps_1.default.file.exists(path.join(root, 'command')),
flag: deps_1.default.file.exists(path.join(root, 'flag')),
value: deps_1.default.file.exists(path.join(root, 'value')),
};
let score = 0;
if (await meta.cmd)
score += 1;
if (await meta.flag)
score += 2;
if (await meta.value)
score += 4;
if (await deps_1.default.file.exists(root))
await deps_1.default.file.remove(root);
return score;
}
async init() {
await netrc_parser_1.default.load();
this.userConfig = new deps_1.default.UserConfig(this.config);
await this.userConfig.init();
}
}
exports.default = AnalyticsCommand;
import { HTTP } from 'http-call';
import UserConfig from './user-config';
import FS = require('fs-extra');
import file = require('./file');
declare const _default: {
readonly fs: typeof FS;
readonly HTTP: typeof HTTP;
readonly file: typeof file;
readonly UserConfig: typeof UserConfig;
};
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cache = {};
function fetch(s) {
if (!cache[s]) {
cache[s] = require(s);
}
return cache[s];
}
exports.default = {
get fs() {
return fetch('fs-extra');
},
get HTTP() {
return fetch('http-call').HTTP;
},
get file() {
return fetch('./file');
},
get UserConfig() {
return fetch('./user-config').default;
},
};
/// <reference types="node" />
import * as FS from 'fs-extra';
export declare function exists(f: string): Promise<boolean>;
export declare function stat(file: string): Promise<FS.Stats>;
export declare function rename(from: string, to: string): Promise<void>;
export declare function remove(file: string): Promise<void>;
export declare function ls(dir: string): Promise<{
path: string;
stat: FS.Stats;
}[]>;
export declare function removeEmptyDirs(dir: string): Promise<void>;
export declare function readJSON(file: string): Promise<any>;
export declare function outputJSON(file: string, data: any, options?: FS.WriteOptions): Promise<void>;
export declare function realpathSync(p: string): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path = tslib_1.__importStar(require("path"));
const deps_1 = tslib_1.__importDefault(require("./deps"));
const debug = require('debug')('heroku-cli:file');
function exists(f) {
return deps_1.default.fs.pathExists(f);
}
exports.exists = exists;
async function stat(file) {
// debug('stat', file)
return deps_1.default.fs.stat(file);
}
exports.stat = stat;
async function rename(from, to) {
debug('rename', from, to);
return deps_1.default.fs.rename(from, to);
}
exports.rename = rename;
async function remove(file) {
if (!await exists(file))
return;
debug('remove', file);
return deps_1.default.fs.remove(file);
}
exports.remove = remove;
async function ls(dir) {
const files = await deps_1.default.fs.readdir(dir);
const paths = files.map(f => path.join(dir, f));
return Promise.all(paths.map(path => deps_1.default.fs.stat(path).then(stat => ({ path, stat }))));
}
exports.ls = ls;
async function removeEmptyDirs(dir) {
let files;
try {
files = await ls(dir);
}
catch (error) {
if (error.code === 'ENOENT')
return;
throw error;
}
const dirs = files.filter(f => f.stat.isDirectory()).map(f => f.path);
// eslint-disable-next-line no-await-in-loop
for (const p of dirs.map(removeEmptyDirs))
await p;
files = await ls(dir);
if (files.length === 0)
await remove(dir);
}
exports.removeEmptyDirs = removeEmptyDirs;
async function readJSON(file) {
debug('readJSON', file);
return deps_1.default.fs.readJSON(file);
}
exports.readJSON = readJSON;
async function outputJSON(file, data, options = {}) {
debug('outputJSON', file);
return deps_1.default.fs.outputJSON(file, data, Object.assign({ spaces: 2 }, options));
}
exports.outputJSON = outputJSON;
function realpathSync(p) {
return deps_1.default.fs.realpathSync(p);
}
exports.realpathSync = realpathSync;
import { Hook } from '@oclif/config';
export declare function checkTos(options: any): void;
declare const hook: Hook.Init;
export default hook;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path = tslib_1.__importStar(require("path"));
const fs = tslib_1.__importStar(require("fs-extra"));
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
function checkTos(options) {
const tosPath = path.join(options.config.cacheDir, 'terms-of-service');
const viewedBanner = fs.pathExistsSync(tosPath);
const message = 'Our terms of service have changed: https://dashboard.heroku.com/terms-of-service';
if (!viewedBanner) {
cli_ux_1.default.warn(message);
fs.createFile(tosPath);
}
}
exports.checkTos = checkTos;
const hook = async function (options) {
checkTos(options);
};
exports.default = hook;
import { Hook } from '@oclif/config';
export declare const version: Hook.Init;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const allowlist = [
'HEROKU_API_KEY',
'HEROKU_APP',
'HTTPS_PROXY',
'HTTP_PROXY',
'SSL_CERT_FILE',
'SSL_CERT_DIR',
'SSL_CA_FILE',
'SSL_KEY_FILE',
];
exports.version = async function () {
if (['-v', '--version', 'version'].includes(process.argv[2])) {
for (const env of allowlist) {
if (process.env[env]) {
const value = env === 'HEROKU_API_KEY' ? 'to [REDACTED]' : `to ${process.env[env]}`;
this.warn(`${env} set ${value}`);
}
}
}
};
import { Hook } from '@oclif/config';
export declare const analytics: Hook<'prerun'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const analytics_1 = tslib_1.__importDefault(require("../../analytics"));
exports.analytics = async function (options) {
const analytics = new analytics_1.default(this.config);
await analytics.record(options);
};
import { Hook } from '@oclif/config';
export declare const brewHook: Hook<'update'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const child_process_1 = require("child_process");
const path = tslib_1.__importStar(require("path"));
const fs = tslib_1.__importStar(require("../../file"));
const debug = require('debug')('heroku:brewhook');
function brew(args, opts = {}) {
debug('brew %o', args);
return child_process_1.spawnSync('brew', args, Object.assign(Object.assign({ stdio: 'inherit' }, opts), { encoding: 'utf8' }));
}
exports.brewHook = async function () {
if (this.config.platform !== 'darwin')
return;
const brewRoot = path.join(process.env.HOMEBREW_PREFIX || '/usr/local');
let binPath;
try {
binPath = fs.realpathSync(path.join(brewRoot, 'bin/heroku'));
}
catch (error) {
if (error.code === 'ENOENT')
return;
throw error;
}
let cellarPath;
if (binPath && binPath.startsWith(path.join(brewRoot, 'Cellar'))) {
cellarPath = path.resolve(binPath, path.dirname(path.relative(binPath, path.join(brewRoot, 'Cellar/heroku'))));
}
const fetchInstallReceipt = async () => {
if (!cellarPath)
return;
return fs.readJSON(path.join(cellarPath, 'INSTALL_RECEIPT.json'));
};
const needsMigrate = async () => {
const receipt = await fetchInstallReceipt();
if (!receipt)
return false;
return receipt.source.tap === 'homebrew/core';
};
if (!await needsMigrate())
return;
debug('migrating from brew');
// not on private tap, move to it
brew(['uninstall', 'heroku']);
brew(['install', 'heroku/brew/heroku']);
};
import { Hook } from '@oclif/config';
export declare const brewHook: Hook<'update'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const child_process_1 = require("child_process");
const path = tslib_1.__importStar(require("path"));
const fs = tslib_1.__importStar(require("../../file"));
const debug = require('debug')('heroku:brewhook');
function brew(args, opts = {}) {
debug('brew %o', args);
return child_process_1.spawnSync('brew', args, Object.assign(Object.assign({ stdio: 'inherit' }, opts), { encoding: 'utf8' }));
}
exports.brewHook = async function () {
if (this.config.platform !== 'darwin')
return;
const brewRoot = path.join(process.env.HOMEBREW_PREFIX || '/usr/local');
let binPath;
try {
binPath = fs.realpathSync(path.join(brewRoot, 'bin/heroku'));
}
catch (error) {
if (error.code === 'ENOENT')
return;
throw error;
}
let cellarPath;
if (binPath && binPath.startsWith(path.join(brewRoot, 'Cellar'))) {
cellarPath = path.resolve(binPath, path.dirname(path.relative(binPath, path.join(brewRoot, 'Cellar/heroku'))));
}
const fetchInstallReceipt = async () => {
if (!cellarPath)
return;
return fs.readJSON(path.join(cellarPath, 'INSTALL_RECEIPT.json'));
};
const needsMigrate = async () => {
const receipt = await fetchInstallReceipt();
if (!receipt)
return false;
return receipt.source.tap === 'homebrew/core';
};
if (!await needsMigrate())
return;
debug('migrating from brew');
// not on private tap, move to it
brew(['uninstall', 'heroku']);
brew(['install', 'heroku/brew/heroku']);
};
import { Hook } from '@oclif/config';
export declare const brewHook: Hook<'update'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.brewHook = async function () {
// autocomplete is now in core, skip windows
if (this.config.windows)
return;
await this.config.runHook('recache', { type: 'update' });
};
import { Hook } from '@oclif/config';
export declare const migrate: Hook<'init'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs = tslib_1.__importStar(require("fs-extra"));
const path = tslib_1.__importStar(require("path"));
const exec = (cmd, args) => {
const execa = require('execa');
return execa(cmd, args, { stdio: 'inherit' });
};
exports.migrate = async function () {
if (process.argv[2] && process.argv[2].startsWith('plugins'))
return;
const pluginsDir = path.join(this.config.dataDir, 'plugins');
const yarnLockFilePath = path.join(this.config.dataDir, 'yarn.lock');
const removeYarnLockFile = async () => {
if (await fs.existsSync(yarnLockFilePath)) {
const yarnLockFile = await fs.readFileSync(yarnLockFilePath);
if (yarnLockFile.toString().includes('cli-npm.heroku.com')) {
await fs.remove(yarnLockFilePath);
}
}
};
const migrateV6Plugins = async () => {
if (!await fs.pathExists(pluginsDir))
return;
process.stderr.write('heroku: migrating plugins\n');
try {
const p = path.join(pluginsDir, 'user.json');
if (await fs.pathExists(p)) {
const { manifest } = await fs.readJSON(p);
for (const plugin of Object.keys(manifest.plugins)) {
process.stderr.write(`heroku-cli: migrating ${plugin}\n`);
// eslint-disable-next-line no-await-in-loop
await exec('heroku', ['plugins:install', plugin]);
}
}
}
catch (error) {
this.warn(error);
}
try {
const p = path.join(pluginsDir, 'link.json');
if (await fs.pathExists(p)) {
const { manifest } = await fs.readJSON(path.join(pluginsDir, 'link.json'));
for (const { root } of Object.values(manifest.plugins)) {
process.stderr.write(`heroku-cli: migrating ${root}\n`);
// eslint-disable-next-line no-await-in-loop
await exec('heroku', ['plugins:link', root]);
}
}
}
catch (error) {
this.warn(error);
}
await fs.remove(pluginsDir);
process.stderr.write('heroku: done migrating plugins\n');
};
await removeYarnLockFile();
await migrateV6Plugins();
};
import { Hook } from '@oclif/config';
export declare const tidy: Hook<'update'>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path = tslib_1.__importStar(require("path"));
const deps_1 = tslib_1.__importDefault(require("../../deps"));
exports.tidy = async function () {
const cleanupPlugins = async () => {
const pluginsDir = path.join(this.config.dataDir, 'plugins');
if (await deps_1.default.file.exists(path.join(pluginsDir, 'plugins.json')))
return;
let pjson;
try {
pjson = await deps_1.default.file.readJSON(path.join(pluginsDir, 'package.json'));
}
catch (error) {
if (error.code !== 'ENOENT')
throw error;
return;
}
if (!pjson.dependencies || pjson.dependencies === {}) {
await deps_1.default.file.remove(path.join(pluginsDir));
}
};
await deps_1.default.file.removeEmptyDirs(path.join(this.config.dataDir, 'tmp'));
if (this.config.configDir !== this.config.dataDir) {
await deps_1.default.file.removeEmptyDirs(this.config.configDir);
}
if (this.config.cacheDir !== this.config.dataDir) {
await cleanupPlugins();
}
};
export { run } from '@oclif/command';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var command_1 = require("@oclif/command");
exports.run = command_1.run;
import * as Config from '@oclif/config';
export interface ConfigJSON {
schema: 1;
install?: string;
skipAnalytics?: boolean;
}
export default class UserConfig {
private readonly config;
private needsSave;
private body;
private mtime?;
private saving?;
private _init;
constructor(config: Config.IConfig);
get install(): string;
set install(install: string);
get skipAnalytics(): boolean;
init(): Promise<void>;
private get debug();
private get file();
private save;
private read;
private migrate;
private canWrite;
private getLastUpdated;
private genInstall;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path = tslib_1.__importStar(require("path"));
const deps_1 = tslib_1.__importDefault(require("./deps"));
class UserConfig {
// eslint-disable-next-line no-useless-constructor
constructor(config) {
this.config = config;
this.needsSave = false;
}
get install() {
return this.body.install || this.genInstall();
}
set install(install) {
this.body.install = install;
this.needsSave = true;
}
get skipAnalytics() {
if (this.config.scopedEnvVar('SKIP_ANALYTICS') === '1')
return true;
if (typeof this.body.skipAnalytics !== 'boolean') {
this.body.skipAnalytics = false;
this.needsSave = true;
}
return this.body.skipAnalytics;
}
async init() {
await this.saving;
if (this._init)
return this._init;
this._init = (async () => {
this.debug('init');
this.body = (await this.read()) || { schema: 1 };
if (!this.body.schema) {
this.body.schema = 1;
this.needsSave = true;
}
else if (this.body.schema !== 1)
this.body = { schema: 1 };
// tslint:disable-next-line
this.install;
// tslint:disable-next-line
this.skipAnalytics;
if (this.needsSave)
await this.save();
})();
return this._init;
}
get debug() {
return require('debug')('heroku:user_config');
}
get file() {
return path.join(this.config.dataDir, 'config.json');
}
async save() {
if (!this.needsSave)
return;
this.needsSave = false;
this.saving = (async () => {
this.debug('saving');
if (!await this.canWrite()) {
throw new Error('file modified, cannot save');
}
await deps_1.default.file.outputJSON(this.file, this.body);
})();
}
async read() {
await this.migrate();
try {
this.mtime = await this.getLastUpdated();
const body = await deps_1.default.file.readJSON(this.file);
return body;
}
catch (error) {
if (error.code !== 'ENOENT')
throw error;
this.debug('not found');
}
}
async migrate() {
if (await deps_1.default.file.exists(this.file))
return;
const old = path.join(this.config.configDir, 'config.json');
if (!await deps_1.default.file.exists(old))
return;
this.debug('moving config into new place');
await deps_1.default.file.rename(old, this.file);
}
async canWrite() {
if (!this.mtime)
return true;
return (await this.getLastUpdated()) === this.mtime;
}
async getLastUpdated() {
try {
const stat = await deps_1.default.file.stat(this.file);
return stat.mtime.getTime();
}
catch (error) {
if (error.code !== 'ENOENT')
throw error;
}
}
genInstall() {
const uuid = require('uuid/v4');
this.install = uuid();
return this.install;
}
}
exports.default = UserConfig;
../cardinal/bin/cdl.js
\ No newline at end of file
../esprima/bin/esparse.js
\ No newline at end of file
../esprima/bin/esvalidate.js
\ No newline at end of file
../is-docker/cli.js
\ No newline at end of file
../js-yaml/bin/js-yaml.js
\ No newline at end of file
../mkdirp/bin/cmd.js
\ No newline at end of file
../mustache/bin/mustache
\ No newline at end of file
../foreman/nf.js
\ No newline at end of file
../nopt/bin/nopt.js
\ No newline at end of file
../rimraf/bin.js
\ No newline at end of file
../semver/bin/semver
\ No newline at end of file
../sparkline/bin/sparkline
\ No newline at end of file
../uuid/bin/uuid
\ No newline at end of file
../which/bin/which
\ No newline at end of file
../yarn/bin/yarn.js
\ No newline at end of file
../yarn/bin/yarn.js
\ No newline at end of file
"use strict";
process.env.FORCE_COLOR = '1';
process.env.TERM = 'screen-256color';
import chalk from 'chalk';
import * as supports from 'supports-color';
export declare const CustomColors: {
supports: typeof supports;
gray: (s: string) => string;
grey: (s: string) => string;
dim: (s: string) => string;
attachment: (s: string) => string;
addon: (s: string) => string;
configVar: (s: string) => string;
release: (s: string) => string;
cmd: (s: string) => string;
pipeline: (s: string) => string;
app: (s: string) => string;
heroku: (s: string) => string;
stripColor: (s: string) => string;
};
export declare const color: typeof CustomColors & typeof chalk;
export default color;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ansiStyles = require("ansi-styles");
const chalk_1 = require("chalk");
const supports = require("supports-color");
const util_1 = require("util");
let stripColor = (s) => {
return require('strip-ansi')(s);
};
const dim = process.env.ConEmuANSI === 'ON' ? chalk_1.default.gray : chalk_1.default.dim;
exports.CustomColors = {
supports,
// map gray -> dim because it's not solarized compatible
gray: dim,
grey: dim,
dim,
attachment: chalk_1.default.cyan,
addon: chalk_1.default.yellow,
configVar: chalk_1.default.green,
release: chalk_1.default.blue.bold,
cmd: chalk_1.default.cyan.bold,
pipeline: chalk_1.default.green.bold,
app: (s) => chalk_1.default.enabled ? exports.color.heroku(`⬢ ${s}`) : s,
heroku: (s) => {
if (!chalk_1.default.enabled)
return s;
if (!exports.color.supports)
return s;
let has256 = exports.color.supportsColor.has256 || (process.env.TERM || '').indexOf('256') !== -1;
return has256 ? '\u001b[38;5;104m' + s + ansiStyles.reset.open : chalk_1.default.magenta(s);
},
stripColor: util_1.deprecate(stripColor, '.stripColor is deprecated. Please import the "strip-ansi" module directly instead.'),
};
exports.color = new Proxy(chalk_1.default, {
get: (chalk, name) => {
if (exports.CustomColors[name])
return exports.CustomColors[name];
return chalk[name];
},
set: (chalk, name, value) => {
switch (name) {
case 'enabled':
chalk.enabled = value;
break;
default:
throw new Error(`cannot set property ${name.toString()}`);
}
return true;
},
});
exports.default = exports.color;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
jest.mock('util');
const util = require('util');
util.deprecate.mockImplementation((fn) => (...args) => fn(...args));
const color_1 = require("./color");
beforeEach(() => {
color_1.default.enabled = true;
});
afterEach(() => {
color_1.default.enabled = false;
});
test('enabled', () => {
expect(color_1.default.red('foo')).toEqual('\u001b[31mfoo\u001b[39m');
expect(color_1.default.attachment('foo')).toEqual('\u001b[36mfoo\u001b[39m');
});
test('disabled', () => {
color_1.default.enabled = false;
expect(color_1.default.red('foo')).toEqual('foo');
expect(color_1.default.attachment('foo')).toEqual('foo');
});
test('app', () => {
expect(color_1.default.app('foo')).toEqual('\u001b[38;5;104m⬢ foo\u001b[0m');
color_1.default.enabled = false;
expect(color_1.default.app('foo')).toEqual('foo');
});
test('cannot set things', () => {
expect(() => (color_1.default.foo = 'bar')).toThrowError(/cannot set property foo/);
});
test('stripColor', () => {
expect(color_1.default.stripColor(color_1.default.red('foo'))).toEqual('foo');
expect(util.deprecate).toBeCalled();
});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
\ No newline at end of file
# tslib
This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
This library is primarily used by the `--importHelpers` flag in TypeScript.
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:
```ts
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
exports.x = {};
exports.y = __assign({}, exports.x);
```
will instead be emitted as something like the following:
```ts
var tslib_1 = require("tslib");
exports.x = {};
exports.y = tslib_1.__assign({}, exports.x);
```
Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.
# Installing
For the latest stable version, run:
## npm
```sh
# TypeScript 2.3.3 or later
npm install --save tslib
# TypeScript 2.3.2 or earlier
npm install --save tslib@1.6.1
```
## yarn
```sh
# TypeScript 2.3.3 or later
yarn add tslib
# TypeScript 2.3.2 or earlier
yarn add tslib@1.6.1
```
## bower
```sh
# TypeScript 2.3.3 or later
bower install tslib
# TypeScript 2.3.2 or earlier
bower install tslib@1.6.1
```
## JSPM
```sh
# TypeScript 2.3.3 or later
jspm install tslib
# TypeScript 2.3.2 or earlier
jspm install tslib@1.6.1
```
# Usage
Set the `importHelpers` compiler option on the command line:
```
tsc --importHelpers file.ts
```
or in your tsconfig.json:
```json
{
"compilerOptions": {
"importHelpers": true
}
}
```
#### For bower and JSPM users
You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
```json
{
"compilerOptions": {
"module": "amd",
"importHelpers": true,
"baseUrl": "./",
"paths": {
"tslib" : ["bower_components/tslib/tslib.d.ts"]
}
}
}
```
For JSPM users:
```json
{
"compilerOptions": {
"module": "system",
"importHelpers": true,
"baseUrl": "./",
"paths": {
"tslib" : ["jspm_packages/npm/tslib@1.13.0/tslib.d.ts"]
}
}
}
```
# Contribute
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
# Documentation
* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
* [Programming handbook](http://www.typescriptlang.org/Handbook)
* [Homepage](http://www.typescriptlang.org/)
{
"name": "tslib",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "1.13.0",
"license": "0BSD",
"description": "Runtime library for TypeScript helper functions",
"keywords": [
"TypeScript",
"Microsoft",
"compiler",
"language",
"javascript",
"tslib",
"runtime"
],
"bugs": {
"url": "https://github.com/Microsoft/TypeScript/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/tslib.git"
},
"main": "tslib.js",
"module": "tslib.es6.js",
"jsnext:main": "tslib.es6.js",
"typings": "tslib.d.ts",
"sideEffects": false
}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
export declare function __extends(d: Function, b: Function): void;
export declare function __assign(t: any, ...sources: any[]): any;
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
export declare function __param(paramIndex: number, decorator: Function): Function;
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
export declare function __generator(thisArg: any, body: Function): any;
export declare function __exportStar(m: any, exports: any): void;
export declare function __values(o: any): any;
export declare function __read(o: any, n?: number): any[];
export declare function __spread(...args: any[][]): any[];
export declare function __spreadArrays(...args: any[][]): any[];
export declare function __await(v: any): any;
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
export declare function __asyncDelegator(o: any): any;
export declare function __asyncValues(o: any): any;
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
export declare function __importStar<T>(mod: T): T;
export declare function __importDefault<T>(mod: T): T | { default: T };
export declare function __classPrivateFieldGet<T extends object, V>(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V;
export declare function __classPrivateFieldSet<T extends object, V>(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V;
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;
\ No newline at end of file
<script src="tslib.es6.js"></script>
\ No newline at end of file
<script src="tslib.js"></script>
\ No newline at end of file
{
"name": "@heroku-cli/color",
"description": "base CLI command for cli-engine",
"version": "1.1.14",
"author": "Jeff Dickey @jdxcode",
"bugs": "https://github.com/heroku/heroku-cli-color/issues",
"dependencies": {
"ansi-styles": "^3.2.1",
"chalk": "^2.4.1",
"strip-ansi": "^5.0.0",
"supports-color": "^5.5.0",
"tslib": "^1.9.3"
},
"devDependencies": {
"@heroku-cli/tslint": "^1.1.4",
"@types/ansi-styles": "3.2.1",
"@types/chalk": "2.2.0",
"@types/jest": "^23.3.5",
"@types/node": "10.12.0",
"@types/supports-color": "5.3.0",
"del-cli": "1.1.0",
"jest": "^23.6.0",
"lint-staged": "7.3.0",
"prettier": "^1.14.3",
"ts-jest": "^23.10.4",
"tslint": "^5.11.0",
"typescript": "3.1.3"
},
"engines": {
"node": ">=6.0.0"
},
"files": [
"lib"
],
"homepage": "https://github.com/heroku/heroku-cli-color",
"keywords": [
"heroku",
"heroku-cli-plugin"
],
"license": "ISC",
"main": "lib/color.js",
"repository": "heroku/heroku-cli-color",
"scripts": {
"prepare": "rm -rf lib && tsc",
"test": "jest"
},
"types": "./lib/color.d.ts"
}
@heroku-cli/command
===================
Base class for Heroku CLI commands. Built off of [oclif](https://oclif.io).
[![Version](https://img.shields.io/npm/v/@heroku-cli/command.svg)](https://npmjs.org/package/@heroku-cli/command)
[![CircleCI](https://circleci.com/gh/heroku/heroku-cli-command/tree/master.svg?style=shield)](https://circleci.com/gh/heroku/heroku-cli-command/tree/master)
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/heroku/heroku-cli-command?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/heroku-cli-command/branch/master)
[![Codecov](https://codecov.io/gh/heroku/heroku-cli-command/branch/master/graph/badge.svg)](https://codecov.io/gh/heroku/heroku-cli-command)
[![Greenkeeper](https://badges.greenkeeper.io/heroku/heroku-cli-command.svg)](https://greenkeeper.io/)
[![Known Vulnerabilities](https://snyk.io/test/npm/@heroku-cli/command/badge.svg)](https://snyk.io/test/npm/@heroku-cli/command)
[![Downloads/week](https://img.shields.io/npm/dw/@heroku-cli/command.svg)](https://npmjs.org/package/@heroku-cli/command)
[![License](https://img.shields.io/npm/l/@heroku-cli/command.svg)](https://github.com/heroku/heroku-cli-command/blob/master/package.json)
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment