Git Product home page Git Product logo

vscode-extensions-template's Introduction

VSCode Extensions template

This is my custom VSCode extension template. Mainly used to illustrate my blog post about aliases actually.

How to use it

  1. Clone the repo
  2. Do git remote remove origin
  3. Find all occurenses of templaet in the project and replace them with your extension name

You're good to go!

Configuring aliases

Aliases are configure in tsconfig.json. There are 2 sample aliases.

Move aliasing to another extension

To use aliasing in another extension you need to do the following:

  1. Migrate the following code from webpack config:
const tsconfigContent = require('./tsconfig.json');

const alias = {}
Object.entries(tsconfigContent.compilerOptions.paths).forEach(([aliasName, [ aliasContent ]]) => {
  const name = aliasName.replace('/*', '');
  const aliasPath = path.resolve(root, 'out', aliasContent.replace('/*', ''));
  alias[name] = aliasPath;
})
  1. Move alias.ts to your test folder
  2. Migrate the following code from runTest.ts
import './alias';
import 'module-alias/register';
  1. Install module-alias package

Version under test

I have a restriction on the VSCode version I can use at work, so I create my extensions with respect to that. For this template it means I have a code that makes sure I run test against a speciic version instead of the latest stable.

The version under test is specified in package.json in engines.vscode.

To remove this functionality simply change thfollowing line in runTest.ts:

await runTests({ extensionDevelopmentPath, extensionTestsPath, version });

to

await runTests({ extensionDevelopmentPath, extensionTestsPath });

vscode-extensions-template's People

Contributors

nchursin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.