sfiledl 2.0.0 → 2.0.1
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/build/lib.cjs +94 -117
- package/build/lib.cjs.map +1 -14
- package/build/lib.d.ts +23 -31
- package/build/lib.mjs +87 -118
- package/build/lib.mjs.map +1 -12
- package/changelog +593 -0
- package/license +661 -0
- package/package.json +6 -3
- package/readme +3 -0
package/build/lib.cjs
CHANGED
|
@@ -1,137 +1,114 @@
|
|
|
1
|
-
'use strict'
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const COLORS = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
exports.LibraryStatus = void 0
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})(exports.LibraryStatus || (exports.LibraryStatus = {}))
|
|
6
|
+
RESET: "\x1b[0m",
|
|
7
|
+
BRIGHT: "\x1b[1m",
|
|
8
|
+
YELLOW: "\x1b[33m",
|
|
9
|
+
RED: "\x1b[31m",
|
|
10
|
+
CYAN: "\x1b[36m",
|
|
11
|
+
GRAY: "\x1b[90m",
|
|
12
|
+
};
|
|
13
|
+
exports.LibraryStatus = void 0;
|
|
14
|
+
(function (LibraryStatus) {
|
|
15
|
+
LibraryStatus["UNDER_CONSTRUCTION"] = "UNDER_CONSTRUCTION";
|
|
16
|
+
LibraryStatus["STABLE"] = "STABLE";
|
|
17
|
+
LibraryStatus["DEPRECATED"] = "DEPRECATED";
|
|
18
|
+
})(exports.LibraryStatus || (exports.LibraryStatus = {}));
|
|
19
19
|
const LIB_INFO = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let warningDisplayed = false
|
|
20
|
+
name: "MySuperFramework",
|
|
21
|
+
currentVersion: "2.0.1-dev",
|
|
22
|
+
previousVersion: "1.0.2",
|
|
23
|
+
status: exports.LibraryStatus.UNDER_CONSTRUCTION,
|
|
24
|
+
isDeprecated: true,
|
|
25
|
+
message: "This version represents a complete architectural refactor from CLI to framework. Not stable.",
|
|
26
|
+
};
|
|
27
|
+
let warningDisplayed = false;
|
|
29
28
|
function stripAnsi(text) {
|
|
30
|
-
|
|
29
|
+
return text.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
|
|
31
30
|
}
|
|
32
31
|
function isDevelopmentVersion() {
|
|
33
|
-
|
|
32
|
+
return LIB_INFO.status === exports.LibraryStatus.UNDER_CONSTRUCTION;
|
|
34
33
|
}
|
|
35
34
|
class LibStatus {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
suppressWarning() {
|
|
90
|
-
warningDisplayed = true
|
|
91
|
-
}
|
|
92
|
-
ensureStable() {
|
|
93
|
-
if (LIB_INFO.status === exports.LibraryStatus.UNDER_CONSTRUCTION) {
|
|
94
|
-
const errorMessage =
|
|
95
|
-
`${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Stability Check Failed${COLORS.RESET}\n` +
|
|
96
|
-
`${COLORS.GRAY}Library version ${LIB_INFO.currentVersion} is under active development.${COLORS.RESET}\n` +
|
|
97
|
-
`${COLORS.GRAY}Current status: ${LIB_INFO.status}${COLORS.RESET}`
|
|
98
|
-
throw new Error(stripAnsi(errorMessage))
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
getVersion() {
|
|
102
|
-
return LIB_INFO.currentVersion
|
|
103
|
-
}
|
|
104
|
-
getInfo() {
|
|
105
|
-
return LIB_INFO
|
|
106
|
-
}
|
|
35
|
+
static instance;
|
|
36
|
+
constructor() {
|
|
37
|
+
this.displayDeveloperWarning();
|
|
38
|
+
}
|
|
39
|
+
static getInstance() {
|
|
40
|
+
if (!LibStatus.instance) {
|
|
41
|
+
LibStatus.instance = new LibStatus();
|
|
42
|
+
}
|
|
43
|
+
return LibStatus.instance;
|
|
44
|
+
}
|
|
45
|
+
displayDeveloperWarning() {
|
|
46
|
+
if (typeof console === "undefined" || typeof console.warn !== "function") {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (warningDisplayed) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (typeof process !== "undefined" && process.env && process.env['MY_SUPER_FRAMEWORK_SUPPRESS_WARNING'] === "true") {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const border = `${COLORS.GRAY}${"=".repeat(80)}${COLORS.RESET}`;
|
|
56
|
+
const label = `${COLORS.YELLOW}${COLORS.BRIGHT}[WARNING]${COLORS.RESET}`;
|
|
57
|
+
const highlight = `${COLORS.CYAN}`;
|
|
58
|
+
console.warn(`\n${border}`);
|
|
59
|
+
console.warn(`${label} DEVELOPMENT VERSION IN USE`);
|
|
60
|
+
console.warn(`${COLORS.GRAY}Library: ${COLORS.RESET}${highlight}${LIB_INFO.name}${COLORS.RESET}`);
|
|
61
|
+
console.warn(`${COLORS.GRAY}Current Version: ${COLORS.RESET}${highlight}${LIB_INFO.currentVersion}${COLORS.RESET}`);
|
|
62
|
+
console.warn(`${COLORS.GRAY}Previous Version: ${COLORS.RESET}${highlight}${LIB_INFO.previousVersion}${COLORS.RESET}`);
|
|
63
|
+
console.warn(`${COLORS.GRAY}Architecture: ${COLORS.RESET}${highlight}CLI -> Framework (Full Refactor)${COLORS.RESET}`);
|
|
64
|
+
console.warn(`\n${COLORS.RED}${COLORS.BRIGHT}DO NOT USE IN PRODUCTION ENVIRONMENTS${COLORS.RESET}`);
|
|
65
|
+
console.warn(`${COLORS.GRAY}API stability is not guaranteed. Breaking changes may occur without notice.${COLORS.RESET}`);
|
|
66
|
+
console.warn(`${COLORS.GRAY}To suppress this warning, set env MY_SUPER_FRAMEWORK_SUPPRESS_WARNING=true${COLORS.RESET}`);
|
|
67
|
+
console.warn(`${border}\n`);
|
|
68
|
+
warningDisplayed = true;
|
|
69
|
+
}
|
|
70
|
+
suppressWarning() {
|
|
71
|
+
warningDisplayed = true;
|
|
72
|
+
}
|
|
73
|
+
ensureStable() {
|
|
74
|
+
if (LIB_INFO.status === exports.LibraryStatus.UNDER_CONSTRUCTION) {
|
|
75
|
+
const errorMessage = `${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Stability Check Failed${COLORS.RESET}\n` +
|
|
76
|
+
`${COLORS.GRAY}Library version ${LIB_INFO.currentVersion} is under active development.${COLORS.RESET}\n` +
|
|
77
|
+
`${COLORS.GRAY}Current status: ${LIB_INFO.status}${COLORS.RESET}`;
|
|
78
|
+
throw new Error(stripAnsi(errorMessage));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
getVersion() {
|
|
82
|
+
return LIB_INFO.currentVersion;
|
|
83
|
+
}
|
|
84
|
+
getInfo() {
|
|
85
|
+
return LIB_INFO;
|
|
86
|
+
}
|
|
107
87
|
}
|
|
108
88
|
function initFramework() {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
throw new Error(stripAnsi(message))
|
|
89
|
+
const message = `${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Initialization Blocked${COLORS.RESET}\n` +
|
|
90
|
+
`${COLORS.GRAY}Framework is undergoing complete architectural refactor.${COLORS.RESET}\n` +
|
|
91
|
+
`${COLORS.GRAY}Migration path: v${LIB_INFO.previousVersion} (CLI) -> v${LIB_INFO.currentVersion} (Framework)${COLORS.RESET}\n` +
|
|
92
|
+
`${COLORS.GRAY}Status: ${LIB_INFO.status}${COLORS.RESET}`;
|
|
93
|
+
throw new Error(stripAnsi(message));
|
|
115
94
|
}
|
|
116
95
|
function isStable() {
|
|
117
|
-
|
|
96
|
+
return LIB_INFO.status !== exports.LibraryStatus.UNDER_CONSTRUCTION;
|
|
118
97
|
}
|
|
119
98
|
function assertStable() {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
)
|
|
125
|
-
}
|
|
99
|
+
if (LIB_INFO.status === exports.LibraryStatus.UNDER_CONSTRUCTION) {
|
|
100
|
+
throw new Error(`[${LIB_INFO.name}] Cannot use unstable version ${LIB_INFO.currentVersion} in production. ` +
|
|
101
|
+
`Status: ${LIB_INFO.status}`);
|
|
102
|
+
}
|
|
126
103
|
}
|
|
127
104
|
if (isDevelopmentVersion()) {
|
|
128
|
-
|
|
105
|
+
LibStatus.getInstance();
|
|
129
106
|
}
|
|
130
107
|
|
|
131
|
-
exports.LIB_INFO = LIB_INFO
|
|
132
|
-
exports.LibStatus = LibStatus
|
|
133
|
-
exports.assertStable = assertStable
|
|
134
|
-
exports.initFramework = initFramework
|
|
135
|
-
exports.isDevelopmentVersion = isDevelopmentVersion
|
|
136
|
-
exports.isStable = isStable
|
|
108
|
+
exports.LIB_INFO = LIB_INFO;
|
|
109
|
+
exports.LibStatus = LibStatus;
|
|
110
|
+
exports.assertStable = assertStable;
|
|
111
|
+
exports.initFramework = initFramework;
|
|
112
|
+
exports.isDevelopmentVersion = isDevelopmentVersion;
|
|
113
|
+
exports.isStable = isStable;
|
|
137
114
|
//# sourceMappingURL=lib.cjs.map
|
package/build/lib.cjs.map
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "lib.cjs",
|
|
4
|
-
"sources": [
|
|
5
|
-
"../lib/lib.ts"
|
|
6
|
-
],
|
|
7
|
-
"sourcesContent": [
|
|
8
|
-
"const COLORS = {\n\tRESET: '\\x1b[0m',\n\tBRIGHT: '\\x1b[1m',\n\tYELLOW: '\\x1b[33m',\n\tRED: '\\x1b[31m',\n\tCYAN: '\\x1b[36m',\n\tGRAY: '\\x1b[90m',\n} as const\nexport enum LibraryStatus {\n\tUNDER_CONSTRUCTION = 'UNDER_CONSTRUCTION',\n\tSTABLE = 'STABLE',\n\tDEPRECATED = 'DEPRECATED',\n}\nexport const LIB_INFO = {\n\tname: 'MySuperFramework',\n\tcurrentVersion: '2.0.0-dev',\n\tpreviousVersion: '1.0.2',\n\tstatus: LibraryStatus.UNDER_CONSTRUCTION,\n\tisDeprecated: true,\n\tmessage:\n\t\t'This version represents a complete architectural refactor from CLI to framework. Not stable.',\n} as const\nlet warningDisplayed = false\nfunction stripAnsi(text: string): string {\n\treturn text.replace(/\\x1b\\[[0-9;]*[a-zA-Z]/g, '')\n}\nexport function isDevelopmentVersion(): boolean {\n\treturn LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION\n}\nexport class LibStatus {\n\tprivate static instance: LibStatus | undefined\n\tprivate constructor() {\n\t\tthis.displayDeveloperWarning()\n\t}\n\tpublic static getInstance(): LibStatus {\n\t\tif (!LibStatus.instance) {\n\t\t\tLibStatus.instance = new LibStatus()\n\t\t}\n\t\treturn LibStatus.instance\n\t}\n\tprivate displayDeveloperWarning(): void {\n\t\tif (typeof console === 'undefined' || typeof console.warn !== 'function') {\n\t\t\treturn\n\t\t}\n\t\tif (warningDisplayed) {\n\t\t\treturn\n\t\t}\n\t\tif (\n\t\t\ttypeof process !== 'undefined' &&\n\t\t\tprocess.env &&\n\t\t\tprocess.env['MY_SUPER_FRAMEWORK_SUPPRESS_WARNING'] === 'true'\n\t\t) {\n\t\t\treturn\n\t\t}\n\t\tconst border = `${COLORS.GRAY}${'='.repeat(80)}${COLORS.RESET}`\n\t\tconst label = `${COLORS.YELLOW}${COLORS.BRIGHT}[WARNING]${COLORS.RESET}`\n\t\tconst highlight = `${COLORS.CYAN}`\n\t\tconsole.warn(`\\n${border}`)\n\t\tconsole.warn(`${label} DEVELOPMENT VERSION IN USE`)\n\t\tconsole.warn(\n\t\t\t`${COLORS.GRAY}Library: ${COLORS.RESET}${highlight}${LIB_INFO.name}${COLORS.RESET}`,\n\t\t)\n\t\tconsole.warn(\n\t\t\t`${COLORS.GRAY}Current Version: ${COLORS.RESET}${highlight}${LIB_INFO.currentVersion}${COLORS.RESET}`,\n\t\t)\n\t\tconsole.warn(\n\t\t\t`${COLORS.GRAY}Previous Version: ${COLORS.RESET}${highlight}${LIB_INFO.previousVersion}${COLORS.RESET}`,\n\t\t)\n\t\tconsole.warn(\n\t\t\t`${COLORS.GRAY}Architecture: ${COLORS.RESET}${highlight}CLI -> Framework (Full Refactor)${COLORS.RESET}`,\n\t\t)\n\t\tconsole.warn(\n\t\t\t`\\n${COLORS.RED}${COLORS.BRIGHT}DO NOT USE IN PRODUCTION ENVIRONMENTS${COLORS.RESET}`,\n\t\t)\n\t\tconsole.warn(\n\t\t\t`${COLORS.GRAY}API stability is not guaranteed. Breaking changes may occur without notice.${COLORS.RESET}`,\n\t\t)\n\t\tconsole.warn(\n\t\t\t`${COLORS.GRAY}To suppress this warning, set env MY_SUPER_FRAMEWORK_SUPPRESS_WARNING=true${COLORS.RESET}`,\n\t\t)\n\t\tconsole.warn(`${border}\\n`)\n\t\twarningDisplayed = true\n\t}\n\tpublic suppressWarning(): void {\n\t\twarningDisplayed = true\n\t}\n\tpublic ensureStable(): void {\n\t\tif (LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION) {\n\t\t\tconst errorMessage =\n\t\t\t\t`${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Stability Check Failed${COLORS.RESET}\\n` +\n\t\t\t\t`${COLORS.GRAY}Library version ${LIB_INFO.currentVersion} is under active development.${COLORS.RESET}\\n` +\n\t\t\t\t`${COLORS.GRAY}Current status: ${LIB_INFO.status}${COLORS.RESET}`\n\t\t\tthrow new Error(stripAnsi(errorMessage))\n\t\t}\n\t}\n\tpublic getVersion(): string {\n\t\treturn LIB_INFO.currentVersion\n\t}\n\tpublic getInfo(): Readonly<typeof LIB_INFO> {\n\t\treturn LIB_INFO\n\t}\n}\nexport function initFramework(): never {\n\tconst message =\n\t\t`${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Initialization Blocked${COLORS.RESET}\\n` +\n\t\t`${COLORS.GRAY}Framework is undergoing complete architectural refactor.${COLORS.RESET}\\n` +\n\t\t`${COLORS.GRAY}Migration path: v${LIB_INFO.previousVersion} (CLI) -> v${LIB_INFO.currentVersion} (Framework)${COLORS.RESET}\\n` +\n\t\t`${COLORS.GRAY}Status: ${LIB_INFO.status}${COLORS.RESET}`\n\tthrow new Error(stripAnsi(message))\n}\nexport function isStable(): boolean {\n\treturn LIB_INFO.status !== LibraryStatus.UNDER_CONSTRUCTION\n}\nexport function assertStable(): void {\n\tif (LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION) {\n\t\tthrow new Error(\n\t\t\t`[${LIB_INFO.name}] Cannot use unstable version ${LIB_INFO.currentVersion} in production. ` +\n\t\t\t\t`Status: ${LIB_INFO.status}`,\n\t\t)\n\t}\n}\nif (isDevelopmentVersion()) {\n\tLibStatus.getInstance()\n}\n"
|
|
9
|
-
],
|
|
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Ac,CAAA,gBAAA,CAAkB;AAC1F,YAAA,CAAA,QAAA,EAAW,QAAQ,CAAC,MAAM,CAAA,CAAE,CAC7B;IACF;AACD;AACA,IAAI,oBAAoB,EAAE,EAAE;IAC3B,SAAS,CAAC,WAAW,EAAE;AACxB;;;;;;;;;"
|
|
14
|
-
}
|
|
1
|
+
{"version":3,"file":"lib.cjs","sources":["../lib/lib.ts"],"sourcesContent":["/**\n * ====================================================================================================\n * WARNING: LIBRARY UNDER ACTIVE DEVELOPMENT - NOT FOR PRODUCTION USE\n * ====================================================================================================\n * \n * Status: DEPRECATED / UNSTABLE\n * Previous Version: 1.0.2 (CLI-based architecture)\n * Target Version: 2.0.1 (Full framework architecture)\n * \n * BREAKING CHANGES NOTICE:\n * - This library is undergoing a complete rewrite and architectural refactor.\n * - Legacy CLI-based implementation has been entirely removed.\n * - New framework-based architecture is currently under active development.\n * \n * PRODUCTION USE PROHIBITED:\n * - API surface is subject to change without notice.\n * - No backward compatibility guarantees.\n * - Use exclusively for development and testing purposes.\n * \n * ====================================================================================================\n */\n\n// ANSI color codes for terminal output\nconst COLORS = {\n RESET: \"\\x1b[0m\",\n BRIGHT: \"\\x1b[1m\",\n YELLOW: \"\\x1b[33m\",\n RED: \"\\x1b[31m\",\n CYAN: \"\\x1b[36m\",\n GRAY: \"\\x1b[90m\",\n} as const;\n\n/**\n * Development status of the library.\n */\nexport enum LibraryStatus {\n /** Library is under active construction, not ready for production. */\n UNDER_CONSTRUCTION = \"UNDER_CONSTRUCTION\",\n /** Library is stable and ready for production. (Future use) */\n STABLE = \"STABLE\",\n /** Library is deprecated. (Future use) */\n DEPRECATED = \"DEPRECATED\",\n}\n\n/**\n * Library metadata.\n */\nexport const LIB_INFO = {\n name: \"MySuperFramework\",\n currentVersion: \"2.0.1-dev\",\n previousVersion: \"1.0.2\",\n status: LibraryStatus.UNDER_CONSTRUCTION,\n isDeprecated: true,\n message: \"This version represents a complete architectural refactor from CLI to framework. Not stable.\",\n} as const;\n\n// Flag to ensure warning is displayed only once\nlet warningDisplayed = false;\n\n/**\n * Utility function to strip ANSI escape codes from a string.\n * Supports common ANSI sequences (colors, styles, etc.).\n * @param text - Text containing ANSI escape sequences.\n * @returns Plain text without ANSI formatting.\n */\nfunction stripAnsi(text: string): string {\n // Matches ANSI escape sequences: \\x1b[ (or \\u001b[) followed by any number of parameters and ending with a letter\n return text.replace(/\\x1b\\[[0-9;]*[a-zA-Z]/g, \"\");\n}\n\n/**\n * Checks if the library is currently in development mode.\n * @returns `true` if the library status is `UNDER_CONSTRUCTION`.\n */\nexport function isDevelopmentVersion(): boolean {\n return LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION;\n}\n\n/**\n * Primary class for library status management and developer notifications.\n * Provides programmatic access to version information and stability checks.\n */\nexport class LibStatus {\n private static instance: LibStatus | undefined;\n\n private constructor() {\n this.displayDeveloperWarning();\n }\n\n /**\n * Gets the singleton instance of LibStatus.\n * @returns The LibStatus instance.\n */\n public static getInstance(): LibStatus {\n if (!LibStatus.instance) {\n LibStatus.instance = new LibStatus();\n }\n return LibStatus.instance;\n }\n\n /**\n * Outputs formatted warning message to console upon library initialization.\n * Uses ANSI color codes for enhanced visibility in terminal environments.\n * The warning is displayed only once per process, unless suppressed.\n */\n private displayDeveloperWarning(): void {\n // Skip if console is not available or warning already displayed\n if (typeof console === \"undefined\" || typeof console.warn !== \"function\") {\n return;\n }\n if (warningDisplayed) {\n return;\n }\n // Check environment variable to suppress warning (e.g., for testing)\n // Use bracket notation to avoid TypeScript index signature error\n if (typeof process !== \"undefined\" && process.env && process.env['MY_SUPER_FRAMEWORK_SUPPRESS_WARNING'] === \"true\") {\n return;\n }\n\n const border = `${COLORS.GRAY}${\"=\".repeat(80)}${COLORS.RESET}`;\n const label = `${COLORS.YELLOW}${COLORS.BRIGHT}[WARNING]${COLORS.RESET}`;\n const highlight = `${COLORS.CYAN}`;\n\n console.warn(`\\n${border}`);\n console.warn(`${label} DEVELOPMENT VERSION IN USE`);\n console.warn(`${COLORS.GRAY}Library: ${COLORS.RESET}${highlight}${LIB_INFO.name}${COLORS.RESET}`);\n console.warn(`${COLORS.GRAY}Current Version: ${COLORS.RESET}${highlight}${LIB_INFO.currentVersion}${COLORS.RESET}`);\n console.warn(`${COLORS.GRAY}Previous Version: ${COLORS.RESET}${highlight}${LIB_INFO.previousVersion}${COLORS.RESET}`);\n console.warn(`${COLORS.GRAY}Architecture: ${COLORS.RESET}${highlight}CLI -> Framework (Full Refactor)${COLORS.RESET}`);\n console.warn(`\\n${COLORS.RED}${COLORS.BRIGHT}DO NOT USE IN PRODUCTION ENVIRONMENTS${COLORS.RESET}`);\n console.warn(`${COLORS.GRAY}API stability is not guaranteed. Breaking changes may occur without notice.${COLORS.RESET}`);\n console.warn(`${COLORS.GRAY}To suppress this warning, set env MY_SUPER_FRAMEWORK_SUPPRESS_WARNING=true${COLORS.RESET}`);\n console.warn(`${border}\\n`);\n\n warningDisplayed = true;\n }\n\n /**\n * Suppresses the development warning for this instance.\n * Useful when you need to programmatically disable the warning (e.g., in tests).\n */\n public suppressWarning(): void {\n warningDisplayed = true;\n }\n\n /**\n * Validates library stability status.\n * @throws Error if library is marked as unstable or under construction.\n */\n public ensureStable(): void {\n if (LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION) {\n const errorMessage = `${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Stability Check Failed${COLORS.RESET}\\n` +\n `${COLORS.GRAY}Library version ${LIB_INFO.currentVersion} is under active development.${COLORS.RESET}\\n` +\n `${COLORS.GRAY}Current status: ${LIB_INFO.status}${COLORS.RESET}`;\n\n throw new Error(stripAnsi(errorMessage));\n }\n }\n\n /**\n * Returns the current library version string.\n * @returns Version identifier in semver format.\n */\n public getVersion(): string {\n return LIB_INFO.currentVersion;\n }\n\n /**\n * Returns detailed library metadata.\n * @returns Readonly object containing library information.\n */\n public getInfo(): Readonly<typeof LIB_INFO> {\n return LIB_INFO;\n }\n}\n\n/**\n * Placeholder entry point for framework initialization.\n * Intentionally throws error to prevent usage during development phase.\n * @throws Error indicating framework is not ready for use.\n */\nexport function initFramework(): never {\n const message = `${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Initialization Blocked${COLORS.RESET}\\n` +\n `${COLORS.GRAY}Framework is undergoing complete architectural refactor.${COLORS.RESET}\\n` +\n `${COLORS.GRAY}Migration path: v${LIB_INFO.previousVersion} (CLI) -> v${LIB_INFO.currentVersion} (Framework)${COLORS.RESET}\\n` +\n `${COLORS.GRAY}Status: ${LIB_INFO.status}${COLORS.RESET}`;\n\n throw new Error(stripAnsi(message));\n}\n\n/**\n * Type guard to check if current version is stable.\n * @returns `false` if library is under construction, `true` otherwise.\n */\nexport function isStable(): boolean {\n return LIB_INFO.status !== LibraryStatus.UNDER_CONSTRUCTION;\n}\n\n/**\n * Throws an error if the library is not stable.\n * Use this at the start of your application to ensure you're not using an unstable version.\n * @throws Error when library is under construction.\n */\nexport function assertStable(): void {\n if (LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION) {\n throw new Error(\n `[${LIB_INFO.name}] Cannot use unstable version ${LIB_INFO.currentVersion} in production. ` +\n `Status: ${LIB_INFO.status}`\n );\n }\n}\n\n// Immediate execution block: displays warning upon module import (only once)\n// Does not throw to allow type-checking and development workflows\nif (isDevelopmentVersion()) {\n // Trigger singleton instantiation which displays the warning\n LibStatus.getInstance();\n}"],"names":["LibraryStatus"],"mappings":";;;;AAuBA,MAAM,MAAM,GAAG;AACb,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,IAAI,EAAE,UAAU;CACR;AAKEA;AAAZ,CAAA,UAAY,aAAa,EAAA;AAEvB,IAAA,aAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;AAEzC,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA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",
|
|
4
|
+
DEPRECATED = "DEPRECATED"
|
|
5
5
|
}
|
|
6
6
|
declare const LIB_INFO: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
declare function isDevelopmentVersion(): boolean
|
|
7
|
+
readonly name: "MySuperFramework";
|
|
8
|
+
readonly currentVersion: "2.0.1-dev";
|
|
9
|
+
readonly previousVersion: "1.0.2";
|
|
10
|
+
readonly status: LibraryStatus.UNDER_CONSTRUCTION;
|
|
11
|
+
readonly isDeprecated: true;
|
|
12
|
+
readonly message: "This version represents a complete architectural refactor from CLI to framework. Not stable.";
|
|
13
|
+
};
|
|
14
|
+
declare function isDevelopmentVersion(): boolean;
|
|
15
15
|
declare class LibStatus {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
private static instance;
|
|
17
|
+
private constructor();
|
|
18
|
+
static getInstance(): LibStatus;
|
|
19
|
+
private displayDeveloperWarning;
|
|
20
|
+
suppressWarning(): void;
|
|
21
|
+
ensureStable(): void;
|
|
22
|
+
getVersion(): string;
|
|
23
|
+
getInfo(): Readonly<typeof LIB_INFO>;
|
|
24
24
|
}
|
|
25
|
-
declare function initFramework(): never
|
|
26
|
-
declare function isStable(): boolean
|
|
27
|
-
declare function assertStable(): void
|
|
25
|
+
declare function initFramework(): never;
|
|
26
|
+
declare function isStable(): boolean;
|
|
27
|
+
declare function assertStable(): void;
|
|
28
28
|
|
|
29
|
-
export {
|
|
30
|
-
LIB_INFO,
|
|
31
|
-
LibStatus,
|
|
32
|
-
LibraryStatus,
|
|
33
|
-
assertStable,
|
|
34
|
-
initFramework,
|
|
35
|
-
isDevelopmentVersion,
|
|
36
|
-
isStable,
|
|
37
|
-
}
|
|
29
|
+
export { LIB_INFO, LibStatus, LibraryStatus, assertStable, initFramework, isDevelopmentVersion, isStable };
|
package/build/lib.mjs
CHANGED
|
@@ -1,136 +1,105 @@
|
|
|
1
1
|
const COLORS = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
var LibraryStatus
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})(LibraryStatus || (LibraryStatus = {}))
|
|
2
|
+
RESET: "\x1b[0m",
|
|
3
|
+
BRIGHT: "\x1b[1m",
|
|
4
|
+
YELLOW: "\x1b[33m",
|
|
5
|
+
RED: "\x1b[31m",
|
|
6
|
+
CYAN: "\x1b[36m",
|
|
7
|
+
GRAY: "\x1b[90m",
|
|
8
|
+
};
|
|
9
|
+
var LibraryStatus;
|
|
10
|
+
(function (LibraryStatus) {
|
|
11
|
+
LibraryStatus["UNDER_CONSTRUCTION"] = "UNDER_CONSTRUCTION";
|
|
12
|
+
LibraryStatus["STABLE"] = "STABLE";
|
|
13
|
+
LibraryStatus["DEPRECATED"] = "DEPRECATED";
|
|
14
|
+
})(LibraryStatus || (LibraryStatus = {}));
|
|
15
15
|
const LIB_INFO = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let warningDisplayed = false
|
|
16
|
+
name: "MySuperFramework",
|
|
17
|
+
currentVersion: "2.0.1-dev",
|
|
18
|
+
previousVersion: "1.0.2",
|
|
19
|
+
status: LibraryStatus.UNDER_CONSTRUCTION,
|
|
20
|
+
isDeprecated: true,
|
|
21
|
+
message: "This version represents a complete architectural refactor from CLI to framework. Not stable.",
|
|
22
|
+
};
|
|
23
|
+
let warningDisplayed = false;
|
|
25
24
|
function stripAnsi(text) {
|
|
26
|
-
|
|
25
|
+
return text.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
|
|
27
26
|
}
|
|
28
27
|
function isDevelopmentVersion() {
|
|
29
|
-
|
|
28
|
+
return LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION;
|
|
30
29
|
}
|
|
31
30
|
class LibStatus {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
suppressWarning() {
|
|
86
|
-
warningDisplayed = true
|
|
87
|
-
}
|
|
88
|
-
ensureStable() {
|
|
89
|
-
if (LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION) {
|
|
90
|
-
const errorMessage =
|
|
91
|
-
`${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Stability Check Failed${COLORS.RESET}\n` +
|
|
92
|
-
`${COLORS.GRAY}Library version ${LIB_INFO.currentVersion} is under active development.${COLORS.RESET}\n` +
|
|
93
|
-
`${COLORS.GRAY}Current status: ${LIB_INFO.status}${COLORS.RESET}`
|
|
94
|
-
throw new Error(stripAnsi(errorMessage))
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
getVersion() {
|
|
98
|
-
return LIB_INFO.currentVersion
|
|
99
|
-
}
|
|
100
|
-
getInfo() {
|
|
101
|
-
return LIB_INFO
|
|
102
|
-
}
|
|
31
|
+
static instance;
|
|
32
|
+
constructor() {
|
|
33
|
+
this.displayDeveloperWarning();
|
|
34
|
+
}
|
|
35
|
+
static getInstance() {
|
|
36
|
+
if (!LibStatus.instance) {
|
|
37
|
+
LibStatus.instance = new LibStatus();
|
|
38
|
+
}
|
|
39
|
+
return LibStatus.instance;
|
|
40
|
+
}
|
|
41
|
+
displayDeveloperWarning() {
|
|
42
|
+
if (typeof console === "undefined" || typeof console.warn !== "function") {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (warningDisplayed) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (typeof process !== "undefined" && process.env && process.env['MY_SUPER_FRAMEWORK_SUPPRESS_WARNING'] === "true") {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const border = `${COLORS.GRAY}${"=".repeat(80)}${COLORS.RESET}`;
|
|
52
|
+
const label = `${COLORS.YELLOW}${COLORS.BRIGHT}[WARNING]${COLORS.RESET}`;
|
|
53
|
+
const highlight = `${COLORS.CYAN}`;
|
|
54
|
+
console.warn(`\n${border}`);
|
|
55
|
+
console.warn(`${label} DEVELOPMENT VERSION IN USE`);
|
|
56
|
+
console.warn(`${COLORS.GRAY}Library: ${COLORS.RESET}${highlight}${LIB_INFO.name}${COLORS.RESET}`);
|
|
57
|
+
console.warn(`${COLORS.GRAY}Current Version: ${COLORS.RESET}${highlight}${LIB_INFO.currentVersion}${COLORS.RESET}`);
|
|
58
|
+
console.warn(`${COLORS.GRAY}Previous Version: ${COLORS.RESET}${highlight}${LIB_INFO.previousVersion}${COLORS.RESET}`);
|
|
59
|
+
console.warn(`${COLORS.GRAY}Architecture: ${COLORS.RESET}${highlight}CLI -> Framework (Full Refactor)${COLORS.RESET}`);
|
|
60
|
+
console.warn(`\n${COLORS.RED}${COLORS.BRIGHT}DO NOT USE IN PRODUCTION ENVIRONMENTS${COLORS.RESET}`);
|
|
61
|
+
console.warn(`${COLORS.GRAY}API stability is not guaranteed. Breaking changes may occur without notice.${COLORS.RESET}`);
|
|
62
|
+
console.warn(`${COLORS.GRAY}To suppress this warning, set env MY_SUPER_FRAMEWORK_SUPPRESS_WARNING=true${COLORS.RESET}`);
|
|
63
|
+
console.warn(`${border}\n`);
|
|
64
|
+
warningDisplayed = true;
|
|
65
|
+
}
|
|
66
|
+
suppressWarning() {
|
|
67
|
+
warningDisplayed = true;
|
|
68
|
+
}
|
|
69
|
+
ensureStable() {
|
|
70
|
+
if (LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION) {
|
|
71
|
+
const errorMessage = `${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Stability Check Failed${COLORS.RESET}\n` +
|
|
72
|
+
`${COLORS.GRAY}Library version ${LIB_INFO.currentVersion} is under active development.${COLORS.RESET}\n` +
|
|
73
|
+
`${COLORS.GRAY}Current status: ${LIB_INFO.status}${COLORS.RESET}`;
|
|
74
|
+
throw new Error(stripAnsi(errorMessage));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
getVersion() {
|
|
78
|
+
return LIB_INFO.currentVersion;
|
|
79
|
+
}
|
|
80
|
+
getInfo() {
|
|
81
|
+
return LIB_INFO;
|
|
82
|
+
}
|
|
103
83
|
}
|
|
104
84
|
function initFramework() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
throw new Error(stripAnsi(message))
|
|
85
|
+
const message = `${COLORS.RED}${COLORS.BRIGHT}[${LIB_INFO.name}] Initialization Blocked${COLORS.RESET}\n` +
|
|
86
|
+
`${COLORS.GRAY}Framework is undergoing complete architectural refactor.${COLORS.RESET}\n` +
|
|
87
|
+
`${COLORS.GRAY}Migration path: v${LIB_INFO.previousVersion} (CLI) -> v${LIB_INFO.currentVersion} (Framework)${COLORS.RESET}\n` +
|
|
88
|
+
`${COLORS.GRAY}Status: ${LIB_INFO.status}${COLORS.RESET}`;
|
|
89
|
+
throw new Error(stripAnsi(message));
|
|
111
90
|
}
|
|
112
91
|
function isStable() {
|
|
113
|
-
|
|
92
|
+
return LIB_INFO.status !== LibraryStatus.UNDER_CONSTRUCTION;
|
|
114
93
|
}
|
|
115
94
|
function assertStable() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
)
|
|
121
|
-
}
|
|
95
|
+
if (LIB_INFO.status === LibraryStatus.UNDER_CONSTRUCTION) {
|
|
96
|
+
throw new Error(`[${LIB_INFO.name}] Cannot use unstable version ${LIB_INFO.currentVersion} in production. ` +
|
|
97
|
+
`Status: ${LIB_INFO.status}`);
|
|
98
|
+
}
|
|
122
99
|
}
|
|
123
100
|
if (isDevelopmentVersion()) {
|
|
124
|
-
|
|
101
|
+
LibStatus.getInstance();
|
|
125
102
|
}
|
|
126
103
|
|
|
127
|
-
export {
|
|
128
|
-
LIB_INFO,
|
|
129
|
-
LibStatus,
|
|
130
|
-
LibraryStatus,
|
|
131
|
-
assertStable,
|
|
132
|
-
initFramework,
|
|
133
|
-
isDevelopmentVersion,
|
|
134
|
-
isStable,
|
|
135
|
-
}
|
|
104
|
+
export { LIB_INFO, LibStatus, LibraryStatus, assertStable, initFramework, isDevelopmentVersion, isStable };
|
|
136
105
|
//# sourceMappingURL=lib.mjs.map
|