Skip to content

Commit

Permalink
fix(dependencies): Updated read-pkg to correct its type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-molak committed Apr 24, 2019
1 parent b1a589f commit 6db82a0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
31 changes: 14 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@types/express": "^4.16.1",
"@types/mocha": "^5.2.6",
"@types/mustache": "^0.8.32",
"@types/read-pkg": "^3.0.0",
"@types/semver": "^5.5.0",
"chai": "^4.2.0",
"chromedriver": "^2.46.0",
Expand All @@ -69,7 +68,7 @@
"dependencies": {
"mustache": "^3.0.1",
"node-zip": "^1.1.1",
"read-pkg": "^5.0.0",
"read-pkg": "^5.1.0",
"semver": "^5.6.0",
"tiny-types": "^1.12.0",
"upath": "^1.1.2"
Expand Down
3 changes: 2 additions & 1 deletion spec/Authenticator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'mocha';
import { expect } from 'chai';
import { given } from 'mocha-testdata';
import path = require('path');
import readPkg = require('read-pkg');
const Zip = require('node-zip'); // tslint:disable-line:no-var-requires no type definitions available
import { Authenticator } from '../src';
Expand All @@ -15,7 +16,7 @@ describe('Authenticator', () => {
const zip = new Zip(data, {base64: true, checkCRC32: true});

// manifest
const pkg = readPkg.sync('../package.json');
const pkg = readPkg.sync({ cwd: path.resolve(__dirname, '..') });
const manifest = JSON.parse(zip.files['manifest.json']._data);

expect(manifest.description).to.deep.equal(pkg.description);
Expand Down
4 changes: 2 additions & 2 deletions src/Authenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export class Authenticator {
private extension(): NodeZip {
const zip: NodeZip = new Zip();

const { name, description, version } = readPkg.sync(path.resolve(__dirname, '../package.json'));
const { name, description, version } = readPkg.sync({ cwd: path.resolve(__dirname, '..') });

zip.file('manifest.json', Mustache.render(
contentsOf('../extension/manifest.mustache.json'), {
name,
description,
permissions: this.permissions.map(permission => `"${ permission }"`).join(', '),
version: (coerce(version) as SemVer).version,
version: (coerce(version as string) as SemVer).version,
},
));

Expand Down

0 comments on commit 6db82a0

Please sign in to comment.