Splits github fs out into its own extension

This commit is contained in:
Eric Amodio 2020-06-08 15:50:54 -04:00
parent 3a14f91f96
commit 91589cbf8d
20 changed files with 3145 additions and 2952 deletions

3
extensions/github-browser/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
dist
out
node_modules

View file

@ -0,0 +1,11 @@
.vscode/**
build/**
dist/**
out/**
src/**
typings/**
.gitignore
extension-browser.webpack.config.js
extension.webpack.config.js
tsconfig.json
yarn.lock

View file

@ -0,0 +1,7 @@
# GitHub FileSystem for Visual Studio Code
**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
## Features
This extension provides remote GitHub repository features for VS Code.

View file

@ -0,0 +1,24 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const path = require('path');
const withDefaults = require('../shared.webpack.config');
module.exports = withDefaults({
context: __dirname,
target: 'webworker',
node: false,
entry: {
extension: './src/extension.ts',
},
resolve: {
alias: {
'node-fetch': path.resolve(__dirname, 'node_modules/node-fetch/browser.js'),
},
}
});

View file

@ -0,0 +1,17 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withDefaults = require('../shared.webpack.config');
module.exports = withDefaults({
context: __dirname,
entry: {
extension: './src/extension.ts'
}
});

View file

@ -0,0 +1,51 @@
{
"name": "github-browser",
"displayName": "%displayName%",
"description": "%description%",
"publisher": "vscode",
"version": "0.0.1",
"engines": {
"vscode": "^1.45.0"
},
"enableProposedApi": true,
"private": true,
"categories": [
"Other"
],
"activationEvents": [
"onFileSystem:github"
],
"browser": "./dist/extension.js",
"main": "./out/extension.js",
"contributes": {
"resourceLabelFormatters": [
{
"scheme": "github",
"authority": "*",
"formatting": {
"label": "${authority}${path}",
"separator": "/",
"workspaceSuffix": "GitHub"
}
}
]
},
"scripts": {
"compile": "gulp compile-extension:github-browser",
"compile-web": "npx webpack-cli --config extension-browser.webpack.config --mode none",
"watch": "gulp watch-extension:github-browser",
"watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose",
"vscode:prepublish": "npm run compile"
},
"dependencies": {
"@octokit/graphql": "4.5.0",
"@octokit/rest": "17.11.0",
"fuzzysort": "1.1.4",
"node-fetch": "2.6.0"
},
"devDependencies": {
"@types/node-fetch": "2.5.7",
"webpack": "4.43.0",
"webpack-cli": "3.3.11"
}
}

View file

@ -0,0 +1,4 @@
{
"displayName": "GitHub Browser",
"description": "Remotely browse a GitHub repository"
}

View file

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { GitHubFS } from './githubfs';
export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(new GitHubFS());
}

View file

@ -32,6 +32,7 @@ import {
import { Octokit } from '@octokit/rest';
import { graphql } from '@octokit/graphql/';
import * as fuzzySort from 'fuzzysort';
import fetch from 'node-fetch';
import { Iterables } from './iterables';
const emptyDisposable = { dispose: () => { /* noop */ } };

View file

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
/// <reference path="../../../types/lib.textEncoder.d.ts" />

View file

@ -0,0 +1,13 @@
{
"extends": "../shared.tsconfig.json",
"compilerOptions": {
"outDir": "./out",
// "experimentalDecorators": true,
// "typeRoots": [
// "./node_modules/@types"
// ]
},
"include": [
"src/**/*"
]
}

File diff suppressed because it is too large Load diff

View file

@ -1,2 +1,3 @@
dist
out
node_modules
node_modules

View file

@ -1,6 +1,11 @@
.vscode/**
build/**
dist/**
out/**
src/**
typings/**
**/*.ts
**/*.map
.gitignore
extension-browser.webpack.config.js
extension.webpack.config.js
tsconfig.json
yarn.lock

View file

@ -15,10 +15,5 @@ module.exports = withDefaults({
node: false,
entry: {
extension: './src/extension.ts',
},
resolve: {
alias: {
'node-fetch': path.resolve(__dirname, 'node_modules/node-fetch/browser.js'),
},
}
});

View file

@ -4,36 +4,14 @@
*--------------------------------------------------------------------------------------------*/
//@ts-check
/** @typedef {import('webpack').Configuration} WebpackConfig **/
'use strict';
const path = require('path');
const withDefaults = require('../shared.webpack.config');
module.exports = function (env, argv) {
const mode = argv.mode;
/**@type WebpackConfig*/
const config = {
context: __dirname,
target: 'webworker',
node: false,
resolve: {
alias: {
'node-fetch': path.resolve(__dirname, 'node_modules/node-fetch/browser.js'),
},
},
entry: {
extension: './src/extension.ts',
},
};
if (mode === 'none') {
// Set the output to `out` when there is no mode (e.g. not production)
config.output = {
path: path.join(__dirname, 'out'),
};
module.exports = withDefaults({
context: __dirname,
entry: {
extension: './src/extension.ts'
}
return withDefaults(config);
};
});

View file

@ -99,16 +99,9 @@
"watch-web": "npx webpack-cli --config extension.webpack.config --mode none --watch --info-verbosity verbose",
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-web-playground ./tsconfig.json"
},
"dependencies": {
"@octokit/graphql": "4.5.0",
"@octokit/rest": "17.9.2",
"fuzzysort": "1.1.4"
},
"devDependencies": {
"@types/mocha": "2.2.43",
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"webpack": "4.43.0",
"webpack-cli": "3.3.11"
"mocha-multi-reporters": "^1.1.7"
}
}

View file

@ -13,7 +13,6 @@
//
import * as vscode from 'vscode';
import { GitHubFS } from './githubfs';
import { MemFS } from './memfs';
declare const window: unknown;
@ -36,7 +35,6 @@ export function activate(context: vscode.ExtensionContext) {
function enableFs(context: vscode.ExtensionContext): MemFS {
const memFs = new MemFS();
context.subscriptions.push(memFs);
context.subscriptions.push(new GitHubFS());
return memFs;
}

File diff suppressed because it is too large Load diff