Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Es module interop enabled #653

Merged
merged 17 commits into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 36 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"del": "^4.1.1",
"dotf": "^1.2.0",
"ellipsize": "^0.1.0",
"find-up": "^4.0.0",
"find-up": "^4.1.0",
"fs-extra": "^8.0.1",
"fuzzy": "^0.1.3",
"gaxios": "^2.0.1",
"google-auth-library": "^4.2.0",
"google-auth-library": "^4.2.4",
"googleapis": "^40.0.0",
"inquirer": "^6.3.1",
"inquirer": "^6.4.1",
"inquirer-autocomplete-prompt": "1.0.1",
"is-online": "^8.2.0",
"mkdirp": "^0.5.1",
Expand All @@ -64,7 +64,7 @@
"string.prototype.padend": "^3.0.0",
"strip-bom": "^4.0.0",
"ts2gas": "^3.4.4",
"typescript": "^3.5.1",
"typescript": "^3.5.2",
"watch": "^1.0.2"
},
"devDependencies": {
Expand All @@ -75,7 +75,7 @@
"@types/inquirer": "^6.0.3",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.7",
"@types/node": "^10.14.9",
"@types/node": "^10.14.10",
"@types/pluralize": "^0.0.29",
"@types/recursive-readdir": "^2.2.0",
"@types/tmp": "^0.1.0",
Expand All @@ -87,6 +87,6 @@
"nyc": "^14.1.1",
"prettier": "^1.18.2",
"tmp": "^0.1.0",
"tslint": "^5.17.0"
"tslint": "^5.18.0"
}
}
9 changes: 5 additions & 4 deletions src/apiutils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as fuzzy from 'fuzzy';
import { script_v1 } from 'googleapis';
import { loadAPICredentials, serviceUsage } from './auth';
import { ERROR, getProjectId, logError, spinner } from './utils';
import { functionNamePrompt, functionNameSource } from './inquirer';
import { loadAPICredentials, serviceUsage } from './auth';

import { enableOrDisableAdvanceServiceInManifest } from './manifest';
import { ERROR, getProjectId, logError, spinner } from './utils';
import fuzzy from 'fuzzy';
import { script_v1 } from 'googleapis';

/**
* Prompts for the function name.
Expand Down
16 changes: 9 additions & 7 deletions src/auth.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import * as http from 'http';
import { AddressInfo } from 'net';
import * as readline from 'readline';
import * as url from 'url';
import { ClaspCredentials, ERROR, LOG, checkIfOnline, getOAuthSettings, logError } from './utils';
import { ClaspToken, DOTFILE, Dotfile } from './dotfile';
/**
* Authentication with Google's APIs.
*/
import { Credentials, GenerateAuthUrlOpts, OAuth2Client, OAuth2ClientOptions } from 'google-auth-library';
import { google, script_v1 } from 'googleapis';
import * as open from 'open';
import { ClaspToken, DOTFILE, Dotfile } from './dotfile';

// TODO: AddressInfo is not defined in @types/node version 8 => check if any impact
import { AddressInfo } from 'net';
import http from 'http';
import { oauthScopesPrompt } from './inquirer';
import open from 'open';
import { readManifest } from './manifest';
import { ClaspCredentials, ERROR, LOG, checkIfOnline, getOAuthSettings, logError } from './utils';
import readline from 'readline';
import url from 'url';

// Auth is complicated. Consider yourself warned.
// tslint:disable:max-line-length
Expand Down
11 changes: 6 additions & 5 deletions src/commands/apis.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ERROR, checkIfOnline, getProjectId, logError } from '../utils';
import { discovery, loadAPICredentials, serviceUsage } from '../auth';

import { GaxiosResponse } from 'gaxios';
import { serviceusage_v1 } from 'googleapis';
import * as open from 'open';
import { PUBLIC_ADVANCED_SERVICES } from '../apis';
import { enableOrDisableAPI } from '../apiutils';
import { discovery, loadAPICredentials, serviceUsage } from '../auth';
import { URL } from '../urls';
import { ERROR, checkIfOnline, getProjectId, logError } from '../utils';
import { enableOrDisableAPI } from '../apiutils';
import open from 'open';
import { serviceusage_v1 } from 'googleapis';
const padEnd = require('string.prototype.padend');

/**
Expand Down
7 changes: 4 additions & 3 deletions src/commands/deployments.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { script_v1 } from 'googleapis';
import * as pluralize from 'pluralize';
import { loadAPICredentials, script } from '../auth';
import { LOG, checkIfOnline, getProjectSettings, logError, spinner } from '../utils';
import { loadAPICredentials, script } from '../auth';

import pluralize from 'pluralize';
import { script_v1 } from 'googleapis';

/**
* Lists a script's deployments.
Expand Down
2 changes: 1 addition & 1 deletion src/commands/help.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as commander from 'commander';
import commander from 'commander';

/**
* Outputs the help command.
Expand Down
2 changes: 1 addition & 1 deletion src/commands/logout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as del from 'del';
import { DOT } from '../dotfile';
import del from 'del';
import { hasOauthClientSettings } from '../utils';

/**
Expand Down
13 changes: 7 additions & 6 deletions src/commands/logs.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import chalk from 'chalk';
import { DOTFILE, ProjectSettings } from '../dotfile';
import { ERROR, LOG, checkIfOnline, getProjectSettings, isValidProjectId, logError, spinner } from '../utils';
import { loadAPICredentials, logger } from '../auth';

import { GaxiosResponse } from 'gaxios';
import { URL } from '../urls';
import chalk from 'chalk';
import { logging_v2 } from 'googleapis';
import * as open from 'open';
import { loadAPICredentials, logger } from '../auth';
import { DOTFILE, ProjectSettings } from '../dotfile';
import open from 'open';
import { projectIdPrompt } from '../inquirer';
import { URL } from '../urls';
import { ERROR, LOG, checkIfOnline, getProjectSettings, isValidProjectId, logError, spinner } from '../utils';

const padEnd = require('string.prototype.padend');

Expand Down
7 changes: 4 additions & 3 deletions src/commands/openCmd.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as open from 'open';
import { ERROR, LOG, checkIfOnline, getProjectSettings, getWebApplicationURL, logError } from '../utils';
import { loadAPICredentials, script } from '../auth';
import { deploymentIdPrompt } from '../inquirer';

import { URL } from '../urls';
import { ERROR, LOG, checkIfOnline, getProjectSettings, getWebApplicationURL, logError } from '../utils';
import { deploymentIdPrompt } from '../inquirer';
import open from 'open';

interface EllipizeOptions {
ellipse?: string;
Expand Down
15 changes: 8 additions & 7 deletions src/commands/push.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import * as path from 'path';
import { readFileSync } from 'fs-extra';
import * as multimatch from 'multimatch';
import { watchTree } from 'watch';
import { loadAPICredentials } from '../auth';
import { DOT, DOTFILE } from '../dotfile';
import { FS_OPTIONS, fetchProject, pushFiles } from '../files';
import { overwritePrompt } from '../inquirer';
import { isValidManifest } from '../manifest';
import {
LOG,
PROJECT_MANIFEST_BASENAME,
Expand All @@ -16,6 +9,14 @@ import {
spinner,
} from '../utils';

import { isValidManifest } from '../manifest';
import { loadAPICredentials } from '../auth';
import multimatch from 'multimatch';
import { overwritePrompt } from '../inquirer';
import path from 'path';
import { readFileSync } from 'fs-extra';
import { watchTree } from 'watch';

/**
* Uploads all files into the script.google.com filesystem.
* TODO: Only push the specific files that changed (rather than all files).
Expand Down
13 changes: 7 additions & 6 deletions src/commands/run.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as readline from 'readline';
import chalk from 'chalk';
import * as pluralize from 'pluralize';
import { getFunctionNames } from '../apiutils';
import { getLocalScript, loadAPICredentials, script } from '../auth';
import { ERROR, checkIfOnline, getProjectSettings, getValidJSON, logError, spinner } from '../utils';
import { addScopeToManifest, isValidRunManifest } from '../manifest';
import { getLocalScript, loadAPICredentials, script } from '../auth';

import { URL } from '../urls';
import { ERROR, checkIfOnline, getProjectSettings, getValidJSON, logError, spinner } from '../utils';
import chalk from 'chalk';
import { getFunctionNames } from '../apiutils';
import pluralize from 'pluralize';
import readline from 'readline';
/**
* Executes an Apps Script function. Requires clasp login --creds.
* @param functionName {string} The function name within the Apps Script project.
Expand Down
9 changes: 5 additions & 4 deletions src/dotfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
*
* This should be the only file that uses DOTFILE.
*/
import * as os from 'os';
import * as path from 'path';
import * as findUp from 'find-up';
import * as fs from 'fs-extra';

import { Credentials } from 'google-auth-library';
import { OAuth2ClientOptions } from 'google-auth-library/build/src/auth/oauth2client';
import findUp from 'find-up';
import fs from 'fs-extra';
import os from 'os';
import path from 'path';
import stripBom = require('strip-bom');

// Getting ready to switch to `dotf` embedded types
Expand Down
Loading