Skip to content
This repository has been archived by the owner on Jun 23, 2019. It is now read-only.

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Nov 16, 2016
1 parent e6853d8 commit 5727f0d
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 68 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
Change History
==============

v0.0.17
----
* Update dependencies

v0.0.16
-------
* use `componentNameProcessor()` also for the examples
Expand Down
18 changes: 9 additions & 9 deletions index.js
Expand Up @@ -36,7 +36,7 @@ class NitroFrontifyDeployer {
this.nitroComponentResolver = config.nitroComponentResolver || new NitroComponentResolver({
rootDirectory: config.rootDirectory,
examples: true,
watch: false
watch: false,
});
this.options = {};
// The temporary directory where the html files should be build into
Expand Down Expand Up @@ -93,12 +93,12 @@ class NitroFrontifyDeployer {
.then(() => this.buildComponents())
.then(() => Promise.all([
this._syncAssets(),
this._syncComponents()
this._syncComponents(),
]))
.then((syncResults) => (
{
assets: syncResults[0],
components: syncResults[1]
components: syncResults[1],
}));
}

Expand Down Expand Up @@ -139,9 +139,9 @@ class NitroFrontifyDeployer {
name: `${componentName} -- ${name}`,
assets: {
html: [
examplePath.replace(/\\/g, '/')
]
}
examplePath.replace(/\\/g, '/'),
],
},
};
}

Expand Down Expand Up @@ -202,7 +202,7 @@ class NitroFrontifyDeployer {
fsReadFile(templateSrc).then((src) => {
let compiled;
try {
compiled = this.options.compiler(src.toString());
compiled = this.options.compiler(src.toString(), path.resolve(templateSrc));
// Execute template
/* istanbul ignore else */
if (typeof compiled === 'function') {
Expand Down Expand Up @@ -268,7 +268,7 @@ class NitroFrontifyDeployer {
assert(typeof this.options.frontifyOptions === 'object', 'Please specifiy the frontify options');
assert(this.options.frontifyOptions.access_token, 'Please specify a frontify token');
return frontifyApi.syncPatterns(_.extend({
cwd: this.options.targetDir
cwd: this.options.targetDir,
}, this.options.frontifyOptions), ['*/*/pattern.json']);
}

Expand All @@ -283,7 +283,7 @@ class NitroFrontifyDeployer {
return Promise.resolve([]);
}
return frontifyApi.syncAssets(_.extend({
cwd: this.options.assetFolder
cwd: this.options.assetFolder,
}, this.options.frontifyOptions), this.options.assetFilter);
}

Expand Down
22 changes: 11 additions & 11 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@namics/nitro-frontify-deployer",
"version": "0.0.16",
"version": "0.0.17",
"description": "A helper to deploy all nitro components to frontify",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -30,23 +30,23 @@
"homepage": "https://github.com/namics/nitro-frontify-deployer#readme",
"dependencies": {
"@frontify/frontify-api": "^0.3.1",
"@namics/nitro-component-resolver": "~0.0.7",
"@namics/nitro-component-validator": "^0.0.3",
"@namics/nitro-component-resolver": "~0.0.8",
"@namics/nitro-component-validator": "^0.0.5",
"denodeify": "^1.2.1",
"html": "1.0.0",
"lodash": "^4.15.0",
"lodash": "^4.17.2",
"mkdirp": "^0.5.1",
"rimraf": "^2.5.4"
},
"devDependencies": {
"@namics/eslint-config": "^1.0.0",
"@namics/eslint-config": "^2.0.0",
"ava": "^0.16.0",
"babel-eslint": "^6.1.2",
"coveralls": "^2.11.12",
"eslint": "^3.5.0",
"eslint-plugin-import": "^1.15.0",
"nyc": "^8.1.0",
"babel-eslint": "^7.1.0",
"coveralls": "^2.11.15",
"eslint": "^3.10.2",
"eslint-plugin-import": "^2.2.0",
"nyc": "^9.0.1",
"ncp": "^2.0.0",
"npm-run-all": "^3.1.0"
"npm-run-all": "^3.1.1"
}
}
96 changes: 48 additions & 48 deletions test/test.js
Expand Up @@ -34,7 +34,7 @@ const createTestEnvironment = async(environment = 'valid') => {
await copy(path.join(fixtures, environment), targetDir);
return {
componentDir,
tmpDir
tmpDir,
};
};

Expand All @@ -43,10 +43,10 @@ test('should verify that all files are valid', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
t.is(await deployer.validateComponents(), true);
t.pass();
Expand All @@ -57,10 +57,10 @@ test('should throw if a component is not valid', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const err = await getErrorMessage(async() => {
await deployer.validateComponents();
Expand All @@ -76,10 +76,10 @@ test('should throw no component exists', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const err = await getErrorMessage(async() => {
await deployer.validateComponents();
Expand All @@ -95,7 +95,7 @@ test('should throw if the component type is not in the mapping', async t => {
rootDirectory: componentDir,
mapping: {},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const err = await getErrorMessage(async() => {
await deployer.validateComponents();
Expand All @@ -110,10 +110,10 @@ test('should generate the transferdata for a component', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const buttonComponent = await deployer.nitroComponentResolver.getComponent('atoms/button');
const transferData = await deployer._generateComponentTransferData(buttonComponent);
Expand All @@ -126,11 +126,11 @@ test('should generate the transferdata for a component', async t => {
name: 'button -- example',
assets: {
html: [
'atoms/button/example.html'
]
}
}
}
'atoms/button/example.html',
],
},
},
},
};
t.deepEqual(transferData, expected);
t.pass();
Expand All @@ -141,10 +141,10 @@ test('should generate the transferdata for another component', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const radioComponent = await deployer.nitroComponentResolver.getComponent('atoms/radio');
const transferData = await deployer._generateComponentTransferData(radioComponent);
Expand All @@ -157,19 +157,19 @@ test('should generate the transferdata for another component', async t => {
name: 'radio -- desktop',
assets: {
html: [
'atoms/radio/desktop.html'
]
}
'atoms/radio/desktop.html',
],
},
},
'_example/mobile.hbs': {
name: 'radio -- mobile',
assets: {
html: [
'atoms/radio/mobile.html'
]
}
}
}
'atoms/radio/mobile.html',
],
},
},
},
};
t.deepEqual(transferData, expected);
t.pass();
Expand All @@ -180,13 +180,13 @@ test('should allow to process the component name', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
componentNameProcessor: (name, componentName, componentType, componentPath) => {
return `${name} - ${componentName} - ${componentType} - ${componentPath}`;
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const buttonComponent = await deployer.nitroComponentResolver.getComponent('atoms/button');
const transferData = await deployer._generateComponentTransferData(buttonComponent);
Expand All @@ -202,10 +202,10 @@ test('should compile a components examples', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const buttonComponent = await deployer.nitroComponentResolver.getComponent('atoms/button');
await deployer._buildComponent(buttonComponent);
Expand All @@ -219,10 +219,10 @@ test('should compile a components examples', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
await deployer.buildComponents();
const renderedTemplate = await readFile(path.join(tmpDir, 'atoms', 'button', 'example.html'));
Expand All @@ -235,10 +235,10 @@ test('should prettify a components examples', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
await deployer.buildComponents();
const renderedTemplate = await readFile(path.join(tmpDir, 'atoms', 'radio', 'desktop.html'));
Expand All @@ -251,10 +251,10 @@ test('should add the template name to the template error message', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: () => { throw new Error('Compile error'); },
targetDir: tmpDir
targetDir: tmpDir,
});
const errorMessage = await getErrorMessage(() => deployer.buildComponents());
const renderedTemplate = path.join(componentDir, 'atoms', 'button', '_example', 'example.hbs');
Expand All @@ -267,10 +267,10 @@ test('should generate a components pattern.json', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const buttonComponent = await deployer.nitroComponentResolver.getComponent('atoms/button');
await deployer._buildComponent(buttonComponent);
Expand All @@ -286,16 +286,16 @@ test('should deploy without any error', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir,
frontifyOptions: {
[act]: '3a8027e1809854d38d9703ba1af3ca77b2db7da7',
project: 92545,
baseUrl: 'https://app.frontify.com/',
dryRun: true
}
dryRun: true,
},
});

const deployResult = await deployer.deploy();
Expand All @@ -310,15 +310,15 @@ test('should deploy without any error using process env tokens', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir,
frontifyOptions: {
project: 92545,
baseUrl: 'https://app.frontify.com/',
dryRun: true
}
dryRun: true,
},
});

const deployResult = await deployer.deploy();
Expand All @@ -332,7 +332,7 @@ test('should deploy assets without any error', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
assetFolder: path.join(__dirname, 'fixtures'),
assetFilter: ['**/*.js', '**/*.css'],
Expand All @@ -342,8 +342,8 @@ test('should deploy assets without any error', async t => {
[act]: '3a8027e1809854d38d9703ba1af3ca77b2db7da7',
project: 92545,
baseUrl: 'https://app.frontify.com/',
dryRun: true
}
dryRun: true,
},
});

const deployResult = await deployer.deploy();
Expand All @@ -357,10 +357,10 @@ test('should clean the target folder', async t => {
const deployer = new NitroFrontifyDeployer({
rootDirectory: componentDir,
mapping: {
atoms: 'atom'
atoms: 'atom',
},
compiler: compilerMock,
targetDir: tmpDir
targetDir: tmpDir,
});
const htmlFile = path.join(tmpDir, 'atoms', 'button', 'example.html');
await deployer.buildComponents();
Expand Down

0 comments on commit 5727f0d

Please sign in to comment.