@learnpack/learnpack 2.1.6 → 2.1.8

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @learnpack/learnpack
21
21
  $ learnpack COMMAND
22
22
  running command...
23
23
  $ learnpack (-v|--version|version)
24
- @learnpack/learnpack/2.1.6 win32-x64 node-v16.14.0
24
+ @learnpack/learnpack/2.1.8 win32-x64 node-v16.14.0
25
25
  $ learnpack --help [COMMAND]
26
26
  USAGE
27
27
  $ learnpack COMMAND
@@ -74,7 +74,7 @@ DESCRIPTION
74
74
  12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
75
75
  ```
76
76
 
77
- _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\audit.ts)_
77
+ _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\audit.ts)_
78
78
 
79
79
  ## `learnpack clean`
80
80
 
@@ -89,7 +89,7 @@ DESCRIPTION
89
89
  Extra documentation goes here
90
90
  ```
91
91
 
92
- _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\clean.ts)_
92
+ _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\clean.ts)_
93
93
 
94
94
  ## `learnpack download [PACKAGE]`
95
95
 
@@ -107,7 +107,7 @@ DESCRIPTION
107
107
  Extra documentation goes here
108
108
  ```
109
109
 
110
- _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\download.ts)_
110
+ _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\download.ts)_
111
111
 
112
112
  ## `learnpack help [COMMAND]`
113
113
 
@@ -138,7 +138,7 @@ OPTIONS
138
138
  -h, --grading show CLI help
139
139
  ```
140
140
 
141
- _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\init.ts)_
141
+ _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\init.ts)_
142
142
 
143
143
  ## `learnpack login [PACKAGE]`
144
144
 
@@ -156,7 +156,7 @@ DESCRIPTION
156
156
  Extra documentation goes here
157
157
  ```
158
158
 
159
- _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\login.ts)_
159
+ _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\login.ts)_
160
160
 
161
161
  ## `learnpack logout [PACKAGE]`
162
162
 
@@ -174,7 +174,7 @@ DESCRIPTION
174
174
  Extra documentation goes here
175
175
  ```
176
176
 
177
- _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\logout.ts)_
177
+ _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\logout.ts)_
178
178
 
179
179
  ## `learnpack plugins`
180
180
 
@@ -309,7 +309,7 @@ DESCRIPTION
309
309
  Extra documentation goes here
310
310
  ```
311
311
 
312
- _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\publish.ts)_
312
+ _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\publish.ts)_
313
313
 
314
314
  ## `learnpack start`
315
315
 
@@ -330,7 +330,7 @@ OPTIONS
330
330
  -w, --watch Watch for file changes
331
331
  ```
332
332
 
333
- _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\start.ts)_
333
+ _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\start.ts)_
334
334
 
335
335
  ## `learnpack test [EXERCISESLUG]`
336
336
 
@@ -344,5 +344,5 @@ ARGUMENTS
344
344
  EXERCISESLUG The name of the exercise to test
345
345
  ```
346
346
 
347
- _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.6/src\commands\test.ts)_
347
+ _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v2.1.8/src\commands\test.ts)_
348
348
  <!-- commandsstop -->
@@ -254,7 +254,7 @@ exports.default = async ({ grading, mode, disableGrading, version, }) => {
254
254
  if (configObj.config && !configObj.config.exercisesPath)
255
255
  throw errors_1.ValidationError("No exercises directory to watch: " + configObj.config.exercisesPath);
256
256
  this.buildIndex();
257
- watcher_1.default(((_a = configObj === null || configObj === void 0 ? void 0 : configObj.config) === null || _a === void 0 ? void 0 : _a.exercisesPath) || "", onChange)
257
+ watcher_1.default(((_a = configObj === null || configObj === void 0 ? void 0 : configObj.config) === null || _a === void 0 ? void 0 : _a.exercisesPath) || "", this, onChange)
258
258
  .then(( /* eventname, filename */) => {
259
259
  console_1.default.debug("Changes detected on your exercises");
260
260
  this.buildIndex();
@@ -40,6 +40,7 @@ export interface IConfig {
40
40
  disableGrading: boolean;
41
41
  actions: Array<string>;
42
42
  autoPlay: boolean;
43
+ contact?: string;
43
44
  disabledActions?: Array<TConfigAction>;
44
45
  compiler: TCompiler;
45
46
  publicPath: string;
@@ -1,2 +1,3 @@
1
- declare const _default: (path: string, reloadSocket: () => void) => Promise<unknown>;
1
+ import { IConfigManager } from "../models/config-manager";
2
+ declare const _default: (path: string, configManager: IConfigManager, reloadSocket: () => void) => Promise<unknown>;
2
3
  export default _default;
@@ -3,16 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const chokidar = require("chokidar");
4
4
  const console_1 = require("./console");
5
5
  const debounce = require("debounce");
6
- exports.default = (path, reloadSocket) => new Promise((resolve /* , reject */) => {
6
+ exports.default = (path, configManager, reloadSocket) => new Promise((resolve /* , reject */) => {
7
7
  console_1.default.debug("PATH:", path);
8
8
  const watcher = chokidar.watch(path, {
9
9
  // TODO: This watcher is not ready yet
10
- ignored: /^(?=.*(\.\w+)$)(?!.*\.md$).*$/gm,
11
10
  ignoreInitial: true,
12
11
  });
13
12
  const onChange = (eventname, _filename) => {
14
13
  resolve(eventname /* , filename */);
15
- reloadSocket();
14
+ if (!/^(?=.*(\\\w+)$).*$/gm.test(_filename) ||
15
+ !/^(?=.*(\.\w+)$)(?!.*\.md$).*$/gm.test(_filename)) {
16
+ configManager.buildIndex();
17
+ reloadSocket();
18
+ }
16
19
  };
17
20
  watcher.on("all", debounce(onChange, 500, true));
18
21
  // watcher.on('all', onChange)
@@ -1 +1 @@
1
- {"version":"2.1.6","commands":{"audit":{"id":"audit","description":"learnpack audit is the command in charge of creating an auditory of the repository\n...\nlearnpack audit checks for the following information in a repository:\n 1. The configuration object has slug, repository and description. (Error)\n 2. The command learnpack clean has been run. (Error)\n 3. If a markdown or test file doesn't have any content. (Error)\n 4. The links are accessing to valid servers. (Error)\n 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)\n 6. The external images are working (If they are pointing to a valid server). (Error)\n 7. The exercises directory names are valid. (Error)\n 8. If an exercise doesn't have a README file. (Error)\n 9. The exercises array (Of the config file) has content. (Error)\n 10. The exercses have the same translations. (Warning)\n 11. The .gitignore file exists. (Warning)\n 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"D","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"editor":{"name":"editor","type":"option","char":"e","description":"[standalone, gitpod]","options":["standalone","gitpod"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1"},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]}}}
1
+ {"version":"2.1.8","commands":{"audit":{"id":"audit","description":"learnpack audit is the command in charge of creating an auditory of the repository\n...\nlearnpack audit checks for the following information in a repository:\n 1. The configuration object has slug, repository and description. (Error)\n 2. The command learnpack clean has been run. (Error)\n 3. If a markdown or test file doesn't have any content. (Error)\n 4. The links are accessing to valid servers. (Error)\n 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)\n 6. The external images are working (If they are pointing to a valid server). (Error)\n 7. The exercises directory names are valid. (Error)\n 8. If an exercise doesn't have a README file. (Error)\n 9. The exercises array (Of the config file) has content. (Error)\n 10. The exercses have the same translations. (Warning)\n 11. The .gitignore file exists. (Warning)\n 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"D","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"editor":{"name":"editor","type":"option","char":"e","description":"[standalone, gitpod]","options":["standalone","gitpod"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1"},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@learnpack/learnpack",
3
3
  "description": "Create, sell or download and take learning amazing learning packages",
4
- "version": "2.1.6",
4
+ "version": "2.1.8",
5
5
  "author": "Alejandro Sanchez @alesanchezr",
6
6
  "bin": {
7
7
  "learnpack": "bin/run"
@@ -1,34 +1,34 @@
1
- export default {
2
- config: {
3
- port: 3000,
4
- editor: {
5
- mode: null, // [standalone, preview]
6
- agent: null, // [vscode, gitpod, localhost]
7
- version: null,
8
- },
9
- dirPath: "./.learn",
10
- configPath: "./learn.json",
11
- outputPath: "./.learn/dist",
12
- publicPath: "/preview",
13
- publicUrl: null,
14
- language: "auto",
15
- autoPlay: true,
16
- grading: "isolated", // [isolated, incremental]
17
- exercisesPath: "./", // path to the folder that contains the exercises
18
- webpackTemplate: null, // if you want webpack to use an HTML template
19
- disableGrading: false,
20
- disabledActions: [], // Possible: 'build', 'test' or 'reset'
21
- actions: [], // ⚠️ deprecated, leave empty )
22
- entries: {
23
- html: "index.html",
24
- vanillajs: "index.js",
25
- react: "app.jsx",
26
- node: "app.js",
27
- python3: "app.py",
28
- java: "app.java",
29
- },
30
- },
31
- address: "http://localhost",
32
- currentExercise: null,
33
- exercises: [],
34
- };
1
+ export default {
2
+ config: {
3
+ port: 3000,
4
+ editor: {
5
+ mode: null, // [standalone, preview]
6
+ agent: null, // [vscode, gitpod, localhost]
7
+ version: null,
8
+ },
9
+ dirPath: "./.learn",
10
+ configPath: "./learn.json",
11
+ outputPath: "./.learn/dist",
12
+ publicPath: "/preview",
13
+ publicUrl: null,
14
+ language: "auto",
15
+ autoPlay: true,
16
+ grading: "isolated", // [isolated, incremental]
17
+ exercisesPath: "./", // path to the folder that contains the exercises
18
+ webpackTemplate: null, // if you want webpack to use an HTML template
19
+ disableGrading: false,
20
+ disabledActions: [], // Possible: 'build', 'test' or 'reset'
21
+ actions: [], // ⚠️ deprecated, leave empty )
22
+ entries: {
23
+ html: "index.html",
24
+ vanillajs: "index.js",
25
+ react: "app.jsx",
26
+ node: "app.js",
27
+ python3: "app.py",
28
+ java: "app.java",
29
+ },
30
+ },
31
+ address: "http://localhost",
32
+ currentExercise: null,
33
+ exercises: [],
34
+ };
@@ -350,7 +350,7 @@ fs.mkdirSync(confPath.base);
350
350
  );
351
351
 
352
352
  this.buildIndex();
353
- watch(configObj?.config?.exercisesPath || "", onChange)
353
+ watch(configObj?.config?.exercisesPath || "", this, onChange)
354
354
  .then((/* eventname, filename */) => {
355
355
  Console.debug("Changes detected on your exercises");
356
356
  this.buildIndex();
@@ -1,75 +1,76 @@
1
- import { IExercise } from "./exercise-obj";
2
-
3
- export type TGrading = "isolated" | "incremental" | "no-grading";
4
-
5
- export type TMode = "preview" | "standalone";
6
-
7
- export type TConfigAction = "test" | "build" | "tutorial" | "reset";
8
-
9
- export type TConfigObjAttributes = "config" | "exercises" | "grading";
10
-
11
- export type TCompiler =
12
- | "webpack"
13
- | "vanillajs"
14
- | "vue"
15
- | "react"
16
- | "css"
17
- | "html";
18
-
19
- export interface IConfigPath {
20
- base: string;
21
- }
22
-
23
- export interface IEditor {
24
- mode?: TMode;
25
- version: string;
26
- agent?: string;
27
- }
28
-
29
- export interface TEntries {
30
- python3?: string;
31
- html?: string;
32
- node?: string;
33
- react?: string;
34
- java?: string;
35
- }
36
-
37
- export interface IConfig {
38
- port?: string;
39
- repository?: string;
40
- description?: string;
41
- slug?: string;
42
- dirPath: string;
43
- preview?: string; // Picture thumbnail
44
- entries: TEntries;
45
- grading: TGrading;
46
- configPath: string;
47
- translations: Array<string>;
48
- outputPath?: string;
49
- editor: IEditor;
50
- language: string;
51
- title: string;
52
- duration: number;
53
- difficulty?: string;
54
- exercisesPath: string;
55
- disableGrading: boolean; // TODO: Deprecate
56
- actions: Array<string>; // TODO: Deprecate
57
- autoPlay: boolean;
58
- // TODO: nameExerciseValidation
59
- disabledActions?: Array<TConfigAction>;
60
- compiler: TCompiler;
61
- publicPath: string;
62
- publicUrl?: string;
63
- skills: Array<string>;
64
- runHook: (...agrs: Array<any>) => void;
65
- testingFinishedCallback: (arg: any | undefined) => void;
66
- }
67
-
68
- export interface IConfigObj {
69
- session?: number;
70
- currentExercise?: any;
71
- config?: IConfig;
72
- exercises?: Array<IExercise>;
73
- confPath?: IConfigPath;
74
- address?: string; // Maybe
75
- }
1
+ import { IExercise } from "./exercise-obj";
2
+
3
+ export type TGrading = "isolated" | "incremental" | "no-grading";
4
+
5
+ export type TMode = "preview" | "standalone";
6
+
7
+ export type TConfigAction = "test" | "build" | "tutorial" | "reset";
8
+
9
+ export type TConfigObjAttributes = "config" | "exercises" | "grading";
10
+
11
+ export type TCompiler =
12
+ | "webpack"
13
+ | "vanillajs"
14
+ | "vue"
15
+ | "react"
16
+ | "css"
17
+ | "html";
18
+
19
+ export interface IConfigPath {
20
+ base: string;
21
+ }
22
+
23
+ export interface IEditor {
24
+ mode?: TMode;
25
+ version: string;
26
+ agent?: string;
27
+ }
28
+
29
+ export interface TEntries {
30
+ python3?: string;
31
+ html?: string;
32
+ node?: string;
33
+ react?: string;
34
+ java?: string;
35
+ }
36
+
37
+ export interface IConfig {
38
+ port?: string;
39
+ repository?: string;
40
+ description?: string;
41
+ slug?: string;
42
+ dirPath: string;
43
+ preview?: string; // Picture thumbnail
44
+ entries: TEntries;
45
+ grading: TGrading;
46
+ configPath: string;
47
+ translations: Array<string>;
48
+ outputPath?: string;
49
+ editor: IEditor;
50
+ language: string;
51
+ title: string;
52
+ duration: number;
53
+ difficulty?: string;
54
+ exercisesPath: string;
55
+ disableGrading: boolean; // TODO: Deprecate
56
+ actions: Array<string>; // TODO: Deprecate
57
+ autoPlay: boolean;
58
+ // TODO: nameExerciseValidation
59
+ contact?: string;
60
+ disabledActions?: Array<TConfigAction>;
61
+ compiler: TCompiler;
62
+ publicPath: string;
63
+ publicUrl?: string;
64
+ skills: Array<string>;
65
+ runHook: (...agrs: Array<any>) => void;
66
+ testingFinishedCallback: (arg: any | undefined) => void;
67
+ }
68
+
69
+ export interface IConfigObj {
70
+ session?: number;
71
+ currentExercise?: any;
72
+ config?: IConfig;
73
+ exercises?: Array<IExercise>;
74
+ confPath?: IConfigPath;
75
+ address?: string; // Maybe
76
+ }
@@ -1,25 +1,35 @@
1
- import * as chokidar from "chokidar";
2
- import Console from "./console";
3
- import * as debounce from "debounce";
4
-
5
- export default (path: string, reloadSocket: () => void) =>
6
- new Promise((resolve /* , reject */) => {
7
- Console.debug("PATH:", path);
8
- const watcher = chokidar.watch(path, {
9
- // TODO: This watcher is not ready yet
10
- ignored: /^(?=.*(\.\w+)$)(?!.*\.md$).*$/gm,
11
- ignoreInitial: true,
12
- });
13
- const onChange = (eventname: string, _filename: string) => {
14
- resolve(eventname /* , filename */);
15
- reloadSocket();
16
- };
17
-
18
- watcher.on("all", debounce(onChange, 500, true));
19
- // watcher.on('all', onChange)
20
-
21
- process.on("SIGINT", function () {
22
- watcher.close();
23
- process.exit();
24
- });
25
- });
1
+ import * as chokidar from "chokidar";
2
+ import Console from "./console";
3
+ import * as debounce from "debounce";
4
+ import { IConfigManager } from "../models/config-manager";
5
+
6
+ export default (
7
+ path: string,
8
+ configManager: IConfigManager,
9
+ reloadSocket: () => void
10
+ ) =>
11
+ new Promise((resolve /* , reject */) => {
12
+ Console.debug("PATH:", path);
13
+ const watcher = chokidar.watch(path, {
14
+ // TODO: This watcher is not ready yet
15
+ ignoreInitial: true,
16
+ });
17
+ const onChange = (eventname: string, _filename: string) => {
18
+ resolve(eventname /* , filename */);
19
+ if (
20
+ !/^(?=.*(\\\w+)$).*$/gm.test(_filename) ||
21
+ !/^(?=.*(\.\w+)$)(?!.*\.md$).*$/gm.test(_filename)
22
+ ) {
23
+ configManager.buildIndex();
24
+ reloadSocket();
25
+ }
26
+ };
27
+
28
+ watcher.on("all", debounce(onChange, 500, true));
29
+ // watcher.on('all', onChange)
30
+
31
+ process.on("SIGINT", function () {
32
+ watcher.close();
33
+ process.exit();
34
+ });
35
+ });