Skip to content

Commit

Permalink
Update versions (#138)
Browse files Browse the repository at this point in the history
* Update to node 16.13.10

* Update to vscode 1.67 api

* Update to typescript 4.6.3

* Update to prettier 2.6.2

* Update shx to 3.3.4

* Update request-light to 0.5.8

* Update glob to 8.0.3

* Update semver to 7.3.7

* Update sinon to 14.0.0

* Update chai to 4.3.6

* Update mocha to 10.0.0

* Update @vscode/test-electron to 2.1.3

* Update better-ajv-erros to 1.2.0

* Update vsce to 1.103.1

* Use npm 6 for build & packaging

This is to work around several issues use npm 7 or 8 with vscode
packaging:
* microsoft/vscode-vsce#439
* microsoft/vscode-vsce#673

* Fix for vscode tests on windows & mac
  • Loading branch information
smithgp authored Jun 30, 2022
1 parent e6600c5 commit e408dcf
Show file tree
Hide file tree
Showing 16 changed files with 120 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- develop

env:
NODE_VERSION: '14.16.0'
NODE_VERSION: '16.13.0'

jobs:
# We really only need to run lint on one job so we'll do it here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- develop

env:
NODE_VERSION: '14.16.0'
NODE_VERSION: '16.13.0'

jobs:
pr-build:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.16.0
v16.13.0
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Familiarize yourself with the codebase and by reading the various [contributing

Then,

1. Fork and/or clone this repository.
1. Fork or clone this repository.
1. Create a _topic_ branch in your fork based on the correct branch (usually the **develop** branch, see [Branches section](#branches) below). Note, this step is recommended but technically not required if contributing using a fork.
1. Edit the code in your fork.
1. Create a pull request when you are done.
1. Edit the code.
1. Push your branch and create a pull request when you are done.

## Branches

Expand Down
8 changes: 6 additions & 2 deletions contributing/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Pre-requisites

1. We are using the same version of Node that the current release of VSCode uses (currently 14.16.0).
1. We are using the same version of Node that the supported release of VSCode uses (see `engines.vscode` in the
extensions' `package.json`'s, currently 16.13.0).
If you need to work with multiple versions of Node (e.g. for other projects), you might consider using
[nvm](https://github.com/creationix/nvm).
1. It is suggested, though not required, that you use the Insiders version of VS
Expand All @@ -11,6 +12,9 @@
.vscode/extensions.json. The first time you open VS Code on this workspace,
it will ask you to install them. **Please do so since this includes the
linters and formatters**.
1. Additionally, VS Code should prompt to set the Typescript version of the same as the project. If it does not,
open any `.ts` file, then open the command palette and select **Typescript: Select TypeScript Version...**, then
select **Use Workspace Version**.

## Structure

Expand Down Expand Up @@ -92,7 +96,7 @@ subchapters.

In general, when dealing with files in vscode, you should try to use
[`vscode.workspace.fs`](https://code.visualstudio.com/api/references/vscode-api#workspace.fs) instead of
the regular node `fs` package.This is so your code can support any remote fileystems configured in VSCode.
the regular node `fs` package. This is so your code can support any remote fileystems configured in VSCode.

Similarly, when dealing with file paths, you should try to use
[`vscode.Uri`](https://code.visualstudio.com/api/references/vscode-api#Uri)'s, and only use `path.posix` when
Expand Down
26 changes: 13 additions & 13 deletions extensions/analyticsdx-vscode-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,40 @@
},
"license": "BSD-3-Clause",
"engines": {
"vscode": "^1.60.0"
"vscode": "^1.67.0"
},
"categories": [
"Other"
],
"dependencies": {
"@salesforce/salesforcedx-utils-vscode": "file:../../lib/salesforcedx-utils-vscode.tgz",
"@salesforce/templates": "54.7.0",
"glob": "7.2.0",
"semver": "7.3.5",
"glob": "8.0.3",
"semver": "7.3.7",
"tmp": "0.2.1",
"which": "2.0.2"
},
"devDependencies": {
"@salesforce/analyticsdx-test-utils-vscode": "0.8.2",
"@types/chai": "4.2.22",
"@types/chai": "4.3.1",
"@types/glob": "7.2.0",
"@types/mocha": "9.0.0",
"@types/node": "14.17.27",
"@types/mocha": "9.1.1",
"@types/node": "16.11.36",
"@types/semver": "7.3.9",
"@types/sinon": "10.0.5",
"@types/sinon": "10.0.11",
"@types/tmp": "0.2.2",
"@types/vscode": "1.60.0",
"@types/vscode": "1.67.0",
"@types/which": "1.3.2",
"chai": "4.3.4",
"chai": "4.3.6",
"cross-env": "7.0.3",
"mocha": "9.1.3",
"mocha": "10.0.0",
"mocha-junit-reporter": "2.0.2",
"mocha-multi-reporters": "1.5.1",
"mock-spawn": "0.2.6",
"nyc": "15.1.0",
"shx": "0.3.3",
"sinon": "11.1.2",
"typescript": "4.4.3"
"shx": "0.3.4",
"sinon": "14.0.0",
"typescript": "4.6.3"
},
"scripts": {
"vscode:prepublish": "npm prune --production",
Expand Down
24 changes: 12 additions & 12 deletions extensions/analyticsdx-vscode-templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"license": "BSD-3-Clause",
"engines": {
"vscode": "^1.60.0"
"vscode": "^1.67.0"
},
"categories": [
"Other"
Expand All @@ -30,30 +30,30 @@
"analyticsdx-template-lint": "0.8.2",
"jsonc-parser": "3.0.0",
"lodash.isequal": "4.5.0",
"request-light": "0.5.4",
"request-light": "0.5.8",
"vscode-json-languageserver": "1.3.4",
"vscode-languageclient": "7.0.0"
},
"devDependencies": {
"@salesforce/analyticsdx-test-utils-vscode": "0.8.2",
"@types/chai": "4.2.22",
"@types/chai": "4.3.1",
"@types/lodash.isequal": "4.5.5",
"@types/mocha": "9.0.0",
"@types/node": "14.17.27",
"@types/sinon": "10.0.5",
"@types/mocha": "9.1.1",
"@types/node": "16.11.36",
"@types/sinon": "10.0.11",
"@types/tmp": "0.2.2",
"@types/vscode": "1.60.0",
"chai": "4.3.4",
"@types/vscode": "1.67.0",
"chai": "4.3.6",
"cross-env": "7.0.3",
"mocha": "9.1.3",
"mocha": "10.0.0",
"mocha-junit-reporter": "2.0.2",
"mocha-multi-reporters": "1.5.1",
"nyc": "15.1.0",
"readdirp": "3.6.0",
"shx": "0.3.3",
"sinon": "11.1.2",
"shx": "0.3.4",
"sinon": "14.0.0",
"tmp": "0.2.1",
"typescript": "4.4.3"
"typescript": "4.6.3"
},
"scripts": {
"vscode:prepublish": "npm prune --production",
Expand Down
4 changes: 4 additions & 0 deletions extensions/analyticsdx-vscode-templates/src/util/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export class PrefixingOutputChannel implements vscode.OutputChannel {
this.output?.clear();
}

public replace(value: string): void {
this.output?.replace(value);
}

public show(preserveFocus?: boolean | undefined): void;
public show(column?: vscode.ViewColumn | undefined, preserveFocus?: boolean | undefined): void;
public show(column?: any, preserveFocus?: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import {
} from '../../../src/util/completions';
import { closeAllEditors, findPositionByJsonPath, openTemplateInfo } from '../vscodeTestUtils';

const INVOKE_COMPLETION_CONTEXT: vscode.CompletionContext = {
triggerKind: vscode.CompletionTriggerKind.Invoke,
triggerCharacter: undefined
};

// tslint:disable:no-unused-expression
describe('JsonCompletionItemProvider', () => {
let cancellationTokenSource: vscode.CancellationTokenSource;
Expand Down Expand Up @@ -44,9 +49,12 @@ describe('JsonCompletionItemProvider', () => {
})
);

const list = await provider.provideCompletionItems(doc, position!, cancellationTokenSource.token, {
triggerKind: vscode.CompletionTriggerKind.Invoke
});
const list = await provider.provideCompletionItems(
doc,
position!,
cancellationTokenSource.token,
INVOKE_COMPLETION_CONTEXT
);
expect(list, 'items list').to.not.be.undefined.and.not.be.null;
const items = list!.items;
expect(items, 'items').to.not.be.undefined.and.not.be.null;
Expand All @@ -73,9 +81,12 @@ describe('JsonCompletionItemProvider', () => {
})
);

const list = await provider.provideCompletionItems(doc, position!, cancellationTokenSource.token, {
triggerKind: vscode.CompletionTriggerKind.Invoke
});
const list = await provider.provideCompletionItems(
doc,
position!,
cancellationTokenSource.token,
INVOKE_COMPLETION_CONTEXT
);
expect(list, 'items list').to.be.undefined;
});

Expand All @@ -91,9 +102,12 @@ describe('JsonCompletionItemProvider', () => {
})
);

const list = await provider.provideCompletionItems(doc, position!, cancellationTokenSource.token, {
triggerKind: vscode.CompletionTriggerKind.Invoke
});
const list = await provider.provideCompletionItems(
doc,
position!,
cancellationTokenSource.token,
INVOKE_COMPLETION_CONTEXT
);
expect(list, 'items list').to.not.be.undefined.and.not.be.null;
const items = list!.items;
expect(items, 'items').to.not.be.undefined.and.not.be.null;
Expand Down Expand Up @@ -121,9 +135,12 @@ describe('JsonCompletionItemProvider', () => {

const provider = new JsonCompletionItemProvider(delegate1, delegate2);
const items = (
await provider.provideCompletionItems(doc, new vscode.Position(0, 0), cancellationTokenSource.token, {
triggerKind: vscode.CompletionTriggerKind.Invoke
})
await provider.provideCompletionItems(
doc,
new vscode.Position(0, 0),
cancellationTokenSource.token,
INVOKE_COMPLETION_CONTEXT
)
)?.items;
expect(items, 'items').to.not.be.undefined;
if (items!.length !== 1) {
Expand Down Expand Up @@ -153,9 +170,12 @@ describe('JsonCompletionItemProvider', () => {

const provider = new JsonCompletionItemProvider(delegate1, delegate2);
const items = (
await provider.provideCompletionItems(doc, new vscode.Position(0, 0), cancellationTokenSource.token, {
triggerKind: vscode.CompletionTriggerKind.Invoke
})
await provider.provideCompletionItems(
doc,
new vscode.Position(0, 0),
cancellationTokenSource.token,
INVOKE_COMPLETION_CONTEXT
)
)?.items;
expect(items, 'items').to.not.be.undefined;
if (items!.length !== 1) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/analyticsdx-vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Before you set up Salesforce Analytics Extensions for VS Code, make sure that yo
Before you use Salesforce Extensions for VS Code, [set up Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup).
- **Analytics Plugin for Salesforce CLI**
Be sure to [install the Analytics Plugin for the Salesforce CLI](https://help.salesforce.com/articleView?id=bi_cli_analytics_plugin_install.htm&type=5).
- **[Visual Studio Code](https://code.visualstudio.com/download) v1.60 or later**
- **[Visual Studio Code](https://code.visualstudio.com/download) v1.67 or later**
- **Salesforce Extension Pack**
Install the [Salesforce Extension Pack](https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode) from the VS Code Extensions Marketplace.
- **A Salesforce DX project**
Expand Down
4 changes: 2 additions & 2 deletions extensions/analyticsdx-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
},
"license": "BSD-3-Clause",
"engines": {
"vscode": "^1.60.0"
"vscode": "^1.67.0"
},
"devDependencies": {
"shx": "0.3.3"
"shx": "0.3.4"
},
"scripts": {
"clean": "shx rm -f analyticsdx-vscode-*.vsix",
Expand Down
30 changes: 19 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
{
"name": "analyticsdx-vscode",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "git+https://github.com/forcedotcom/analyticsdx-vscode.git"
},
"engines": {
"node": ">=16.13.0"
},
"dependencies": {
"node": "^16.13.0",
"npm": "^6"
},
"devDependencies": {
"@salesforce/dev-config": "1.5.0",
"@types/lerna-alias": "3.0.0",
"@types/mkdirp": "1.0.2",
"@types/shelljs": "0.8.11",
"@vscode/test-electron": "1.6.2",
"@vscode/test-electron": "2.1.3",
"eslint": "6.7.2",
"eslint-config-prettier": "2.9.0",
"lerna": "4.0.0",
"lerna-alias": "3.0.2",
"mkdirp": "1.0.4",
"nlf": "2.1.1",
"prettier": "2.4.1",
"prettier": "2.6.2",
"shelljs": "0.8.5",
"shx": "0.3.3",
"shx": "0.3.4",
"tslint": "6.1.3",
"tslint-no-focused-test": "0.5.0",
"typescript": "4.4.3",
"vsce": "1.100.1"
"typescript": "4.6.3",
"vsce": "1.103.1"
},
"scripts": {
"postinstall": "lerna bootstrap --no-ci -- --no-package-lock && node scripts/reformat-with-prettier",
Expand All @@ -42,10 +55,5 @@
"build-all-vsixs": "node scripts/build-all-vsixs.js",
"update-sha256": "node scripts/update-sha256.js",
"publish-all-vsixs": "node scripts/publish-all-vsixs.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/forcedotcom/analyticsdx-vscode.git"
},
"license": "BSD-3-Clause"
}
}
16 changes: 8 additions & 8 deletions packages/analyticsdx-template-lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
"jsonc-parser": "3.0.0"
},
"devDependencies": {
"@types/chai": "4.2.22",
"@types/mocha": "9.0.0",
"@types/node": "14.17.27",
"@types/chai": "4.3.1",
"@types/mocha": "9.1.1",
"@types/node": "16.11.36",
"ajv": "8.6.3",
"better-ajv-errors": "0.7.0",
"chai": "4.3.4",
"mocha": "9.1.3",
"better-ajv-errors": "1.2.0",
"chai": "4.3.6",
"mocha": "10.0.0",
"mocha-junit-reporter": "2.0.2",
"mocha-multi-reporters": "1.5.1",
"nyc": "15.1.0",
"shx": "0.3.3",
"typescript": "4.4.3"
"shx": "0.3.4",
"typescript": "4.6.3"
},
"optionalDependencies": {
"vscode-json-languageservice": "^4.1.8"
Expand Down
4 changes: 2 additions & 2 deletions packages/analyticsdx-template-lint/test/testutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import Ajv, { ErrorObject as AjvErrorObject, Options as AjvOptions } from 'ajv';
import betterAjvErrors = require('better-ajv-errors');
import betterAjvErrors from 'better-ajv-errors';
import { expect } from 'chai';
import * as fs from 'fs';
import { parse, ParseError, printParseErrorCode } from 'jsonc-parser';
Expand Down Expand Up @@ -128,7 +128,7 @@ export function generateJsonSchemaValidFilesTestSuite(
const json = await readFile(entry.fullPath, { encoding: 'utf-8' }).then(jsoncParse);
const result = validator(json);
if (!result || (validator.errors && validator.errors.length > 0)) {
const errorsText = betterAjvErrors(schema, json, validator.errors, { indent: 2 });
const errorsText = betterAjvErrors(schema, json, validator.errors || [], { indent: 2 });
expect.fail('schema validation failed with errors:\n' + errorsText);
}
});
Expand Down
Loading

0 comments on commit e408dcf

Please sign in to comment.