Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzgillner committed Sep 18, 2023
1 parent 0634357 commit c86f4a5
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 27 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }]
}
}
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ jobs:
run: node -e "let pkg = require('./package.json'); console.log('PACKAGE_VERSION=' + pkg.version + '\nPACKAGE_NAME=' + pkg.name + '-' + pkg.version)" >> $GITHUB_ENV
- name: Install Dependencies
run: npm install
- name: Install VSCE
run: npm install -g @vscode/vsce
- name: Package Extension
run: vsce package -o ./${{ env.PACKAGE_NAME }}.vsix
run: npm run release
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,4 @@ dist

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,node

.eslintrc.js
package-lock.json
8 changes: 8 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.github/
.vscode/
src/

**/*.map

.gitignore
tsconfig.json
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,30 @@ This extension adds a panel that mimics the functionality of Geany's "Scribble"

![Extension screenshot](assets/vscode_scribble.png)

## Build
## Installation

To build this extension, you need the TypeScript compiler `tsc` and the "Visual Studio Code Extensions" (`vsce`) command line tool, which can be installed via `npm`:
[Download](https://github.com/lorenzgillner/vscode-scribble/releases/latest) or [build](#build) the package, then install it via the extension manager ("View" > "Extensions" > "Views and More Actions..." > "Install from VSCIX...") or from the command line:

```sh
npm install -g typescript @vscode/vsce
code --install-extension scribble-<version>.vsix
```

I recommend compiling the project first, to see whether you need to install some dependencies:

```sh
cd vscode-scribble
npm run compile
```
## Building from source

If everything compiles, you can package the current version:
Clone the source code and enter the source directory. Make sure that an *up-to-date* version of `npm` is installed, since it will take care of the remaining steps:

```sh
vsce package # produces scribble-<version>.vsix
git clone https://github.com/lorenzgillner/vscode-scribble
cd vscode-scribble
npm install # install dependencies
npm run release # build the VSIX package
```

## Install

Build or download the package, then install it via "View" > "Extensions" > "Views and More Actions..." > "Install from VSCIX...", or from the command line:
## Key bindings

```sh
code --install-extension scribble-<version>.vsix
```
Shortcut | Description
--- | ---
**[ctrl]+[s]** | Save your current scribble

## PSA

Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Scribble",
"description": "A Geany-like scratchpad for VS Code",
"icon": "./assets/icon.png",
"version": "0.0.9",
"version": "0.0.10",
"publisher": "lorenzgillner",
"preview": true,
"license": "MIT",
Expand Down Expand Up @@ -80,15 +80,20 @@
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"lint": "eslint \"src/**/*.ts\"",
"watch": "tsc -w -p ./"
"compile": "esbuild ./src/extension.ts --bundle --outfile=./out/extension.js --external:vscode --format=cjs --platform=node --minify",
"lint": "eslint src/*.ts",
"watch": "tsc -w -p ./",
"package": "vsce package --no-yarn",
"clean": "npx rimraf --preserve-root -- scribble*.vsix out/",
"release": "npm run clean && npm run lint && npm run package"
},
"devDependencies": {
"@types/node": "^18.17.1",
"@types/vscode": "^1.73.0",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@vscode/vsce": "^2.21.0",
"esbuild": "^0.19.3",
"eslint": "^8.32.0",
"typescript": "^4.9.5"
},
Expand Down

0 comments on commit c86f4a5

Please sign in to comment.