From e41516360c0387a32a04a97d926aa86eaee3fa96 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Thu, 8 Nov 2018 10:50:21 -0800 Subject: [PATCH] Various cleanup --- .base-sample/.prettierrc.json | 5 ----- .base-sample/package-lock.json | 8 +------- .base-sample/package.json | 8 +++----- .base-sample/src/test/extension.test.ts | 21 --------------------- .base-sample/src/test/index.ts | 22 ---------------------- .github/SAMPLE_GUIDELINE.md | 5 +++-- .scripts/samples.js | 2 +- webview-sample/.prettierrc.json | 5 ----- 8 files changed, 8 insertions(+), 68 deletions(-) delete mode 100644 .base-sample/.prettierrc.json delete mode 100644 .base-sample/src/test/extension.test.ts delete mode 100644 .base-sample/src/test/index.ts delete mode 100644 webview-sample/.prettierrc.json diff --git a/.base-sample/.prettierrc.json b/.base-sample/.prettierrc.json deleted file mode 100644 index c090136a..00000000 --- a/.base-sample/.prettierrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "useTabs": true, - "printWidth": 120, - "singleQuote": true -} \ No newline at end of file diff --git a/.base-sample/package-lock.json b/.base-sample/package-lock.json index b43951d4..986dfb71 100644 --- a/.base-sample/package-lock.json +++ b/.base-sample/package-lock.json @@ -1,15 +1,9 @@ { - "name": "hellocode-sample", + "name": "base-sample", "version": "0.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { - "@types/mocha": { - "version": "2.2.48", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", - "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", - "dev": true - }, "@types/node": { "version": "8.10.30", "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.30.tgz", diff --git a/.base-sample/package.json b/.base-sample/package.json index 71b5cb1e..c8f290cd 100644 --- a/.base-sample/package.json +++ b/.base-sample/package.json @@ -1,7 +1,7 @@ { - "name": "hellocode-sample", - "displayName": "hellocode-sample", - "description": "HelloWorld example for VS Code", + "name": "base-sample", + "displayName": "base-sample", + "description": "Base sample for other samples at Microsoft/vscode-extension-samples", "version": "0.0.1", "publisher": "vscode-samples", "engines": { @@ -27,10 +27,8 @@ "compile": "tsc -p ./", "watch": "tsc -watch -p ./", "postinstall": "node ./node_modules/vscode/bin/install", - "test": "npm run compile && node ./node_modules/vscode/bin/test" }, "devDependencies": { - "@types/mocha": "^2.2.42", "@types/node": "^8.10.25", "tslint": "^5.11.0", "typescript": "^2.6.1", diff --git a/.base-sample/src/test/extension.test.ts b/.base-sample/src/test/extension.test.ts deleted file mode 100644 index f364cca4..00000000 --- a/.base-sample/src/test/extension.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -// -// Note: This example test is leveraging the Mocha test framework. -// Please refer to their documentation on https://mochajs.org/ for help. -// - -// The module 'assert' provides assertion methods from node -import * as assert from 'assert'; - -// You can import and use all API from the 'vscode' module -// as well as import your extension to test it -// import * as vscode from 'vscode'; -// import * as myExtension from '../extension'; - -// Defines a Mocha test suite to group tests of similar kind together -suite('Extension Tests', function() { - // Defines a Mocha unit test - test('Something 1', function() { - assert.equal(-1, [1, 2, 3].indexOf(5)); - assert.equal(-1, [1, 2, 3].indexOf(0)); - }); -}); diff --git a/.base-sample/src/test/index.ts b/.base-sample/src/test/index.ts deleted file mode 100644 index 27dc468f..00000000 --- a/.base-sample/src/test/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -// -// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING -// -// This file is providing the test runner to use when running extension tests. -// By default the test runner in use is Mocha based. -// -// You can provide your own test runner if you want to override it by exporting -// a function run(testRoot: string, clb: (error:Error) => void) that the extension -// host can call to run the tests. The test runner is expected to use console.log -// to report the results back to the caller. When the tests are finished, return -// a possible error to the callback or null if none. - -import * as testRunner from 'vscode/lib/testrunner'; - -// You can directly control Mocha options by uncommenting the following lines -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info -testRunner.configure({ - ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true // colored output from test results -}); - -module.exports = testRunner; diff --git a/.github/SAMPLE_GUIDELINE.md b/.github/SAMPLE_GUIDELINE.md index 2e8432ae..b13d453b 100644 --- a/.github/SAMPLE_GUIDELINE.md +++ b/.github/SAMPLE_GUIDELINE.md @@ -1,7 +1,7 @@ # Sample Guideline Each sample should have the following components and structure, so that users could have a smooth experience when playing with different samples. -The quickest way is to start your project by copying .base-sample. +The quickest way is to start your project by copying [.base-sample](https://github.com/Microsoft/vscode-extension-samples/tree/master/.base-sample). ## 1: Sample Listing @@ -22,9 +22,10 @@ The quickest way is to start your project by copying .base-sample. - 3.2: extensions.json: use `eg2.tslint`. - 3.3: settings.json: use `"editor.insertSpaces": false`. This ensure when user opens the subfolder, tab indentation is enforced. -## 4: Lockfile +## 4: Dependencies - 4.1: Use `npm`'s `package-lock.json` instead of `yarn.lock`. +- 4.2: `devDependencies` should include `@types/node`, `vscode`, `typescript` and `tslint`. ## 5: Formatter and Linter diff --git a/.scripts/samples.js b/.scripts/samples.js index f50d1a5a..7de9db34 100644 --- a/.scripts/samples.js +++ b/.scripts/samples.js @@ -91,7 +91,7 @@ const samples = [{ contributions: ['views', 'viewsContainers'] }, { - description: 'vim-sample', + description: 'Vim Sample', path: 'vim-sample', guide: null, apis: [`commands`, `StatusBarItem`, `window.createStatusBarItem`, `TextEditorCursorStyle`, `window.activeTextEditor`, `Position`, `Range`, `Selection`, `TextEditor`, `TextEditorRevealType`, `TextDocument`], diff --git a/webview-sample/.prettierrc.json b/webview-sample/.prettierrc.json deleted file mode 100644 index c090136a..00000000 --- a/webview-sample/.prettierrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "useTabs": true, - "printWidth": 120, - "singleQuote": true -} \ No newline at end of file