Skip to content

Commit

Permalink
v0.22.0 Update GitHub Action to latest major
Browse files Browse the repository at this point in the history
 version (v1).
  • Loading branch information
Rob O'Leary committed Jun 29, 2022
1 parent 614e5a2 commit 67aaa87
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 51 deletions.
19 changes: 1 addition & 18 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
{
"extends": ["roboleary-node"],
"rules": {
"node/no-missing-require": [
"error",
{
"allowModules": ["vscode"]
}
],
"class-methods-use-this": "off",
"no-restricted-syntax": "warn"
},
"settings": {
"import/ignore": ["vscode"],
"eslint import/no-unresolved": [
"error",
{ "caseSensitive": false, "ignore": ["vscode"] }
]
}
"extends": ["eslint-config-node-roboleary"]
}
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
- run: npm ci
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v0
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v0
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VSCE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
9 changes: 3 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@
"type": "npm",
"script": "webpack",
"problemMatcher": [],
"label": "npm: webpack",
"label": "dev",
"detail": "webpack --mode development --watch"
},
{
"label": "Run npm webpack on startup",
"label": "Run dev on startup",
"type": "shell",
"command": "npm run webpack",
"windows": {
"command": "npm run webpack"
},
"command": "npm run dev",
"presentation": {
"reveal": "always",
"panel": "new"
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.22.0] - 2022-06-29

### Changed

- Update GitHub Action to latest major version (version 1).
- Update *.eslintrc.json* to use `eslint-config-node-roboleary` config.

### Fixed

- Autofixed some mistakes caught by ESLint.

## [0.21.2] - 2022-06-12

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ If you have a suggestion or find a bug, please file an issue.

If you are happy with the extension: please star the repo, and leave a review to help others find it. 🌟

You can [buy me a coffee](https://ko-fi.com/roboleary) if you would like to support me in maintaining this project and creating more open-source software. 🙏
You can [buy me a coffee or sponsor me](https://ko-fi.com/roboleary) if you would like to support me in maintaining this project and creating more open-source software. 🙏

## Learn more about snippets

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"description": "View and edit all your snippets in one purty place. Yee-haw!",
"icon": "img/logo.png",
"version": "0.21.2",
"version": "0.22.0",
"engines": {
"vscode": "^1.4.0",
"node": ">=12.0.0"
Expand Down Expand Up @@ -114,9 +114,9 @@
"prettier": "npx prettier src test --check",
"prettier:fix": "npm run prettier -- --write",
"format": "npm run prettier:fix && npm run lint:fix",
"webpack": "webpack --mode development --watch",
"dev": "webpack --mode development --watch",
"vscode:prepublish": "webpack --mode production",
"build": "npx vsce package ."
"build": "vsce package"
},
"dependencies": {
"glob": "^7.1.6",
Expand Down
4 changes: 1 addition & 3 deletions src/snippets-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ class SnippetsFetcher {
let modifiedSnippetsArray = extensionSnippetsArray.map(
this.fetchExtensionSnippets.bind(this)
);
return Promise.all(modifiedSnippetsArray).then(() => {
return extensionSnippetsArray;
});
return Promise.all(modifiedSnippetsArray).then(() => extensionSnippetsArray);
}

async fetchExtensionSnippets(extensionSnippets) {
Expand Down
22 changes: 11 additions & 11 deletions test/suite/formatter.test.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
const assert = require("assert");
const formatter = require("../../src/formatter");

describe("Formatter", function () {
describe("convertToArray()", function () {
it("should create an array from a single-line string", function () {
describe("Formatter", () => {
describe("convertToArray()", () => {
it("should create an array from a single-line string", () => {
let array = formatter.convertToArray("some text");
assert.strictEqual(array[0], "some text");
});

it("should create an array from a multi-line string", function () {
it("should create an array from a multi-line string", () => {
let array = formatter.convertToArray("line 1\nline 2");
assert.strictEqual(array.length, 2);
assert.strictEqual(array[1], "line 2");
});
});

describe("formatTitle()", function () {
it("should capitilize most languages", function () {
describe("formatTitle()", () => {
it("should capitilize most languages", () => {
let js = formatter.formatTitle("javascript");
let python = formatter.formatTitle("python");

assert.strictEqual(js, "Javascript");
assert.strictEqual(python, "Python");
});

it("should uppercase some languages", function () {
it("should uppercase some languages", () => {
let html = formatter.formatTitle("html");
let css = formatter.formatTitle("css");

Expand All @@ -33,16 +33,16 @@ describe("Formatter", function () {
});
});

describe("capitalize()", function () {
it("should capitilize the first word", function () {
describe("capitalize()", () => {
it("should capitilize the first word", () => {
let word = formatter.formatTitle("word1 word2");

assert.strictEqual(word, "Word1 word2");
});
});

describe("escapeHtml()", function () {
it("should replace anything that could be interpeted as HTML with a text equivalent", function () {
describe("escapeHtml()", () => {
it("should replace anything that could be interpeted as HTML with a text equivalent", () => {
let text1 = formatter.escapeHtml(`This is the <html> tag.`);
let text2 = formatter.escapeHtml(`No '"& allowed.`);
let text3 = formatter.escapeHtml(`\t let x = 1;`);
Expand Down
8 changes: 4 additions & 4 deletions test/suite/snippet.test.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const assert = require("assert");
const Snippet = require("../../src/snippet");

describe("Snippet", function () {
it("should create an empty object if no arguments given to constructor", function () {
describe("Snippet", () => {
it("should create an empty object if no arguments given to constructor", () => {
let mySnippet = new Snippet();
assert.strictEqual(mySnippet.name, "");
assert.strictEqual(mySnippet.description, "");
assert.strictEqual(mySnippet.prefix, "");
assert.strictEqual(typeof mySnippet.body === "object", true); // it should be an array
});

it("should allow double quotes in fields", function () {
it("should allow double quotes in fields", () => {
let mySnippet = new Snippet(
`my "name"`,
`my "prefix"`,
Expand All @@ -23,7 +23,7 @@ describe("Snippet", function () {
assert.strictEqual(mySnippet.body[0], 'my "body"');
});

it("should produce a string of the object", function () {
it("should produce a string of the object", () => {
let mySnippet = new Snippet(
`map js`,
`map`,
Expand Down

0 comments on commit 67aaa87

Please sign in to comment.