Skip to content

Commit

Permalink
chore(deps): update dependency readdirp to ^3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 15, 2024
1 parent 6587b99 commit 97c4d54
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ coverage/
tmp/
npm-debug.log*
.DS_Store
.nyc_output
package-lock.json
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ function copyTemplateDir (srcDir, outDir, vars, cb) {
// create directory
mkdirp(outDir, function (err) {
if (err) return cb(err)

const rs = readdirp({ root: srcDir })
const rs = readdirp(srcDir, {})
const streams = []
const createdFiles = []

Expand All @@ -57,9 +56,9 @@ function writeFile (outDir, vars, file) {
return function (done) {
const fileName = file.path
const inFile = file.fullPath
const parentDir = file.parentDir
const parentDir = path.basename(file.dirent.path)
const outFile = path.join(outDir, maxstache(removeUnderscore(fileName), vars))

mkdirp(path.join(outDir, maxstache(parentDir, vars)), function (err) {
if (err) return done(err)

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "copy-template-dir",
"name": "@tsbb/copy-template-dir",
"version": "1.4.0",
"description": "High throughput template dir writes",
"main": "index.js",
"scripts": {
"deps": "dependency-check . && dependency-check . --extra --no-dev",
"test": "standard && npm run deps && NODE_ENV=test node test",
"test:cov": "standard && npm run deps && NODE_ENV=test istanbul cover test/index.js"
"test": "npm run deps && NODE_ENV=test node test",
"test:cov": "npm run deps && NODE_ENV=test nyc tape test/index.js && nyc report --reporter=lcov"
},
"repository": "yoshuawuyts/copy-template-dir",
"repository": "tsbbjs/copy-template-dir",
"keywords": [
"template",
"directory",
Expand All @@ -25,15 +25,15 @@
"mkdirp": "^0.5.1",
"noop2": "^2.0.0",
"pump": "^1.0.0",
"readdirp": "^2.0.0",
"run-parallel": "^1.1.4"
"readdirp": "^3.6.0",
"run-parallel": "^1.2.0"
},
"devDependencies": {
"concat-stream": "^1.5.0",
"dependency-check": "^2.5.1",
"istanbul": "^0.3.21",
"istanbul": "^0.4.5",
"nyc": "^17.0.0",
"rimraf": "^2.4.3",
"standard": "^5.3.1",
"tape": "^4.2.0"
},
"files": [
Expand Down
10 changes: 5 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('should write a bunch of files', function (t) {
return path.relative(outDir, filePath)
}), 'reported as created')

readdirp({ root: outDir }).pipe(concat({ object: true }, function (arr) {
readdirp(outDir, { }).pipe(concat({ object: true }, function (arr) {
t.ok(Array.isArray(arr), 'is array')

const names = arr.map(function (file) { return file.path })
Expand All @@ -61,7 +61,7 @@ test('should inject context variables strings', function (t) {
copy(inDir, outDir, { foo: 'bar' }, function (err) {
t.error(err)

readdirp({ root: outDir }).pipe(concat({ object: true }, function (arr) {
readdirp(outDir, { }).pipe(concat({ object: true }, function (arr) {
t.ok(Array.isArray(arr), 'is array')

const file = path.join(outDir, '1.txt')
Expand All @@ -86,8 +86,8 @@ test('should inject context variables strings into filenames', function (t) {
const outDir = path.join(__dirname, '../tmp')
copy(inDir, outDir, { foo: 'bar' }, function (err) {
t.error(err)

readdirp({ root: outDir }).pipe(concat({ object: true }, function (arr) {
readdirp(outDir, { }).pipe(concat({ object: true }, function (arr) {
t.ok(Array.isArray(arr), 'is array')

const file = path.join(outDir, 'bar.txt')
Expand All @@ -110,7 +110,7 @@ test('should inject context variables strings into directory names', function (t
copy(inDir, outDir, { foo: 'bar' }, function (err) {
t.error(err)

readdirp({ root: outDir }).pipe(concat({ object: true }, function (arr) {
readdirp(outDir, {}).pipe(concat({ object: true }, function (arr) {
t.ok(Array.isArray(arr), 'is array')

const dir = path.join(outDir, 'bar')
Expand Down

0 comments on commit 97c4d54

Please sign in to comment.