Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"auto": "^9.40.5",
"babel-eslint": "^10.0.2",
"eslint": "^6.1.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.0",
"lerna": "4.0.0",
"prettier": "^2.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/bin/resolve-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const exists = require('path-exists');
const fs = require('fs-extra');
const path = require('path');
const error = require('./utils').error;
const readJsonAsync = require('./utils').readJsonAsync;
Expand All @@ -19,7 +19,7 @@ function resolveConfig(configPath) {
);
return false;
}
if (!exists.sync(configPath)) {
if (!fs.existsSync(configPath)) {
error(`resolveConfig: configPath ${configPath} does not exists`);
return false;
}
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
},
"dependencies": {
"@pattern-lab/core": "^5.15.5",
"@pattern-lab/live-server": "^5.15.5",
"archiver": "2.1.1",
"chalk": "4.1.0",
"commander": "2.15.1",
Expand All @@ -21,9 +20,7 @@
"has-yarn": "1.0.0",
"inquirer": "5.1.0",
"lodash": "4.17.21",
"ora": "2.1.0",
"path-exists": "3.0.0",
"sanitize-filename": "1.6.3"
"ora": "2.1.0"
},
"devDependencies": {
"@pattern-lab/starterkit-mustache-base": "3.0.3",
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/test/cli-build.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const exists = require('path-exists');
const fs = require('fs-extra');
const getUniqueProjectPath = require('./utils/getUniqueProjectPath');
const path = require('path');
const spawnCmd = require('./utils/spawnCmd');
Expand All @@ -25,23 +25,23 @@ tap.test('Init and build ->', (t) =>
`${projectRoot}/patternlab-config.json`,
]);
t.ok(
exists.sync(path.resolve(projectRoot, 'public')),
fs.existsSync(path.resolve(projectRoot, 'public')),
'should build all files into public dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'annotations')),
fs.existsSync(path.resolve(projectRoot, 'public', 'annotations')),
'with an annotations dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'css')),
fs.existsSync(path.resolve(projectRoot, 'public', 'css')),
'with a css dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'images')),
fs.existsSync(path.resolve(projectRoot, 'public', 'images')),
'with a images dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'public', 'styleguide')),
fs.existsSync(path.resolve(projectRoot, 'public', 'styleguide')),
'with a styleguide dir'
);
t.end();
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/test/cli-export.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const exists = require('path-exists');
const fs = require('fs-extra');
const getUniqueProjectPath = require('./utils/getUniqueProjectPath');
const path = require('path');
const spawnCmd = require('./utils/spawnCmd');
Expand All @@ -25,7 +25,9 @@ tap.test('Init and export ->', (t) =>
`${projectRoot}/patternlab-config.json`,
]);
t.ok(
exists.sync(path.resolve(projectRoot, 'pattern_exports', 'patterns.zip')),
fs.existsSync(
path.resolve(projectRoot, 'pattern_exports', 'patterns.zip')
),
' should create patterns.zip'
);
t.end();
Expand Down
18 changes: 12 additions & 6 deletions packages/cli/test/cli-init.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const exists = require('path-exists');
const fs = require('fs-extra');
const getUniqueProjectPath = require('./utils/getUniqueProjectPath');
const path = require('path');
const spawnCmd = require('./utils/spawnCmd');
Expand All @@ -20,17 +20,23 @@ tap.test('Init ->', (t) =>
'@pattern-lab/starterkit-mustache-base',
]);
t.ok(
exists.sync(path.resolve(projectRoot)),
fs.existsSync(path.resolve(projectRoot)),
'should initialize a Pattern Lab project'
);
t.ok(exists.sync(path.resolve(projectRoot, 'source')), 'with a source dir');
t.ok(exists.sync(path.resolve(projectRoot, 'public')), 'with a public dir');
t.ok(
exists.sync(path.resolve(projectRoot, 'pattern_exports')),
fs.existsSync(path.resolve(projectRoot, 'source')),
'with a source dir'
);
t.ok(
fs.existsSync(path.resolve(projectRoot, 'public')),
'with a public dir'
);
t.ok(
fs.existsSync(path.resolve(projectRoot, 'pattern_exports')),
'with a pattern_exports dir'
);
t.ok(
exists.sync(path.resolve(projectRoot, 'patternlab-config.json')),
fs.existsSync(path.resolve(projectRoot, 'patternlab-config.json')),
'with a pattern_exports dir'
);
t.end();
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/test/scaffold.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const tap = require('tap');
const path = require('path');
const exists = require('path-exists');
const fs = require('fs-extra');
const scaffold = require('../bin/scaffold');
const getUniqueProjectPath = require('./utils/getUniqueProjectPath');
const wrapAsync = require('../bin/utils').wrapAsync;
Expand All @@ -13,17 +13,17 @@ const exportDir = 'patterns_export';
tap.test('Scaffold ->', (t) =>
wrapAsync(function* () {
yield scaffold(projectDir, sourceDir, publicDir, exportDir);
t.ok(exists.sync(path.resolve(projectDir)), 'should create project dir');
t.ok(fs.existsSync(path.resolve(projectDir)), 'should create project dir');
t.ok(
exists.sync(path.resolve(projectDir, sourceDir)),
fs.existsSync(path.resolve(projectDir, sourceDir)),
'should create source dir'
);
t.ok(
exists.sync(path.resolve(projectDir, publicDir)),
fs.existsSync(path.resolve(projectDir, publicDir)),
'should create public dir'
);
t.ok(
exists.sync(path.resolve(projectDir, exportDir)),
fs.existsSync(path.resolve(projectDir, exportDir)),
'should create export dir'
);
t.end();
Expand Down
2 changes: 0 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
"@babel/plugin-syntax-jsx": "^7.12.13",
"babel-eslint": "^10.0.2",
"eslint": "^6.1.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.0",
"jsdoc-to-markdown": "5.0.1",
"prettier": "^2.2.1",
Expand Down
Loading