Skip to content

Update clipboardy and typescript version #499

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
56 changes: 28 additions & 28 deletions .azure-pipelines/common-steps.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Common steps template
#
# Things which happen regardless of CI, PR, or release builds
steps:
- checkout: self
clean: true
- task: NodeTool@0
displayName: Use node 10
inputs:
versionSpec: "10.x"
- task: NpmAuthenticate@0
inputs:
workingFile: .npmrc
- script: npm i -g [email protected] --force
displayName: Use npm version 6.14.12
- bash: |
npm ci
npm run build
displayName: Build TFX CLI
# Generate a pipeline artifact so we can publish the package manually if there are issues with automation
- bash: |
npm pack
cp *.tgz '$(Build.ArtifactStagingDirectory)'
# Common steps template
#
# Things which happen regardless of CI, PR, or release builds
steps:
- checkout: self
clean: true

- task: UseNode@1
displayName: Use Node 18
inputs:
version: "18.x"

- task: NpmAuthenticate@0
inputs:
workingFile: .npmrc

- script: npm i -g [email protected] --force
displayName: Use npm version 6.14.12

- bash: |
npm ci
npm run build
displayName: Build TFX CLI

# Generate a pipeline artifact so we can publish the package manually if there are issues with automation
- bash: |
npm pack
cp *.tgz '$(Build.ArtifactStagingDirectory)'
displayName: Run npm-pack and copy to ArtifactStagingDirectory
6 changes: 3 additions & 3 deletions app/exec/extension/init.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { createExtension } from "./create";
import { exec } from "child_process";
import * as jsonInPlace from "json-in-place";
import jsonInPlace from "json-in-place";
import { promisify } from "util";
import { TfCommand } from "../../lib/tfcommand";
import * as args from "../../lib/arguments";
import * as colors from "colors";
import * as extBase from "./default";
import * as fs from "fs";
import * as http from "https";
import * as mkdirp from "mkdirp";
import mkdirp from "mkdirp";
import * as path from "path";
import * as trace from "../../lib/trace";
import * as jszip from "jszip";
Expand Down Expand Up @@ -226,7 +226,7 @@ export class ExtensionInit extends extBase.ExtensionBase<InitResult> {

// Crack open the zip file.
try {
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
fs.readFile(downloadedZipPath, async (err, data) => {
if (err) {
reject(err);
Expand Down
5 changes: 3 additions & 2 deletions app/lib/tfcommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import args = require("./arguments");
import { blue, cyan, gray, green, yellow, magenta, reset as resetColors, stripColors } from "colors";
import command = require("../lib/command");
import common = require("./common");
import clipboardy = require("clipboardy");
import { writeFile } from "fs";
import loader = require("../lib/loader");
import path = require("path");
Expand All @@ -20,6 +19,8 @@ import trace = require("./trace");
import version = require("./version");
import { IRequestOptions } from "azure-devops-node-api/interfaces/common/VsoBaseInterfaces";

const clipboardyWrite = (data: string) => import('clipboardy').then(clipboardy => clipboardy.default.writeSync(data));

export interface CoreArguments {
[key: string]: args.Argument<any>;
project: args.StringArgument;
Expand Down Expand Up @@ -688,7 +689,7 @@ export abstract class TfCommand<TArguments extends CoreArguments, TResult> {
case "clip":
case "clipboard":
let clipboardText = this.getClipboardOutput(data);
return clipboardy.write(clipboardText);
return clipboardyWrite(clipboardText);
default:
return fsUtils.canWriteTo(path.resolve(outputDestination)).then(canWrite => {
if (canWrite) {
Expand Down
Loading