imdone-core 2.0.13 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,11 +20,10 @@ import _ignore from 'ignore'
|
|
|
20
20
|
import { sort } from 'fast-sort'
|
|
21
21
|
import { buildMigrateConfig } from '../migrate-config.js'
|
|
22
22
|
import { loadYAML, dumpYAML } from '../adapters/yaml.js';
|
|
23
|
-
import realFs
|
|
23
|
+
import realFs from 'fs'
|
|
24
24
|
import { preparePathForWriting, readFile, writeFile, stat, lstat, unlink } from '../adapters/file-gateway.js'
|
|
25
25
|
|
|
26
26
|
const {
|
|
27
|
-
CONFIG_FILE,
|
|
28
27
|
CONFIG_FILE_YML,
|
|
29
28
|
ASYNC_LIMIT,
|
|
30
29
|
DEFAULT_IGNORE_PATHS,
|
|
@@ -198,11 +197,6 @@ export function fileSystemStoreMixin(repo, fs = realFs) {
|
|
|
198
197
|
return repo.config
|
|
199
198
|
}
|
|
200
199
|
|
|
201
|
-
// READY Refactor loadConfig to use async/await
|
|
202
|
-
// #esm-migration
|
|
203
|
-
// <!--
|
|
204
|
-
// order:-255
|
|
205
|
-
// -->
|
|
206
200
|
repo.loadConfig = async function (cb) {
|
|
207
201
|
// BACKLOG If a config is bad move it to config.json.bak and save a new one with defaults gh:2 id:9 +enhancement +standup +chore
|
|
208
202
|
// <!--
|
|
@@ -217,7 +211,7 @@ export function fileSystemStoreMixin(repo, fs = realFs) {
|
|
|
217
211
|
}
|
|
218
212
|
|
|
219
213
|
repo.getConfigFile = function () {
|
|
220
|
-
return repo.getFullPath(
|
|
214
|
+
return repo.getFullPath(CONFIG_FILE_YML)
|
|
221
215
|
}
|
|
222
216
|
|
|
223
217
|
repo.getYamlConfig = async function () {
|
|
@@ -151,8 +151,11 @@ export function watchedFileSystemStoreMixin(repo, fs = realFs) {
|
|
|
151
151
|
atomic: true,
|
|
152
152
|
ignoreInitial: true,
|
|
153
153
|
ignored: (file) => {
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
if (file === repo.path) return false
|
|
155
|
+
const relPath = repo.getRelativePath(file)
|
|
156
|
+
const ignored = !repo.shouldInclude(relPath)
|
|
157
|
+
if (ignored) logger.log('Ignoring file:', relPath)
|
|
158
|
+
|
|
156
159
|
return ignored
|
|
157
160
|
}
|
|
158
161
|
}).on('error', (err) => {
|
|
@@ -196,6 +199,11 @@ export function watchedFileSystemStoreMixin(repo, fs = realFs) {
|
|
|
196
199
|
stat.mtime
|
|
197
200
|
)
|
|
198
201
|
if (!path || stat.isDirectory()) return
|
|
202
|
+
|
|
203
|
+
const relPath = repo.getRelativePath(path)
|
|
204
|
+
if (!initializing && _isImdoneConfig(relPath)) onConfigChange(relPath)
|
|
205
|
+
if (!initializing && _isImdoneIgnore(relPath)) onIgnoreChange(relPath)
|
|
206
|
+
|
|
199
207
|
var file = repo.getFile(path) || path
|
|
200
208
|
const isFile = File.isFile(file)
|
|
201
209
|
// BACKLOG ## Handle the case where the file is not in the repo
|
|
@@ -207,8 +215,6 @@ export function watchedFileSystemStoreMixin(repo, fs = realFs) {
|
|
|
207
215
|
// logger.log("File update already applied. Change ignored.")
|
|
208
216
|
return
|
|
209
217
|
}
|
|
210
|
-
if (_isImdoneConfig(path)) return onConfigChange(path)
|
|
211
|
-
if (_isImdoneIgnore(path)) return onIgnoreChange(path)
|
|
212
218
|
|
|
213
219
|
const ok = await repo.fileOK((file && file.path) || path)
|
|
214
220
|
if (!ok) return
|
package/lib/repository.js
CHANGED
|
@@ -634,12 +634,12 @@ export class Repository extends Emitter {
|
|
|
634
634
|
shouldInclude (relPath) {
|
|
635
635
|
relPath = this.getRelativePath(relPath)
|
|
636
636
|
let include = true
|
|
637
|
-
if (this.config.markdownOnly && relPath) {
|
|
638
|
-
include = File.isMarkdown(relPath)
|
|
639
|
-
}
|
|
640
637
|
if (this.ignore) {
|
|
641
638
|
try {
|
|
642
|
-
include =
|
|
639
|
+
include = relPath && !this.ignore.ignores(relPath)
|
|
640
|
+
if (this.config.markdownOnly && include && relPath) {
|
|
641
|
+
include = File.isMarkdown(relPath)
|
|
642
|
+
}
|
|
643
643
|
} catch (e) {
|
|
644
644
|
logger.error(
|
|
645
645
|
`Failed to check ignore status for dir: [${relPath}] in: [${this.path}]. It will be included.`,
|