Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docworks-wix-media

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docworks-wix-media - npm Package Compare versions

Comparing version 1.6.4 to 1.8.4

.eslintrc.json

18

package.json
{
"name": "docworks-wix-media",
"version": "1.6.4",
"version": "1.8.4",
"description": "",
"main": "dist/index.js",
"main": "src/index.js",
"scripts": {
"build": "babel src --out-dir dist",
"prepublish": "babel src --out-dir dist",
"test": "mocha --compilers js:babel-core/register --require babel-polyfill ./test/**/*.spec.js"
"lint": "echo \"--- running lint ---\" && eslint src test",
"build": "npm run lint",
"prepublish": "npm run build",
"test": "mocha ./test/**/*.spec.js --compilers js:babel-core/register --require babel-polyfill"
},

@@ -15,2 +16,3 @@ "author": "Yoav Abrahami",

"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-polyfill": "^6.24.1",

@@ -22,9 +24,11 @@ "babel-preset-es2015": "^6.24.1",

"chai-subset": "^1.5.0",
"docworks-jsdoc2spec": "^1.6.4",
"eslint": "^6.0.1",
"mocha": "^3.3.0"
},
"dependencies": {
"docworks-jsdoc2spec": "^1.8.4",
"fs-extra": "^7.0.0",
"tmp-promise": "^1.0.5"
}
},
"gitHead": "af20090fc0d9b22e9b504b26e3b2f025ddb05af9"
}

@@ -0,23 +1,28 @@

// eslint-disable-next-line no-unused-vars
let logger = console
const {copy, ensureDir} = require('fs-extra')
let path = require('path');
let fs = require('fs');
let logger = console;
import {copy, ensureDir} from 'fs-extra';
exports.setMediaDir = function(value) {
const setMediaDir = function(value) {
// jsdoc with requizzle loads the modules twice - so the only way to move config between the two runs is using global
global.wixJsDocPluginMediaDir = value;
};
global.wixJsDocPluginMediaDir = value
}
exports.setLogger = function(value) {
logger = value;
};
const setLogger = function(value) {
logger = value
}
exports.init = function(param) {
exports.setMediaDir(param);
};
const init = function(param) {
setMediaDir(param)
}
export async function ecpAfterMerge(workingDir, projectSubdir) {
await ensureDir(`${workingDir}/media`);
return copy(global.wixJsDocPluginMediaDir, `${workingDir}/media`);
}
async function ecpAfterMerge(workingDir) {
await ensureDir(`${workingDir}/media`)
return copy(global.wixJsDocPluginMediaDir, `${workingDir}/media`)
}
module.exports = {
ecpAfterMerge,
init,
setLogger,
setMediaDir
}

@@ -1,15 +0,14 @@

require("babel-polyfill")
import chai from 'chai';
import chaiSubset from 'chai-subset';
import tmp from 'tmp-promise';
import {pathExists} from 'fs-extra';
const expect = chai.expect;
chai.use(chaiSubset);
import chai from 'chai'
import chaiSubset from 'chai-subset'
import tmp from 'tmp-promise'
import {pathExists} from 'fs-extra'
const expect = chai.expect
chai.use(chaiSubset)
import {setMediaDir, setLogger, ecpAfterMerge} from '../src/index';
import {setMediaDir, setLogger, ecpAfterMerge} from '../src/index'
let log = [];
let log = []
const logger = {
error: (_) => log.push(_),
};
}

@@ -20,25 +19,26 @@

beforeEach(async () => {
setMediaDir('./test/project');
setLogger(logger);
log = [];
});
setMediaDir('./test/project')
setLogger(logger)
log = []
})
it('should copy all files from the project dir to the working dir / media directory', async function() {
const tempDir = await tmp.dir();
const workingDir = tempDir.path;
const tempDir = await tmp.dir()
const workingDir = tempDir.path
await ecpAfterMerge(workingDir);
await ecpAfterMerge(workingDir)
const group10Exists = await pathExists(`${workingDir}/media/group-10@3x.png`);
const menuButtonExists = await pathExists(`${workingDir}/media/menu-button.png`);
const minusExists = await pathExists(`${workingDir}/media/minus@3x.png`);
const plusExists = await pathExists(`${workingDir}/media/plus@3x.png`);
const group10Exists = await pathExists(`${workingDir}/media/group-10@3x.png`)
const menuButtonExists = await pathExists(`${workingDir}/media/menu-button.png`)
const minusExists = await pathExists(`${workingDir}/media/minus@3x.png`)
const plusExists = await pathExists(`${workingDir}/media/plus@3x.png`)
expect(group10Exists).to.be.true;
expect(menuButtonExists).to.be.true;
expect(minusExists).to.be.true;
expect(plusExists).to.be.true;
expect(group10Exists).to.be.true
expect(menuButtonExists).to.be.true
expect(minusExists).to.be.true
expect(plusExists).to.be.true
// eslint-disable-next-line no-console
console.log(workingDir)
});
});
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc