Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts
19 changes: 19 additions & 0 deletions .github/scripts/enableWebpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";
exports.__esModule = true;
var fs = require("fs");
// adjust .vscodeignore
var fileVscodeignore = './.vscodeignore';
var vscodeignore = fs.readFileSync(fileVscodeignore, 'utf-8');
vscodeignore = vscodeignore.replace(/^#(.*)#\s*withWebpack\s*$/gm, '$1');
vscodeignore = vscodeignore.replace(/^\s*#\s*withoutWebpack(?:.|\r|\n)*?^\s*#\s*\/withoutWebpack/gm, '');
fs.writeFileSync(fileVscodeignore, vscodeignore);
// adjust package.json
var filePkgJson = './package.json';
var pkgJson = JSON.parse(fs.readFileSync(filePkgJson, 'utf-8'));
if ('withWebpack' in pkgJson) {
for (var k in pkgJson.withWebpack) {
pkgJson[k] = pkgJson.withWebpack[k];
}
pkgJson.withWebpack = undefined;
}
fs.writeFileSync(filePkgJson, JSON.stringify(pkgJson, undefined, 2));
29 changes: 29 additions & 0 deletions .github/scripts/enableWebpack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

import * as fs from 'fs';

// adjust .vscodeignore
const fileVscodeignore = './.vscodeignore';

let vscodeignore = fs.readFileSync(fileVscodeignore, 'utf-8');
vscodeignore = vscodeignore.replace(/^#(.*)#\s*withWebpack\s*$/gm, '$1');
vscodeignore = vscodeignore.replace(/^\s*#\s*withoutWebpack(?:.|\r|\n)*?^\s*#\s*\/withoutWebpack/gm, '');
fs.writeFileSync(fileVscodeignore, vscodeignore);


// adjust package.json
const filePkgJson = './package.json';
interface PkgJson {
withWebpack?: {
[k: string]: any;
}
[k: string]: any;
}

const pkgJson = JSON.parse(fs.readFileSync(filePkgJson, 'utf-8')) as PkgJson;
if('withWebpack' in pkgJson){
for(const k in pkgJson.withWebpack){
pkgJson[k] = pkgJson.withWebpack[k];
}
pkgJson.withWebpack = undefined;
}
fs.writeFileSync(filePkgJson, JSON.stringify(pkgJson, undefined, 2));
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: main
on: [push, pull_request]
env:
SCRIPT_DIR: ./.github/scripts

jobs:
test:
strategy:
Expand All @@ -11,7 +14,7 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: "13.x"
- run: npm install
- run: yarn install
- name: Run tests
uses: GabrielBB/xvfb-action@v1.0
with:
Expand All @@ -22,7 +25,8 @@ jobs:
VSIX_FILE: vscode-R.vsix
steps:
- uses: actions/checkout@v2
- run: npm install
- run: node $SCRIPT_DIR/enableWebpack.js
- run: yarn install
- uses: lannonbr/vsce-action@master
with:
args: "package -o $VSIX_FILE"
Expand All @@ -37,8 +41,8 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: "13.x"
- run: npm install
- run: npm run lint
- run: yarn install
- run: yarn run lint
markdownlint-cli:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -73,6 +77,6 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: "13.x"
- run: npm ci
- run: yarn install
- name: Run devreplay
run: ./node_modules/.bin/devreplay ./src devreplay.json
5 changes: 3 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pre-release

# creates a pre-release with the .vsix
# creates/updates a pre-release with the .vsix

on:
push:
Expand All @@ -14,7 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: node $SCRIPT_DIR/enableWebpack.js
- run: yarn install
- uses: lannonbr/vsce-action@master
with:
args: "package -o $FILE_OUT"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: node $SCRIPT_DIR/enableWebpack.js
- run: yarn install
- uses: lannonbr/vsce-action@master
with:
args: "package"
Expand Down Expand Up @@ -49,11 +50,11 @@ jobs:
publish:
name: Publish
timeout-minutes: 30
needs: release # doesn't really need these, just to make sure that packaging etc worked
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: node $SCRIPT_DIR/enableWebpack.js
- run: yarn install
- uses: lannonbr/vsce-action@master
with:
args: "publish -p $VSCE_TOKEN"
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"outFiles": [
"${workspaceRoot}/out/src/**/*.js"
],
"preLaunchTask": "npm: compile"
"preLaunchTask": "npm: watch"
},
{
"name": "Launch Extension (--disable-extensions)",
Expand All @@ -29,7 +29,7 @@
"outFiles": [
"${workspaceRoot}/out/src/**/*.js"
],
"preLaunchTask": "npm: compile"
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
Expand Down
37 changes: 27 additions & 10 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,33 @@
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Package and install Extension",
"type": "shell",
"problemMatcher": [],
"command": "vsce package -o ${workspaceFolderBasename}.vsix && code --install-extension ${workspaceFolderBasename}.vsix --force",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Package Extension",
"type": "shell",
"problemMatcher": [],
"command": "vsce",
"args": [
"package",
"-o",
"${workspaceFolderBasename}.vsix"
]
},
{
"label": "Install Extension",
"type": "shell",
"problemMatcher": [],
"command": "code",
"args": [
"--install-extension",
"${workspaceFolderBasename}.vsix",
"--force"
],
"dependsOn": ["Package Extension"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "compile",
Expand Down
16 changes: 11 additions & 5 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
.xlsx
**/*.map
devreplay.json
html/*.ts
node_modules
out/
html/**/*.ts
out/test/**
src/
src/**
test/**
tsconfig.json
tsconfig.json
**/tsconfig.json
vsc-extension-quickstart.md
webpack.config.js
.markdownlint.json
.eslintignore

# node_modules #withWebpack
# out/ #withWebpack

# withoutWebpack:
dist
# /withoutWebpack
Loading