Merge pull request #60 from hoovercj/master
Added options to collect call in pack function
This commit is contained in:
commit
998cc32d00
3 changed files with 78 additions and 1 deletions
|
@ -399,7 +399,7 @@ export function pack(options: IPackageOptions = {}): Promise<IPackageResult> {
|
|||
|
||||
return readManifest(cwd)
|
||||
.then(manifest => prepublish(cwd, manifest))
|
||||
.then(manifest => collect(manifest)
|
||||
.then(manifest => collect(manifest, options)
|
||||
.then(files => writeVsix(files, path.resolve(options.packagePath || defaultPackagePath(cwd, manifest)))
|
||||
.then(packagePath => ({ manifest, packagePath }))));
|
||||
}
|
||||
|
|
44
src/test/fixtures/readme/readme.images.expected.md
vendored
Normal file
44
src/test/fixtures/readme/readme.images.expected.md
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
# README
|
||||
|
||||
>**Important:** Once installed the checker will only update if you add the setting `"spellMD.enable": true` to your `.vscode\settings.json` file.
|
||||
|
||||
This README covers off:
|
||||
* [Functionality](#functionality)
|
||||
* [Install](#install)
|
||||
* [Run and Configure](#run-and-configure)
|
||||
* [Known Issues/Bugs](#known-issuesbugs)
|
||||
* [Backlog](#backlog)
|
||||
* [How to Debug](#how-to-debug)
|
||||
|
||||
# Functionality
|
||||
|
||||
Load up a Markdown file and get highlights and hovers for existing issues. Checking will occur as you type in the document.
|
||||
|
||||
![Underscores and hovers](https://github.com/username/repository/path/to/images/SpellMDDemo1.gif)
|
||||
|
||||
The status bar lets you quickly navigate to any issue and you can see all positions in the gutter.
|
||||
|
||||
![Jump to issues](https://github.com/username/repository/path/to/images/SpellMDDemo2.gif)
|
||||
|
||||
The `spellMD.json` config file is watched so you can add more ignores or change mappings at will.
|
||||
|
||||
![Add to dictionary](https://github.com/username/repository/path/to/images/SpellMDDemo3.gif)
|
||||
|
||||
![issue](https://github.com/username/repository/path/to/issue)
|
||||
|
||||
[mono](https://github.com/username/repository/blob/master/monkey)
|
||||
[not](http://shouldnottouchthis/)
|
||||
|
||||
# Install
|
||||
This extension is published in the VS Code Gallery. So simply hit 'F1' and type 'ext inst' from there select `SpellMD` and follow instructions.
|
||||
|
||||
|
||||
To clone the extension and load locally...
|
||||
|
||||
```
|
||||
git clone https://github.com/Microsoft/vscode-SpellMD.git
|
||||
npm install
|
||||
tsc
|
||||
```
|
||||
|
||||
>**Note:** TypeScript 1.6 or higher is required you can check with `tsc -v` and if you need to upgrade then run `npm install -g typescript`.
|
|
@ -508,4 +508,37 @@ describe('ReadmeProcessor', () => {
|
|||
})
|
||||
});
|
||||
});
|
||||
|
||||
it('should replace img urls with baseImagesUrl', () => {
|
||||
const manifest = {
|
||||
name: 'test',
|
||||
publisher: 'mocha',
|
||||
version: '0.0.1',
|
||||
description: 'test extension',
|
||||
engines: Object.create(null),
|
||||
repository: 'https://github.com/username/repository.git'
|
||||
};
|
||||
|
||||
const options = {
|
||||
baseImagesUrl: 'https://github.com/username/repository/path/to'
|
||||
}
|
||||
|
||||
const root = fixture('readme');
|
||||
const processor = new ReadmeProcessor(manifest, options);
|
||||
const readme = {
|
||||
path: 'extension/readme.md',
|
||||
localPath: path.join(root, 'readme.md')
|
||||
};
|
||||
|
||||
return processor.onFile(readme)
|
||||
.then(file => read(file))
|
||||
.then(actualBuffer => {
|
||||
const actual = actualBuffer.toString('utf8');
|
||||
|
||||
return readFile(path.join(root, 'readme.images.expected.md'), 'utf8')
|
||||
.then(expected => {
|
||||
assert.equal(actual, expected);
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Reference in a new issue