all build output into dist folder, incl. downloaded nupkg

This commit is contained in:
david@DAVID-PC 2020-12-19 17:21:34 -08:00 коммит произвёл David JENNI
Родитель c3600584a4
Коммит e29c294f20
5 изменённых файлов: 18 добавлений и 25 удалений

Просмотреть файл

@ -1,6 +1,14 @@
module.exports = {
root: true,
env: {
node: true,
amd: true,
mocha: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019
},
plugins: [
'@typescript-eslint',
],

Просмотреть файл

@ -15,11 +15,7 @@ const log = require('fancy-log');
const path = require('path');
const pslist = require('ps-list');
// const tsConfigFile = './tsconfig.json';
// const tsconfig = require(tsConfigFile);
const webPackConfig = require('./webpack.config');
// const outdir = path.resolve(tsconfig.compilerOptions.outDir);
const outdir = path.resolve('./out');
const distdir = path.resolve('./dist');
const readPAT = process.env['AZ_DevOps_Read_PAT'];
@ -30,8 +26,7 @@ async function clean() {
log.info(`Terminating: ${info.name} - ${info.pid}...`)
process.kill(info.pid);
});
fs.emptyDirSync(distdir);
return fs.emptyDir(outdir);
return fs.emptyDir(distdir);
}
function compile() {
@ -120,17 +115,7 @@ function test() {
.pipe(mocha({
require: [ "ts-node/register" ],
ui: 'bdd'
}))
.pipe(eslint.format());
}
function binplace(compName, relativePath) {
const targetDir = path.resolve(distdir, relativePath);
log.info(`Copying ${compName} to ${targetDir}...`);
fs.emptyDirSync(targetDir);
fs.copySync(path.resolve(outdir, relativePath), targetDir, {
filter: (src) => path.extname(src) !== '.pdb'
});
}));
}
function createDist() {
@ -140,7 +125,7 @@ function createDist() {
const recompile = gulp.series(
clean,
async () => nugetInstall('nuget.org', 'Microsoft.PowerApps.CLI', '1.4.4', path.resolve(outdir, 'pac')),
async () => nugetInstall('nuget.org', 'Microsoft.PowerApps.CLI', '1.4.4', path.resolve(distdir, 'pac')),
compile
);

Просмотреть файл

@ -2,13 +2,13 @@
// Licensed under the MIT License.
import * as vscode from 'vscode';
import { AcquireCli } from './lib/AcquireCli';
import { CliAcquisition } from './lib/CliAcquisition';
import { PacTerminal } from './lib/PacTerminal';
export async function activate(context: vscode.ExtensionContext): Promise<void> {
const acquisition = new AcquireCli(context, '1.4.4');
const cliPath = await acquisition.ensureInstalled();
context.subscriptions.push(acquisition);
const cli = new CliAcquisition(context, '1.4.4');
const cliPath = await cli.ensureInstalled();
context.subscriptions.push(cli);
context.subscriptions.push(new PacTerminal(context, cliPath));
}

Просмотреть файл

@ -8,7 +8,7 @@ import * as path from 'path';
import * as fs from 'fs';
import { Extract } from 'unzip-stream'
export class AcquireCli implements vscode.Disposable {
export class CliAcquisition implements vscode.Disposable {
private readonly _context: vscode.ExtensionContext;
private readonly _cliPath: string;
@ -30,7 +30,7 @@ export class AcquireCli implements vscode.Disposable {
}
public async ensureInstalled(): Promise<string> {
return this.installCli(path.join(this._context.extensionPath, 'out', 'pac', `microsoft.powerapps.cli.${this.cliVersion}.nupkg`));
return this.installCli(path.join(this._context.extensionPath, 'dist', 'pac', `microsoft.powerapps.cli.${this.cliVersion}.nupkg`));
}
async installCli(pathToNupkg: string): Promise<string> {

Просмотреть файл

@ -33,7 +33,7 @@ const config = {
loader: 'ts-loader',
options: {
compilerOptions: {
"module": "es6"
"module": "es2019"
}
}
}]