first steps
This commit is contained in:
parent
0788cd9636
commit
194521babf
12 changed files with 10852 additions and 1 deletions
22
gulpfile.babel.js
Normal file
22
gulpfile.babel.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import gulp from 'gulp';
|
||||
import tsb from 'gulp-tsb';
|
||||
import rimraf from 'rimraf';
|
||||
import { compilerOptions } from './tsconfig.json';
|
||||
|
||||
const compilation = tsb.create(compilerOptions);
|
||||
const src = [
|
||||
'src/**/*.ts',
|
||||
'typings/**/*.d.ts'
|
||||
];
|
||||
|
||||
gulp.task('clean', cb => rimraf('out', cb));
|
||||
|
||||
gulp.task('compile', ['clean'], () => {
|
||||
return gulp.src(src, { base: 'src' })
|
||||
.pipe(compilation())
|
||||
.pipe(gulp.dest('out'));
|
||||
});
|
||||
|
||||
gulp.task('watch', ['compile'], () => {
|
||||
return gulp.watch(src, ['compile']);
|
||||
});
|
5
jsconfig.json
Normal file
5
jsconfig.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES6"
|
||||
}
|
||||
}
|
12
package.json
12
package.json
|
@ -4,5 +4,15 @@
|
|||
"description": "VSCode Extension Manager",
|
||||
"main": "index.js",
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT"
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lodash": "^3.10.1",
|
||||
"yazl": "^2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel": "^5.8.23",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-tsb": "^1.6.0",
|
||||
"rimraf": "^2.4.3"
|
||||
}
|
||||
}
|
||||
|
|
4
resources/[Content_Types].xml
Normal file
4
resources/[Content_Types].xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
||||
<Default Extension=".vsixmanifest" ContentType="text/xml"/>
|
||||
</Types>
|
25
src/main.ts
Normal file
25
src/main.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as _ from 'lodash';
|
||||
import * as yazl from 'yazl';
|
||||
|
||||
var templatePath = path.join(__dirname, 'resources', 'extension.vsixmanifest');
|
||||
var vsixmanifest = fs.readFileSync(templatePath, 'utf8');
|
||||
var template = _.template(vsixmanifest);
|
||||
var result = template({
|
||||
id: 'uuid',
|
||||
displayName: 'UUID',
|
||||
version: '0.2.0',
|
||||
publisher: 'joaomoreno2',
|
||||
description: 'This is a UUID extension',
|
||||
tags: 'VSCode'
|
||||
});
|
||||
|
||||
var zip = new yazl.ZipFile();
|
||||
zip.addBuffer(new Buffer(result, 'utf8'), 'extension.vsixmanifest');
|
||||
zip.addFile(path.join(__dirname, 'resources', '[Content_Types].xml'), '[Content_Types].xml');
|
||||
zip.addBuffer(new Buffer('hello world', 'utf8'), 'hello.txt');
|
||||
zip.end();
|
||||
|
||||
var zipStream = fs.createWriteStream(path.join(__dirname, 'uuid.vsix'));
|
||||
zip.outputStream.pipe(zipStream);
|
6
tsconfig.json
Normal file
6
tsconfig.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs"
|
||||
}
|
||||
}
|
15
tsd.json
Normal file
15
tsd.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"version": "v4",
|
||||
"repo": "borisyankov/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"node/node.d.ts": {
|
||||
"commit": "6f6e5c7dd9effe21fee14eb65fe340ecbbc8580a"
|
||||
},
|
||||
"lodash/lodash.d.ts": {
|
||||
"commit": "6f6e5c7dd9effe21fee14eb65fe340ecbbc8580a"
|
||||
}
|
||||
}
|
||||
}
|
8680
typings/lodash/lodash.d.ts
vendored
Normal file
8680
typings/lodash/lodash.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load diff
2072
typings/node/node.d.ts
vendored
Normal file
2072
typings/node/node.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load diff
2
typings/tsd.d.ts
vendored
Normal file
2
typings/tsd.d.ts
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/// <reference path="node/node.d.ts" />
|
||||
/// <reference path="lodash/lodash.d.ts" />
|
10
typings/yazl/yazl.d.ts
vendored
Normal file
10
typings/yazl/yazl.d.ts
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
declare module 'yazl' {
|
||||
import * as stream from 'stream';
|
||||
|
||||
class ZipFile {
|
||||
outputStream: stream.Stream;
|
||||
addBuffer(buffer: Buffer, path: string);
|
||||
addFile(localPath: string, path: string);
|
||||
end();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue