Skip to content

Commit

Permalink
Merge pull request #57 from joliss/actions
Browse files Browse the repository at this point in the history
move to GH actions
  • Loading branch information
stefanpenner authored Jun 11, 2021
2 parents bb2efca + 5e645b3 commit 7f0dddb
Show file tree
Hide file tree
Showing 11 changed files with 1,994 additions and 2,146 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches:
- master
- 'v*' # older version branches
tags:
- '*'
pull_request: {}
schedule:
- cron: '0 6 * * 0' # weekly, on sundays

jobs:
test:
name: Tests
runs-on: "${{ matrix.os }}-latest"

strategy:
matrix:
node: ['10', '12', '14', '16']
os: [ubuntu, macOS]

steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
with:
node-version: ${{ matrix.node }}
- name: install dependencies
run: yarn
- name: test
run: yarn test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ test/fixtures/contains-cycle/is-cycle
.vscode/
**/*.js
**/*.d.ts
!test/fixtures
.nyc_output/
!test/fixture
index.js.map
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# node-walk-sync

[![Build Status](https://travis-ci.org/joliss/node-walk-sync.png?branch=master)](https://travis-ci.org/joliss/node-walk-sync)
[![Build status](https://ci.appveyor.com/api/projects/status/sqe785gqb2qfmxbx/branch/master?svg=true)](https://ci.appveyor.com/project/joliss/node-walk-sync/branch/master)
# node-walk-sync ![CI](https://github.com/joliss/node-walk-sync/workflows/CI/badge.svg)

Return an array containing all recursive files and directories under a given
directory, similar to Unix `find`. Follows symlinks. Bare-bones, but
Expand Down Expand Up @@ -100,17 +97,17 @@ entry.isDirectory() // => true if directory
```

* `fs`: Allows an alternative implementation of [fs](https://nodejs.org/api/fs.html) to be supplied.
*examples of alternative filesystems include [memfs](https://github.com/streamich/memfs) or [graceful-fs](https://github.com/isaacs/node-graceful-fs#readme)*
*examples of alternative file systems include [memfs](https://github.com/streamich/memfs) or [graceful-fs](https://github.com/isaacs/node-graceful-fs#readme)*

```js
import {Volume, createFsFromVolume} from 'memfs'
const fs = createFsFromVolume(Volume.fromJSON({'aDir/aFile': 'some-contents'}))
const paths = walkSync('project', { fs });
// => ['aDir/', 'aDir/aFile']
```
* `globOptions`: Pass any options for [Minimatch](https://www.npmjs.com/package/minimatch) that will be applied to all items in `globs` and `ignore` that are strings.

* `globOptions`: Pass any options for [Minimatch](https://www.npmjs.com/package/minimatch) that will be applied to all items in `globs` and `ignore` that are strings.

If items in `globs` or `ignore` are instances of `minimatch.Minimatch`, the `globOptions` will not be applied.

## Background
Expand All @@ -124,4 +121,3 @@ glob.sync('**', {
mark: true,
strict: true
})
```
31 changes: 0 additions & 31 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getStat(path: string, fs: walkSync.Options['fs'] = fsNode) {
try {
return fs.statSync(path);
} catch(error) {
if (error !== null && typeof error === 'object' && (error.code === 'ENOENT' || error.code === 'ENOTDIR')) {
if (error !== null && typeof error === 'object' && (error.code === 'ENOENT' || error.code === 'ENOTDIR' || error.code === 'EPERM')) {
return;
}
throw error;
Expand Down
27 changes: 16 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,41 @@
"types": "index.d.ts",
"license": "MIT",
"engines": {
"node": "8.* || >= 10.*"
"node": "10.* || >= 12.*"
},
"repository": {
"type": "git",
"url": "https://github.com/joliss/node-walk-sync"
},
"files": [
"index.js",
"index.d.ts"
"index.d.ts",
"index.js.map"
],
"dependencies": {
"@types/minimatch": "^3.0.3",
"ensure-posix-path": "^1.1.0",
"matcher-collection": "^2.0.0",
"matcher-collection": "^2.0.1",
"minimatch": "^3.0.4"
},
"devDependencies": {
"@types/jest": "^24.0.15",
"@types/node": "^12.0.10",
"glob": "^7.1.4",
"jest": "^24.8.0",
"memfs": "^3.1.2",
"rimraf": "^2.4.3",
"ts-jest": "^24.0.2",
"typescript": "~3.8.3"
"@types/jest": "^26.0.0",
"@types/node": "^14.0.13",
"glob": "^7.1.6",
"jest": "^26.1.0",
"memfs": "^3.2.0",
"rimraf": "^3.0.2",
"ts-jest": "^26.1.1",
"typescript": "~3.9.5"
},
"scripts": {
"prepare": "tsc -b .",
"build": "tsc -b .",
"clean": "tsc -b --clean .",
"test": "jest ."
},
"volta": {
"node": "10.21.0",
"yarn": "1.22.4"
}
}
1 change: 1 addition & 0 deletions test/test.js.map

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

1 change: 0 additions & 1 deletion test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function safeUnlink(path:string) {

symlink('./some-other-dir', 'test/fixtures/symlink1');
symlink('doesnotexist', 'test/fixtures/symlink2', true);
symlink('doesnotexist', 'test/fixtures/symlink2', true);

safeUnlink(__dirname + '/fixtures/bar');
safeUnlink(__dirname + '/fixtures/symlink3');
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"strict": true,
"moduleResolution": "node",
"module": "commonjs",
"target": "es2017"
"target": "es2017",
"sourceMap": true,
"strict": true
},
"exclude": ["index.d.ts"],
"include": ["index.ts", "test/test.ts"]
Expand Down
Loading

0 comments on commit 7f0dddb

Please sign in to comment.