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

Adds ability to install a missing bsc version #583

Merged
merged 31 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
26ec6f7
Adds ability to install a missing bsc version
TwitchBronBron Jul 30, 2024
190ea99
Merge branch 'master' into enhanced-bsc-picker
TwitchBronBron Jul 30, 2024
4bd3d8d
Fix broken test
TwitchBronBron Jul 30, 2024
83eeef0
Add support for loading lsp from npm or url
TwitchBronBron Jul 30, 2024
24ef473
Proper url hashing
TwitchBronBron Aug 6, 2024
7bb3902
Add command to clear local npm cache
TwitchBronBron Aug 20, 2024
8c6600f
Add language server menu option for clearing cached packages
TwitchBronBron Aug 20, 2024
43fa9da
Delete bsc versions after 45 days of inactivity
TwitchBronBron Sep 11, 2024
13b6abf
Add command to view packages dir in explorer
TwitchBronBron Sep 11, 2024
45cf3f2
Prevent installing same bsc dependency multiple times
TwitchBronBron Sep 16, 2024
fb8c811
Merge branch 'master' into enhanced-bsc-picker
TwitchBronBron Sep 16, 2024
25f240d
Better messaging around removing cached brighterscript versions
TwitchBronBron Sep 16, 2024
87a9228
Fix bug keeping test process alive for too long
TwitchBronBron Sep 16, 2024
97c7dd3
Add `LocalPackageManager` class, not finished yet
TwitchBronBron Sep 18, 2024
a26f523
Add ability to delete all of a given package
TwitchBronBron Sep 18, 2024
9409054
Add ability to remove a specific package.
TwitchBronBron Sep 18, 2024
0aeed72
Fix coverage issues
TwitchBronBron Sep 18, 2024
998f953
Update LanguageServermanager to use localPackageManager
TwitchBronBron Sep 18, 2024
a409812
Tweak comment
TwitchBronBron Sep 18, 2024
277d21c
Better internal package object handling
TwitchBronBron Sep 19, 2024
91fc994
Add live npm install test
TwitchBronBron Sep 19, 2024
4147d31
support for non-semver versions
TwitchBronBron Sep 19, 2024
1f0f921
Refactored LanguageServerManager to better handle bsc version
TwitchBronBron Sep 19, 2024
0b0c12c
Add unit tests for parseVersionInfo and getVersionDirName
TwitchBronBron Sep 20, 2024
bca7a87
Fix some broken tests
TwitchBronBron Sep 20, 2024
c7bf7e5
Handle loading bsc version using version number
TwitchBronBron Sep 20, 2024
758c2a8
Split mainline releases and prereleases
TwitchBronBron Sep 20, 2024
b037ce0
Merge branch 'master' into enhanced-bsc-picker
TwitchBronBron Sep 23, 2024
112a5d1
Merge branch 'master' into enhanced-bsc-picker
TwitchBronBron Sep 23, 2024
524489b
Fixed json parse issue when fetching npm package versions
TwitchBronBron Sep 23, 2024
43e015f
Fix lint issue
TwitchBronBron Sep 23, 2024
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
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"0"
"987654"
],
"internalConsoleOptions": "openOnSessionStart"
}
Expand Down Expand Up @@ -104,4 +104,4 @@
]
}
]
}
}
71 changes: 63 additions & 8 deletions package-lock.json

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

20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"iconv-lite": "0.4.24",
"jszip": "^3.10.1",
"just-throttle": "^4.0.1",
"md5": "^2.3.0",
"net": "^1.0.2",
"node-cache": "^4.2.0",
"node-ssdp": "^4.0.0",
Expand Down Expand Up @@ -97,8 +98,10 @@
"@types/clone-deep": "^4.0.3",
"@types/fs-extra": "^5.0.4",
"@types/glob": "^7.1.1",
"@types/lodash": "^4.17.7",
"@types/md5": "^2.3.5",
"@types/mocha": "^7.0.2",
"@types/node": "^12.12.0",
"@types/node": "^20.14.10",
"@types/node-ssdp": "^3.3.0",
"@types/prompt": "^1.1.2",
"@types/resolve": "^1.20.6",
Expand All @@ -114,11 +117,12 @@
"chalk": "^4.1.2",
"changelog-parser": "^2.8.0",
"coveralls-next": "^4.2.0",
"dayjs": "^1.11.7",
"dayjs": "^1.11.12",
"deferred": "^0.7.11",
"eslint": "^8.10.0",
"eslint-plugin-github": "^4.3.5",
"eslint-plugin-no-only-tests": "^2.6.0",
"lodash": "^4.17.21",
"mocha": "^9.1.3",
"node-notifier": "^10.0.1",
"nyc": "^15.0.0",
Expand Down Expand Up @@ -1810,6 +1814,12 @@
"description": "Path to the BrighterScript module to use for the BrightScript and BrighterScript language features",
"scope": "resource"
},
"brightscript.npmCacheRetentionDays": {
"type": "number",
"description": "How long should the extension keep around unused extension-managed npm packages such as brighterscript",
"default": 45,
"scope": "resource"
},
"brightscript.enableLanguageServer": {
"type": "boolean",
"description": "Enable the Language Server, which includes things like syntax checking, intellisense, completions, etc.",
Expand Down Expand Up @@ -3084,6 +3094,12 @@
"title": "Open SceneGraph Inspector In New Window",
"category": "BrighterScript",
"icon": "$(link-external)"
},
{
"command": "extension.brightscript.clearNpmPackageCache",
"title": "Clear the extension's local node_modules cache",
"category": "BrighterScript",
"icon": "$(link-external)"
Comment on lines +3099 to +3102
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisdp what do you think about this command name and the message?

}
],
"keybindings": [
Expand Down
4 changes: 2 additions & 2 deletions src/ActiveDeviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ class RokuFinder extends EventEmitter {
}

private readonly client: Client;
private intervalId: NodeJS.Timer | null = null;
private timeoutId: NodeJS.Timer | null = null;
private intervalId: NodeJS.Timeout | null = null;
private timeoutId: NodeJS.Timeout | null = null;
private running = false;

public start(timeout: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/BrightScriptCommands.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('BrightScriptFileUtils ', () => {
let languagesMock;

beforeEach(() => {
commands = new BrightScriptCommands({} as any, {} as any, {} as any, {} as any, {} as any);
commands = new BrightScriptCommands({} as any, {} as any, {} as any, {} as any, {} as any, {} as any);
commandsMock = sinon.mock(commands);
languagesMock = sinon.mock(vscode.languages);
});
Expand Down
8 changes: 6 additions & 2 deletions src/BrightScriptCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import type { ActiveDeviceManager } from './ActiveDeviceManager';
import * as xml2js from 'xml2js';
import { firstBy } from 'thenby';
import type { UserInputManager } from './managers/UserInputManager';
import { clearNpmPackageCacheCommand } from './commands/ClearNpmPackageCacheCommand';
import type { LocalPackageManager } from './managers/LocalPackageManager';

export class BrightScriptCommands {

Expand All @@ -22,7 +24,8 @@ export class BrightScriptCommands {
private whatsNewManager: WhatsNewManager,
private context: vscode.ExtensionContext,
private activeDeviceManager: ActiveDeviceManager,
private userInputManager: UserInputManager
private userInputManager: UserInputManager,
private localPackageManager: LocalPackageManager
) {
this.fileUtils = new BrightScriptFileUtils();
}
Expand All @@ -36,9 +39,10 @@ export class BrightScriptCommands {
public registerCommands() {

brighterScriptPreviewCommand.register(this.context);
languageServerInfoCommand.register(this.context);
languageServerInfoCommand.register(this.context, this.localPackageManager);
captureScreenshotCommand.register(this.context, this);
rekeyAndPackageCommand.register(this.context, this, this.userInputManager);
clearNpmPackageCacheCommand.register(this.context, this.localPackageManager);

this.registerGeneralCommands();

Expand Down
2 changes: 1 addition & 1 deletion src/GlobalStateManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class GlobalStateManager {
sendRemoteTextHistory: 'sendRemoteTextHistory',
debugProtocolPopupSnoozeUntilDate: 'debugProtocolPopupSnoozeUntilDate',
debugProtocolPopupSnoozeValue: 'debugProtocolPopupSnoozeValue'

};
private remoteTextHistoryLimit: number;
private remoteTextHistoryEnabled: boolean;
Expand All @@ -38,7 +39,6 @@ export class GlobalStateManager {
void this.context.globalState.update(this.keys.lastSeenReleaseNotesVersion, value);
}


public get debugProtocolPopupSnoozeUntilDate(): Date {
const epoch = this.context.globalState.get<number>(this.keys.debugProtocolPopupSnoozeUntilDate);
if (epoch) {
Expand Down
Loading
Loading