Skip to content

Commit 13b5e54

Browse files
committed
refactor: refact with vscode 1.52.1
1 parent 1689147 commit 13b5e54

49 files changed

Lines changed: 5102 additions & 5743 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
.DS_Store
12
lib
23
dist
4+
out
35
node_modules
4-
.cache

build/css.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

build/emtpy.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/webpack.vscode.config.js

Lines changed: 0 additions & 100 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
//@ts-check
7+
'use strict';
8+
9+
//@ts-check
10+
/** @typedef {import('webpack').Configuration} WebpackConfig **/
11+
12+
const path = require('path');
13+
14+
module.exports = /** @type WebpackConfig */ {
15+
context: __dirname,
16+
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
17+
target: 'webworker', // extensions run in a webworker context
18+
entry: {
19+
extension: './src/extension.ts',
20+
},
21+
resolve: {
22+
mainFields: ['module', 'main'],
23+
extensions: ['.ts', '.js'], // support ts-files and js-files
24+
},
25+
module: {
26+
rules: [{
27+
test: /\.ts$/,
28+
exclude: /node_modules/,
29+
use: [{
30+
// configure TypeScript loader:
31+
// * enable sources maps for end-to-end source maps
32+
loader: 'ts-loader',
33+
options: {
34+
compilerOptions: {
35+
'sourceMap': true,
36+
'declaration': false
37+
}
38+
}
39+
}]
40+
}]
41+
},
42+
externals: {
43+
'vscode': 'commonjs vscode', // ignored because it doesn't exist
44+
},
45+
performance: {
46+
hints: false
47+
},
48+
output: {
49+
filename: 'extension.js',
50+
path: path.join(__dirname, 'dist'),
51+
libraryTarget: 'commonjs'
52+
},
53+
devtool: 'source-map'
54+
};

extensions/github1s/package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "github1s-vscode-extension",
3+
"version": "0.0.0",
4+
"publisher": "github1s",
5+
"description": "",
6+
"private": true,
7+
"main": "index.js",
8+
"directories": {
9+
"lib": "lib"
10+
},
11+
"activationEvents": [
12+
"onFileSystem:github1s",
13+
"onDebug"
14+
],
15+
"browser": "./dist/extension",
16+
"engines": {
17+
"vscode": "^1.48.0"
18+
},
19+
"contributes": {},
20+
"scripts": {
21+
"clean": "rm -rf dist out",
22+
"build": "webpack --config extension.webpack.config.js --mode production",
23+
"dev": "webpack --config extension.webpack.config.js --watch"
24+
},
25+
"keywords": [],
26+
"author": "",
27+
"license": "ISC",
28+
"dependencies": {
29+
"object-hash": "^2.1.1",
30+
"p-finally": "^2.0.1",
31+
"webpack-cli": "^4.4.0"
32+
},
33+
"devDependencies": {
34+
"@types/vscode": "^1.52.0",
35+
"ts-loader": "^8.0.14",
36+
"typescript": "^4.1.3",
37+
"webpack": "^4.46.0"
38+
}
39+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @file extension entry
3+
* @author netcon
4+
*/
5+
6+
import * as vscode from 'vscode';
7+
import { Github1sFS } from './githubfs';
8+
import { prop } from './util';
9+
import { RepoState } from './types';
10+
11+
export function activate(context: vscode.ExtensionContext) {
12+
const authority = prop(vscode.workspace, ['workspaceFolders', 0, 'uri', 'authority']) as string || '';
13+
const [owner, repo, branch] = authority.split('/');
14+
const repoState: RepoState = { owner, repo, branch };
15+
context.subscriptions.push(new Github1sFS(repoState));
16+
};

0 commit comments

Comments
 (0)