Skip to content

Commit bda997b

Browse files
authored
Merge pull request #36 from balassy/fix/fs-p-deprecated
Replace the deprecated fs-p package with fs-extra
2 parents 3cf2cc2 + 3fc55e5 commit bda997b

File tree

5 files changed

+20
-25
lines changed

5 files changed

+20
-25
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"tslint": "^5.1.0"
3636
},
3737
"dependencies": {
38-
"fs-p": "2.0.0",
38+
"fs-extra": "^4.0.2",
3939
"globby": "^6.1.0",
4040
"lodash": "^4.17.4",
4141
"typescript": "^2.2.2"

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path'
2-
import * as fs from 'fs-p'
2+
import * as fs from 'fs-extra'
33

44
import * as _ from 'lodash'
55
import * as globby from 'globby'

src/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as ts from 'typescript'
2-
import * as fs from 'fs-p'
2+
import * as fs from 'fs-extra'
33
import * as _ from 'lodash'
44
import { ServerlessFunction } from './types'
55
import * as path from 'path'

src/watchFiles.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export function watchFiles(
99
cb: () => void
1010
) {
1111
const tsConfig = typescript.getTypescriptConfig(originalServicePath)
12-
let watchFiles = typescript.getSourceFiles(rootFileNames, tsConfig)
12+
let watchedFiles = typescript.getSourceFiles(rootFileNames, tsConfig)
1313

14-
watchFiles.forEach(fileName => {
14+
watchedFiles.forEach(fileName => {
1515
watchFile(fileName, { persistent: true, interval: 250 }, watchCallback)
1616
})
1717

@@ -25,18 +25,18 @@ export function watchFiles(
2525

2626
// use can reference not watched yet file or remove reference to already watched
2727
const newWatchFiles = typescript.getSourceFiles(rootFileNames, tsConfig)
28-
watchFiles.forEach(fileName => {
28+
watchedFiles.forEach(fileName => {
2929
if (newWatchFiles.indexOf(fileName) < 0) {
3030
unwatchFile(fileName, watchCallback)
3131
}
3232
})
3333

3434
newWatchFiles.forEach(fileName => {
35-
if (watchFiles.indexOf(fileName) < 0) {
35+
if (watchedFiles.indexOf(fileName) < 0) {
3636
watchFile(fileName, { persistent: true, interval: 250 }, watchCallback)
3737
}
3838
})
3939

40-
watchFiles = newWatchFiles
40+
watchedFiles = newWatchFiles
4141
}
4242
}

yarn.lock

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -735,13 +735,6 @@ form-data@~2.1.1:
735735
combined-stream "^1.0.5"
736736
mime-types "^2.1.12"
737737

738-
fs-extra@^2.0.0:
739-
version "2.1.2"
740-
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35"
741-
dependencies:
742-
graceful-fs "^4.1.2"
743-
jsonfile "^2.1.0"
744-
745738
fs-extra@^3.0.0:
746739
version "3.0.1"
747740
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291"
@@ -750,11 +743,13 @@ fs-extra@^3.0.0:
750743
jsonfile "^3.0.0"
751744
universalify "^0.1.0"
752745

753-
fs-p@2.0.0:
754-
version "2.0.0"
755-
resolved "https://registry.yarnpkg.com/fs-p/-/fs-p-2.0.0.tgz#66784a012473c700b68fb76ac2120eccc6b0602b"
746+
fs-extra@^4.0.2:
747+
version "4.0.2"
748+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.2.tgz#f91704c53d1b461f893452b0c307d9997647ab6b"
756749
dependencies:
757-
fs-extra "^2.0.0"
750+
graceful-fs "^4.1.2"
751+
jsonfile "^4.0.0"
752+
universalify "^0.1.0"
758753

759754
fs.realpath@^1.0.0:
760755
version "1.0.0"
@@ -1372,18 +1367,18 @@ json5@^0.5.0:
13721367
version "0.5.1"
13731368
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
13741369

1375-
jsonfile@^2.1.0:
1376-
version "2.4.0"
1377-
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
1378-
optionalDependencies:
1379-
graceful-fs "^4.1.6"
1380-
13811370
jsonfile@^3.0.0:
13821371
version "3.0.0"
13831372
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0"
13841373
optionalDependencies:
13851374
graceful-fs "^4.1.6"
13861375

1376+
jsonfile@^4.0.0:
1377+
version "4.0.0"
1378+
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
1379+
optionalDependencies:
1380+
graceful-fs "^4.1.6"
1381+
13871382
jsonify@~0.0.0:
13881383
version "0.0.0"
13891384
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"

0 commit comments

Comments
 (0)