@build-in-blocks/dev.resources 1.0.0 → 1.0.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 +2 -6
- package/build/shared/index.d.ts +1 -0
- package/build/shared/index.js +1 -0
- package/build/shared/node.blocks-terminal-logger.d.ts +2 -0
- package/build/shared/node.blocks-terminal-logger.js +79 -0
- package/build/shared/types/index.d.ts +1 -0
- package/build/shared/types/index.js +1 -0
- package/build/shared/types/node.blocks-logger.types.d.ts +20 -0
- package/build/shared/types/node.blocks-logger.types.js +2 -0
- package/build/shared/types/web.blocks-app.types.d.ts +5 -1
- package/build/shared/web.blocks-app.d.ts +1 -1
- package/build/shared/web.blocks-app.js +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @build-in-blocks/dev.resources
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
 [](https://npmjs.com/package/@build-in-blocks/dev.resources) 
|
|
4
4
|
|
|
5
|
-
[](https://www.gnu.org/licenses/agpl-3.0) [](#contributors) [](https://github.com/build-in-blocks/dev.resources/blob/develop/docs.contributors/README.md)
|
|
6
6
|
|
|
7
7
|
#
|
|
8
8
|
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
#
|
|
24
24
|
|
|
25
|
-
**Dependency:** `@build-in-blocks` framework libraries that have `dev.` in their name are only useful for local development, and should only be installed as a `devDependency` in your project.
|
|
26
|
-
|
|
27
|
-
#
|
|
28
|
-
|
|
29
25
|
**User guide:** See [docs.users README.md](https://github.com/build-in-blocks/dev.resources/blob/develop/docs.users/README.md)
|
|
30
26
|
|
|
31
27
|
#
|
package/build/shared/index.d.ts
CHANGED
package/build/shared/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./node.blocks-terminal-logger"), exports);
|
|
17
18
|
__exportStar(require("./node.file-system"), exports);
|
|
18
19
|
__exportStar(require("./web.blocks-app"), exports);
|
|
19
20
|
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.blocksTerminalLogger = void 0;
|
|
4
|
+
const blocksTerminalLogger = ({ internalPackage, userApp, errorSource, suggestion, originalErrorMessage, processExit }) => {
|
|
5
|
+
var _a, _b, _c, _d;
|
|
6
|
+
//-
|
|
7
|
+
const messageListDisplay = ({ noNewLineAtEnd }) => {
|
|
8
|
+
//-
|
|
9
|
+
const messageList = suggestion === null || suggestion === void 0 ? void 0 : suggestion.messageList;
|
|
10
|
+
if (!messageList)
|
|
11
|
+
return;
|
|
12
|
+
//-
|
|
13
|
+
messageList.forEach((message, index) => {
|
|
14
|
+
const isLastMessage = index === messageList.length - 1;
|
|
15
|
+
const isAppendNewLineRequested = isLastMessage && !noNewLineAtEnd;
|
|
16
|
+
console.error(`${message}${isAppendNewLineRequested ? '\n' : ''}`);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
//-
|
|
20
|
+
try {
|
|
21
|
+
const isInternalPackageErrorRequested = (internalPackage === null || internalPackage === void 0 ? void 0 : internalPackage.fullName) && internalPackage.errorMessage;
|
|
22
|
+
const isUserAppErrorRequested = (userApp === null || userApp === void 0 ? void 0 : userApp.fullName) && userApp.errorMessage;
|
|
23
|
+
const isSuggestionRequested = (_a = suggestion === null || suggestion === void 0 ? void 0 : suggestion.messageList) === null || _a === void 0 ? void 0 : _a.length;
|
|
24
|
+
//-
|
|
25
|
+
const internalPackageNameText = `${internalPackage === null || internalPackage === void 0 ? void 0 : internalPackage.fullName} (internal)`;
|
|
26
|
+
const suggestionSectionTitle = `Suggestion${((_b = suggestion === null || suggestion === void 0 ? void 0 : suggestion.blocksConfig) === null || _b === void 0 ? void 0 : _b.showCurrentState) ? ' (based on current state)' : ''}:`;
|
|
27
|
+
//-
|
|
28
|
+
if (isInternalPackageErrorRequested) {
|
|
29
|
+
console.error('--------------------------');
|
|
30
|
+
console.error('ERROR |', `${internalPackageNameText}:`);
|
|
31
|
+
console.error('Type generation failed.');
|
|
32
|
+
}
|
|
33
|
+
//-
|
|
34
|
+
if (isUserAppErrorRequested) {
|
|
35
|
+
console.error('--------------------------');
|
|
36
|
+
console.error('ERROR |', `${userApp === null || userApp === void 0 ? void 0 : userApp.fullName} (your app):`);
|
|
37
|
+
console.error(userApp.errorMessage);
|
|
38
|
+
}
|
|
39
|
+
//-
|
|
40
|
+
if (errorSource) {
|
|
41
|
+
console.error('--------------------------');
|
|
42
|
+
console.error(`ERROR SOURCE => ${internalPackageNameText}`);
|
|
43
|
+
}
|
|
44
|
+
//-
|
|
45
|
+
if (isSuggestionRequested && !((_c = suggestion === null || suggestion === void 0 ? void 0 : suggestion.blocksConfig) === null || _c === void 0 ? void 0 : _c.showCurrentState)) {
|
|
46
|
+
console.error('--------------------------');
|
|
47
|
+
console.error(suggestionSectionTitle);
|
|
48
|
+
messageListDisplay({});
|
|
49
|
+
}
|
|
50
|
+
//-
|
|
51
|
+
if (isSuggestionRequested && ((_d = suggestion === null || suggestion === void 0 ? void 0 : suggestion.blocksConfig) === null || _d === void 0 ? void 0 : _d.showCurrentState)) {
|
|
52
|
+
console.error('--------------------------');
|
|
53
|
+
console.error(`Your blocks config current state:`);
|
|
54
|
+
console.error(suggestion === null || suggestion === void 0 ? void 0 : suggestion.blocksConfig.referenceMessage);
|
|
55
|
+
console.error('--------------------------');
|
|
56
|
+
console.error(suggestionSectionTitle);
|
|
57
|
+
messageListDisplay({
|
|
58
|
+
noNewLineAtEnd: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//-
|
|
62
|
+
if (originalErrorMessage) {
|
|
63
|
+
console.error('--------------------------');
|
|
64
|
+
console.error('ORIGINAL ERROR:\n', originalErrorMessage);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error('--------------------------');
|
|
69
|
+
console.error('ERROR |', `@build-in-blocks/dev.resources (internal):`);
|
|
70
|
+
console.error('Error log failed.');
|
|
71
|
+
console.error('--------------------------');
|
|
72
|
+
console.error('ORIGINAL ERROR:\n', error);
|
|
73
|
+
}
|
|
74
|
+
//-
|
|
75
|
+
if (processExit) {
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.blocksTerminalLogger = blocksTerminalLogger;
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./node.blocks-logger.types"), exports);
|
|
17
18
|
__exportStar(require("./web.blocks-app.types"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface BlocksTerminalLogger {
|
|
2
|
+
internalPackage?: {
|
|
3
|
+
fullName?: string;
|
|
4
|
+
errorMessage?: string;
|
|
5
|
+
};
|
|
6
|
+
userApp?: {
|
|
7
|
+
fullName?: string;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
errorSource?: boolean;
|
|
11
|
+
suggestion?: {
|
|
12
|
+
blocksConfig?: {
|
|
13
|
+
showCurrentState?: boolean;
|
|
14
|
+
referenceMessage?: string;
|
|
15
|
+
};
|
|
16
|
+
messageList?: string[];
|
|
17
|
+
};
|
|
18
|
+
originalErrorMessage?: Error;
|
|
19
|
+
processExit?: boolean;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@build-in-blocks/dev.resources",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Shared @build-in-blocks framework Typescript code development library.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"module": "./build/index.js",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"lint-staged": "^16.4.0",
|
|
34
34
|
"npm-run-all": "^4.1.5",
|
|
35
35
|
"prettier": "^3.8.1",
|
|
36
|
-
"typescript": "^5.9.3",
|
|
37
36
|
"typescript-eslint": "^8.58.0"
|
|
38
37
|
},
|
|
39
38
|
"homepage": "https://github.com/build-in-blocks/dev.resources#readme",
|