Skip to content

Commit

Permalink
Remove the ee-ts dependency. (#867)
Browse files Browse the repository at this point in the history
Fixes signed builds. The previous prepare-deploy was attempting to remove what it thought was a phantom dependency on the typescript compiler from the deployed output. This failed because the DevDiv build lab pushed out changes that blocked the unrestrained dependency on rimraf used by that script. This change drops the dependency on ee-ts which created the need to include the typescript compiler in the first place.

Also fixed test failures that ee-ts was apparently hiding?!
  • Loading branch information
BillyONeal authored Jan 24, 2023
1 parent e10fa47 commit 8a88d63
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 92 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines/signing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
- task: ComponentGovernanceComponentDetection@0
displayName: Detect Components
inputs:
ignoreDirectories: ce/common/temp
sourceScanPath: "$(Build.BinariesDirectory)/ce"
# Inject the NOTICE file. This must run after component detection.
- task: msospo.ospo-extension.8d7f9abb-6896-461d-9e25-4f74ed65ddb2.notice@0
displayName: Generate NOTICE File
Expand Down
2 changes: 1 addition & 1 deletion ce/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"postinstall": "node ./create-links create",
"uninstall": "node ./create-links remove",
"prepack": "npx rimraf ./common/temp/node_modules/.pnpm/typescript* ./common/temp/node_modules/.pnpm/translate-strings* ./common/temp/node_modules/.pnpm/ts-morph* ./common/temp/node_modules/.pnpm/@types* && node ./prepare-deploy.js"
"prepack": "node ./prepare-deploy.js"
},
"repository": {
"type": "git",
Expand Down
32 changes: 20 additions & 12 deletions ce/ce/artifacts/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ export class Activation {
addDefine(name: string, value: string) {
const v = findCaseInsensitiveOnWindows(this.#defines, name);

if (v && v !== value) {
if (v === undefined) {
this.#defines.set(name, value);
} else if (v !== value) {
// conflict. todo: what do we want to do?
this.#session.channels.warning(i`Duplicate define ${name} during activation. New value will replace old.`);
this.#defines.set(name, value);
}
this.#defines.set(name, value);
}

get defines() {
Expand All @@ -144,10 +146,12 @@ export class Activation {
/** a collection of tool locations from artifacts */
addTool(name: string, value: string) {
const t = findCaseInsensitiveOnWindows(this.#tools, name);
if (t && t !== value) {
this.#session.channels.error(i`Duplicate tool declared ${name} during activation. New value will replace old.`);
if (t === undefined) {
this.#tools.set(name, value);
} else if (t !== value) {
this.#session.channels.warning(i`Duplicate tool declared ${name} during activation. New value will replace old.`);
this.#tools.set(name, value);
}
this.#tools.set(name, value);
}

get tools() {
Expand All @@ -166,10 +170,12 @@ export class Activation {
/** Aliases are tools that get exposed to the user as shell aliases */
addAlias(name: string, value: string) {
const a = findCaseInsensitiveOnWindows(this.#aliases, name);
if (a && a !== value) {
this.#session.channels.error(i`Duplicate alias declared ${name} during activation. New value will replace old.`);
if (a === undefined) {
this.#aliases.set(name, value);
} else if (a !== value) {
this.#session.channels.warning(i`Duplicate alias declared ${name} during activation. New value will replace old.`);
this.#aliases.set(name, value);
}
this.#aliases.set(name, value);
}

async getAlias(name: string, refcheck = new Set<string>()): Promise<string | undefined> {
Expand All @@ -196,10 +202,12 @@ export class Activation {
location = typeof location === 'string' ? location : location.fsPath;

const l = this.#locations.get(name);
if (l !== location) {
this.#session.channels.error(i`Duplicate location declared ${name} during activation. New value will replace old.`);
if (l === undefined) {
this.#locations.set(name, location);
} else if (l !== location) {
this.#session.channels.warning(i`Duplicate location declared ${name} during activation. New value will replace old.`);
this.#locations.set(name, location);
}
this.#locations.set(name, location);
}

get locations() {
Expand Down Expand Up @@ -276,7 +284,7 @@ export class Activation {
return;
}
let v = this.#properties.get(name);
if (!v) {
if (v === undefined) {
v = new Set<string>();
this.#properties.set(name, v);
}
Expand Down
4 changes: 2 additions & 2 deletions ce/ce/fs/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/* eslint-disable @typescript-eslint/ban-types */

import { EventEmitter } from 'ee-ts';
import { EventEmitter } from 'node:events';
import { Readable, Writable } from 'stream';
import { Session } from '../session';
import { Uri } from '../util/uri';
Expand Down Expand Up @@ -196,7 +196,7 @@ async function* asyncIterableOverHandle(start: number, end: number, handle: Read
}
}

export abstract class FileSystem extends EventEmitter<FileSystemEvents> {
export abstract class FileSystem extends EventEmitter {

protected baseUri?: Uri;

Expand Down
1 change: 0 additions & 1 deletion ce/ce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"dependencies": {
"@snyk/nuget-semver": "1.3.0",
"vscode-uri": "3.0.3",
"ee-ts": "2.0.0-rc.6",
"yaml": "2.0.0-10",
"semver": "7.3.5",
"tar-stream": "~2.3.0",
Expand Down
4 changes: 2 additions & 2 deletions ce/ce/util/channels.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { EventEmitter } from 'ee-ts';
import { EventEmitter } from 'node:events';
import { Session } from '../session';

/** Event defintions for channel events */
Expand Down Expand Up @@ -40,7 +40,7 @@ export class Stopwatch {
*
* Warning, Error, Message, Debug
*/
export class Channels extends EventEmitter<ChannelEvents> {
export class Channels extends EventEmitter {
/** @internal */
readonly stopwatch: Stopwatch;

Expand Down
Loading

0 comments on commit 8a88d63

Please sign in to comment.