comment-variables 0.6.1 → 0.6.2
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.
- package/README.md +13 -27
- package/comments.config.js +0 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,13 +80,12 @@ const data = {
|
|
|
80
80
|
"The flow that resolves $COMMENT#* placeholders intro actual comments.", // $COMMENT#JSDOC#DEFINITIONS#RESOLVECOMMENTSFLOW
|
|
81
81
|
compressCommentsFlow:
|
|
82
82
|
"The flow that compresses actual comments into $COMMENT#* placeholders.", // $COMMENT#JSDOC#DEFINITIONS#COMPRESSCOMMENTSFLOW
|
|
83
|
-
findAllImports:
|
|
84
|
-
"Finds all import paths recursively related to a given file path.", // $COMMENT#JSDOC#DEFINITIONS#FINDALLIMPORTS
|
|
85
|
-
processImport: "Processes recursively and resolves a single import path.", // $COMMENT#JSDOC#DEFINITIONS#PROCESSIMPORT
|
|
86
83
|
flattenConfigData:
|
|
87
84
|
"Flattens the config's data property into a one-dimensional object of $COMMENT-*-like keys and string values.", // $COMMENT#JSDOC#DEFINITIONS#FLATTENCONFIGDATA
|
|
88
85
|
resolveConfig:
|
|
89
86
|
"Verifies, validates and resolves the config path to retrieve the config's data and ignores.", // $COMMENT#JSDOC#DEFINITIONS#RESOLVECONFIG
|
|
87
|
+
logError:
|
|
88
|
+
'Logs an error to the console depending on its type. (`"error"` or `"warning"`.)', // $COMMENT#JSDOC#DEFINITIONS#LOGERROR
|
|
90
89
|
}),
|
|
91
90
|
params: Object.freeze({
|
|
92
91
|
string: "The string.", // $COMMENT#JSDOC#PARAMS#STRING
|
|
@@ -100,26 +99,17 @@ const data = {
|
|
|
100
99
|
"The array of paths and globs for the flow's ESLint instance to ignore.", // $COMMENT#JSDOC#PARAMS#IGNORES
|
|
101
100
|
eitherFlattenedConfigData:
|
|
102
101
|
"Either the flattened config data or the reversed flattened config data, since they share the same structure.", // $COMMENT#JSDOC#PARAMS#EITHERFLATTENEDCONFIGDATA
|
|
103
|
-
filePath:
|
|
104
|
-
"The absolute path of the file whose imports are being recursively found, such as that of a project's `comments.config.js` file.", // $COMMENT#JSDOC#PARAMS#FILEPATH
|
|
105
|
-
cwd: "The current working directory, set as `process.cwd()` by default.", // $COMMENT#JSDOC#PARAMS#CWD
|
|
106
|
-
visitedSet:
|
|
107
|
-
"The set of strings tracking the import paths that have already been visited, instantiated as a `new Set()` by default.", // $COMMENT#JSDOC#PARAMS#VISITEDSET
|
|
108
|
-
depth:
|
|
109
|
-
"The current depth of the recursion, instantiated at `0` by default.", // $COMMENT#JSDOC#PARAMS#DEPTH
|
|
110
|
-
maxDepth:
|
|
111
|
-
"The maximum depth allowed for the recursion, instantiated at `100` by default.", // $COMMENT#JSDOC#PARAMS#MAXDEPTH
|
|
112
|
-
importPath: "The import path currently being addressed.", // $COMMENT#JSDOC#PARAMS#IMPORTPATH
|
|
113
|
-
currentDir:
|
|
114
|
-
"The directory containing the import path currently being addressed.", // $COMMENT#JSDOC#PARAMS#CURRENTDIR
|
|
115
102
|
configData:
|
|
116
|
-
"The config's data property. (Values are typed `
|
|
117
|
-
|
|
118
|
-
"The map housing the flattened keys with their values and sources through recursion, instantiated as a `new Map()`.", // $COMMENT#JSDOC#PARAMS#
|
|
119
|
-
|
|
120
|
-
"The list of keys that are parent to the key at hand given the recursive nature of the config's data's data structure, instantiated as an empty array of strings.", // $COMMENT#JSDOC#PARAMS#
|
|
103
|
+
"The config's data property. (Values are typed `unknown` given the limitations in typing recursive values in JSDoc.)", // $COMMENT#JSDOC#PARAMS#CONFIGDATA
|
|
104
|
+
configDataMapOption:
|
|
105
|
+
"The map housing the flattened keys with their values and sources through recursion, instantiated as a `new Map()`.", // $COMMENT#JSDOC#PARAMS#CONFIGDATAMAPOPTION
|
|
106
|
+
parentKeysOption:
|
|
107
|
+
"The list of keys that are parent to the key at hand given the recursive nature of the config's data's data structure, instantiated as an empty array of strings (`[]`).", // $COMMENT#JSDOC#PARAMS#PARENTKEYSOPTION
|
|
121
108
|
configPath:
|
|
122
|
-
|
|
109
|
+
'The path of the config from `comments.config.js`, or from a config passed via the `--config` flag in the CLI, or from one passed via `"commentVariables.config": true` in `.vscode/settings.json` for the VS Code Extension.', // $COMMENT#JSDOC#PARAMS#CONFIGPATH
|
|
110
|
+
options: "The additional options as follows:", // $COMMENT#JSDOC#PARAMS#OPTIONS
|
|
111
|
+
settings: "The required settings as follows:", // $COMMENT#JSDOC#PARAMS#SETTINGS
|
|
112
|
+
error: "The error object being handle for the logging.", // $COMMENT#JSDOC#PARAMS#ERROR
|
|
123
113
|
}),
|
|
124
114
|
returns: Object.freeze({
|
|
125
115
|
exitDueToFailure:
|
|
@@ -128,14 +118,10 @@ const data = {
|
|
|
128
118
|
makeRuleResolve: "The resolve rule based on the flattened config data.", // $COMMENT#JSDOC#RETURNS#MAKERULERESOLVE
|
|
129
119
|
makeRuleCompress:
|
|
130
120
|
"The compress rule based on the reversed flattened config data.", // $COMMENT#JSDOC#RETURNS#MAKERULECOMPRESS
|
|
131
|
-
findAllImports:
|
|
132
|
-
"The complete set of strings of import paths recursively related to the given file path, or `null` if an issue has arisen.", // $COMMENT#JSDOC#RETURNS#FINDALLIMPORTS
|
|
133
|
-
processImport:
|
|
134
|
-
"`true` to skip unresolved paths, `false` if resolution fails at any level.", // $COMMENT#JSDOC#RETURNS#PROCESSIMPORT
|
|
135
121
|
flattenConfigData:
|
|
136
|
-
"Both the flattened config data and its reversed version to ensure the strict reversibility of the `resolve` and `compress` commands.", // $COMMENT#JSDOC#RETURNS#FLATTENCONFIGDATA
|
|
122
|
+
"Both the flattened config data and its reversed version to ensure the strict reversibility of the `resolve` and `compress` commands in a success object (`success: true`). Errors are bubbled up during failures so they can be reused differently on the CLI and the VS Code Extension in a failure object (`success: false`).", // $COMMENT#JSDOC#RETURNS#FLATTENCONFIGDATA
|
|
137
123
|
resolveConfig:
|
|
138
|
-
"The flattened config data, the reverse flattened config data, the verified config path, the raw passed ignores, and the original config.", // $COMMENT#JSDOC#RETURNS#RESOLVECONFIG
|
|
124
|
+
"The flattened config data, the reverse flattened config data, the verified config path, the raw passed ignores, and the original config. Errors are returned during failures so they can be reused differently on the CLI and the VS Code Extension.", // $COMMENT#JSDOC#RETURNS#RESOLVECONFIG
|
|
139
125
|
}),
|
|
140
126
|
}),
|
|
141
127
|
};
|
package/comments.config.js
CHANGED
|
@@ -29,10 +29,6 @@ const data = {
|
|
|
29
29
|
"The flow that resolves $COMMENT#* placeholders intro actual comments.", // $COMMENT#JSDOC#DEFINITIONS#RESOLVECOMMENTSFLOW
|
|
30
30
|
compressCommentsFlow:
|
|
31
31
|
"The flow that compresses actual comments into $COMMENT#* placeholders.", // $COMMENT#JSDOC#DEFINITIONS#COMPRESSCOMMENTSFLOW
|
|
32
|
-
findAllImports:
|
|
33
|
-
"Finds all import paths recursively related to a given file path.", // $COMMENT#JSDOC#DEFINITIONS#FINDALLIMPORTS
|
|
34
|
-
processImport:
|
|
35
|
-
"Processes recursively and resolves a single import path. (Unlike `findAllImports`, here `currentDir`, `cwd`, `visitedSet`, `depth`, and `maxDepth` aren't options because they are mandatory and not pre-parameterized.)", // $COMMENT#JSDOC#DEFINITIONS#PROCESSIMPORT
|
|
36
32
|
flattenConfigData:
|
|
37
33
|
"Flattens the config's data property into a one-dimensional object of $COMMENT-*-like keys and string values.", // $COMMENT#JSDOC#DEFINITIONS#FLATTENCONFIGDATA
|
|
38
34
|
resolveConfig:
|
|
@@ -52,24 +48,6 @@ const data = {
|
|
|
52
48
|
"The array of paths and globs for the flow's ESLint instance to ignore.", // $COMMENT#JSDOC#PARAMS#IGNORES
|
|
53
49
|
eitherFlattenedConfigData:
|
|
54
50
|
"Either the flattened config data or the reversed flattened config data, since they share the same structure.", // $COMMENT#JSDOC#PARAMS#EITHERFLATTENEDCONFIGDATA
|
|
55
|
-
filePath:
|
|
56
|
-
"The absolute path of the file whose imports are being recursively found, such as that of a project's `comments.config.js` file.", // $COMMENT#JSDOC#PARAMS#FILEPATH
|
|
57
|
-
cwdOption:
|
|
58
|
-
"The current working directory, set as `process.cwd()` by default.", // $COMMENT#JSDOC#PARAMS#CWDOPTION
|
|
59
|
-
visitedSetOption:
|
|
60
|
-
"The set of strings tracking the import paths that have already been visited, instantiated as a `new Set()` by default.", // $COMMENT#JSDOC#PARAMS#VISITEDSETOPTION
|
|
61
|
-
depthOption:
|
|
62
|
-
"The current depth of the recursion, instantiated at `0` by default.", // $COMMENT#JSDOC#PARAMS#DEPTHOPTION
|
|
63
|
-
maxDepthOption:
|
|
64
|
-
"The maximum depth allowed for the recursion, instantiated at `100` by default.", // $COMMENT#JSDOC#PARAMS#MAXDEPTHOPTION
|
|
65
|
-
importPath: "The import path currently being addressed.", // $COMMENT#JSDOC#PARAMS#IMPORTPATH
|
|
66
|
-
currentDirSetting:
|
|
67
|
-
"The directory containing the import path currently being addressed.", // $COMMENT#JSDOC#PARAMS#CURRENTDIRSETTING
|
|
68
|
-
cwdSetting: "The current working directory.", // $COMMENT#JSDOC#PARAMS#CWDSETTING
|
|
69
|
-
visitedSetSetting:
|
|
70
|
-
"The set of strings tracking the import paths that have already been visited.", // $COMMENT#JSDOC#PARAMS#VISITEDSETSETTING
|
|
71
|
-
depthSetting: "The current depth of the recursion.", // $COMMENT#JSDOC#PARAMS#DEPTHSETTING
|
|
72
|
-
maxDepthSetting: "The maximum depth allowed for the recursion.", // $COMMENT#JSDOC#PARAMS#MAXDEPTHSETTING
|
|
73
51
|
configData:
|
|
74
52
|
"The config's data property. (Values are typed `unknown` given the limitations in typing recursive values in JSDoc.)", // $COMMENT#JSDOC#PARAMS#CONFIGDATA
|
|
75
53
|
configDataMapOption:
|
|
@@ -89,10 +67,6 @@ const data = {
|
|
|
89
67
|
makeRuleResolve: "The resolve rule based on the flattened config data.", // $COMMENT#JSDOC#RETURNS#MAKERULERESOLVE
|
|
90
68
|
makeRuleCompress:
|
|
91
69
|
"The compress rule based on the reversed flattened config data.", // $COMMENT#JSDOC#RETURNS#MAKERULECOMPRESS
|
|
92
|
-
findAllImports:
|
|
93
|
-
"The complete set of strings of import paths recursively related to the given file path in a success object (`success: true`). Errors are bubbled up during failures in a failure object (`success: false`).", // $COMMENT#JSDOC#RETURNS#FINDALLIMPORTS
|
|
94
|
-
processImport:
|
|
95
|
-
"The results of the embedded round of `findAllImports`, since `findAllImports`'s recursion happens within `processImport`.", // $COMMENT#JSDOC#RETURNS#PROCESSIMPORT
|
|
96
70
|
flattenConfigData:
|
|
97
71
|
"Both the flattened config data and its reversed version to ensure the strict reversibility of the `resolve` and `compress` commands in a success object (`success: true`). Errors are bubbled up during failures so they can be reused differently on the CLI and the VS Code Extension in a failure object (`success: false`).", // $COMMENT#JSDOC#RETURNS#FLATTENCONFIGDATA
|
|
98
72
|
resolveConfig:
|
package/package.json
CHANGED