@kirill.konshin/node 0.0.2 → 0.0.3

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/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './measure';
1
+ export * from './measure.js';
2
2
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,7 +1,2 @@
1
1
  import { colored, createMeasurer, uncolored } from "./measure.js";
2
- export {
3
- colored,
4
- createMeasurer,
5
- uncolored
6
- };
7
- //# sourceMappingURL=index.js.map
2
+ export { colored, createMeasurer, uncolored };
package/dist/measure.js CHANGED
@@ -1,60 +1,65 @@
1
- import { green, red, yellow, cyan, magenta, bold } from "colors/safe";
2
- const colored = {
3
- important: bold,
4
- subject: magenta,
5
- arg: cyan,
6
- sup: yellow,
7
- err: red,
8
- ok: green
1
+ import { bold, cyan, green, magenta, red, yellow } from "colors/safe";
2
+ //#region src/measure.ts
3
+ var colored = {
4
+ important: bold,
5
+ subject: magenta,
6
+ arg: cyan,
7
+ sup: yellow,
8
+ err: red,
9
+ ok: green
9
10
  };
10
- const noColor = (str) => str;
11
- const uncolored = {
12
- important: noColor,
13
- subject: noColor,
14
- arg: noColor,
15
- sup: noColor,
16
- err: noColor,
17
- ok: noColor
11
+ var noColor = (str) => str;
12
+ var uncolored = {
13
+ important: noColor,
14
+ subject: noColor,
15
+ arg: noColor,
16
+ sup: noColor,
17
+ err: noColor,
18
+ ok: noColor
18
19
  };
19
- function createMeasurer({
20
- colors = true,
21
- prepend = "LOG",
22
- padding = 10
23
- }) {
24
- const { important, subject, arg, sup, ok, err } = colors ? colored : uncolored;
25
- function measure(what, step, supplemental = "", ...args) {
26
- const time = performance.now();
27
- const prefix = [
28
- prepend,
29
- important(subject(what.substring(0, padding).padStart(padding, " "))),
30
- arg(step),
31
- sup(supplemental),
32
- ...args
33
- ];
34
- const done = (result = ok("DONE"), ...args2) => {
35
- console.log(
36
- ...[
37
- ...prefix,
38
- important(result),
39
- ...args2,
40
- "in",
41
- important((performance.now() - time).toFixed(0)),
42
- "ms"
43
- ].filter(Boolean)
44
- );
45
- console.groupEnd();
46
- };
47
- const fail = (result = err("FAIL"), ...args2) => done(result, ...args2);
48
- const log = (...args2) => {
49
- console.log(...prefix, ...args2);
50
- };
51
- return { done, fail, log };
52
- }
53
- return { measure, important, subject, arg, sup, ok, err };
20
+ function createMeasurer({ colors = true, prepend = "LOG", padding = 10 }) {
21
+ const { important, subject, arg, sup, ok, err } = colors ? colored : uncolored;
22
+ function measure(what, step, supplemental = "", ...args) {
23
+ const time = performance.now();
24
+ const prefix = [
25
+ prepend,
26
+ important(subject(what.substring(0, padding).padStart(padding, " "))),
27
+ arg(step),
28
+ sup(supplemental),
29
+ ...args
30
+ ];
31
+ const done = (result = ok("DONE"), ...args2) => {
32
+ console.log(...[
33
+ ...prefix,
34
+ important(result),
35
+ ...args2,
36
+ "in",
37
+ important((performance.now() - time).toFixed(0)),
38
+ "ms"
39
+ ].filter(Boolean));
40
+ console.groupEnd();
41
+ };
42
+ const fail = (result = err("FAIL"), ...args2) => done(result, ...args2);
43
+ const log = (...args2) => {
44
+ console.log(...prefix, ...args2);
45
+ };
46
+ return {
47
+ done,
48
+ fail,
49
+ log
50
+ };
51
+ }
52
+ return {
53
+ measure,
54
+ important,
55
+ subject,
56
+ arg,
57
+ sup,
58
+ ok,
59
+ err
60
+ };
54
61
  }
55
- export {
56
- colored,
57
- createMeasurer,
58
- uncolored
59
- };
60
- //# sourceMappingURL=measure.js.map
62
+ //#endregion
63
+ export { colored, createMeasurer, uncolored };
64
+
65
+ //# sourceMappingURL=measure.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"measure.js","sources":["../src/measure.ts"],"sourcesContent":["import { bold, magenta, cyan, yellow, red, green } from 'colors/safe';\n\nexport const colored: {\n important: typeof bold;\n subject: typeof magenta;\n arg: typeof cyan;\n sup: typeof yellow;\n err: typeof red;\n ok: typeof green;\n} = {\n important: bold,\n subject: magenta,\n arg: cyan,\n sup: yellow,\n err: red,\n ok: green,\n};\n\nconst noColor = (str) => str;\n\nexport const uncolored: {\n important: (str: any) => any;\n subject: (str: any) => any;\n arg: (str: any) => any;\n sup: (str: any) => any;\n err: (str: any) => any;\n ok: (str: any) => any;\n} = {\n important: noColor,\n subject: noColor,\n arg: noColor,\n sup: noColor,\n err: noColor,\n ok: noColor,\n};\n\nexport function createMeasurer({\n colors = true,\n prepend = 'LOG',\n padding = 10,\n}: {\n colors?: boolean;\n prepend?: string;\n padding?: number;\n}): {\n measure: (\n what: string,\n step: string,\n supplemental?: string,\n ...args: any[]\n ) => {\n done: (result?: string, ...args2: any[]) => void;\n fail: (result?: string, ...args2: any[]) => void;\n log: (...args2: any[]) => void;\n };\n important: (str: any) => any;\n subject: (str: any) => any;\n arg: (str: any) => any;\n sup: (str: any) => any;\n ok: (str: any) => any;\n err: (str: any) => any;\n} {\n const { important, subject, arg, sup, ok, err } = colors ? colored : uncolored;\n\n function measure(\n what: string,\n step: string,\n supplemental: string = '',\n ...args: any[]\n ): {\n done: (result?: string, ...args2: any[]) => void;\n fail: (result?: string, ...args2: any[]) => void;\n log: (...args2: any[]) => void;\n } {\n const time = performance.now();\n\n const prefix = [\n prepend,\n important(subject(what.substring(0, padding).padStart(padding, ' '))),\n arg(step),\n sup(supplemental),\n ...args,\n ];\n\n const done = (result: string = ok('DONE'), ...args2: any[]): void => {\n console.log(\n ...[\n ...prefix,\n important(result),\n ...args2,\n 'in',\n important((performance.now() - time).toFixed(0)),\n 'ms',\n ].filter(Boolean),\n );\n console.groupEnd();\n };\n\n const fail = (result: string = err('FAIL'), ...args2: any[]): void => done(result, ...args2);\n\n const log = (...args2: any[]): void => {\n console.log(...prefix, ...args2);\n };\n\n return { done, fail, log };\n }\n\n return { measure, important, subject, arg, sup, ok, err };\n}\n"],"names":[],"mappings":";AAEO,MAAM,UAOT;AAAA,EACA,WAAW;AAAA,EACX,SAAS;AAAA,EACT,KAAK;AAAA,EACL,K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.js","names":[],"sources":["../src/measure.ts"],"sourcesContent":["import { bold, magenta, cyan, yellow, red, green } from 'colors/safe';\n\nexport const colored: {\n important: typeof bold;\n subject: typeof magenta;\n arg: typeof cyan;\n sup: typeof yellow;\n err: typeof red;\n ok: typeof green;\n} = {\n important: bold,\n subject: magenta,\n arg: cyan,\n sup: yellow,\n err: red,\n ok: green,\n};\n\nconst noColor = (str) => str;\n\nexport const uncolored: {\n important: (str: any) => any;\n subject: (str: any) => any;\n arg: (str: any) => any;\n sup: (str: any) => any;\n err: (str: any) => any;\n ok: (str: any) => any;\n} = {\n important: noColor,\n subject: noColor,\n arg: noColor,\n sup: noColor,\n err: noColor,\n ok: noColor,\n};\n\nexport function createMeasurer({\n colors = true,\n prepend = 'LOG',\n padding = 10,\n}: {\n colors?: boolean;\n prepend?: string;\n padding?: number;\n}): {\n measure: (\n what: string,\n step: string,\n supplemental?: string,\n ...args: any[]\n ) => {\n done: (result?: string, ...args2: any[]) => void;\n fail: (result?: string, ...args2: any[]) => void;\n log: (...args2: any[]) => void;\n };\n important: (str: any) => any;\n subject: (str: any) => any;\n arg: (str: any) => any;\n sup: (str: any) => any;\n ok: (str: any) => any;\n err: (str: any) => any;\n} {\n const { important, subject, arg, sup, ok, err } = colors ? colored : uncolored;\n\n function measure(\n what: string,\n step: string,\n supplemental: string = '',\n ...args: any[]\n ): {\n done: (result?: string, ...args2: any[]) => void;\n fail: (result?: string, ...args2: any[]) => void;\n log: (...args2: any[]) => void;\n } {\n const time = performance.now();\n\n const prefix = [\n prepend,\n important(subject(what.substring(0, padding).padStart(padding, ' '))),\n arg(step),\n sup(supplemental),\n ...args,\n ];\n\n const done = (result: string = ok('DONE'), ...args2: any[]): void => {\n console.log(\n ...[\n ...prefix,\n important(result),\n ...args2,\n 'in',\n important((performance.now() - time).toFixed(0)),\n 'ms',\n ].filter(Boolean),\n );\n console.groupEnd();\n };\n\n const fail = (result: string = err('FAIL'), ...args2: any[]): void => done(result, ...args2);\n\n const log = (...args2: any[]): void => {\n console.log(...prefix, ...args2);\n };\n\n return { done, fail, log };\n }\n\n return { measure, important, subject, arg, sup, ok, err };\n}\n"],"mappings":";;AAEA,IAAa,UAOT;CACA,WAAW;CACX,SAAS;CACT,KAAK;CACL,KAAK;CACL,KAAK;CACL,IAAI;AACR;AAEA,IAAM,WAAW,QAAQ;AAEzB,IAAa,YAOT;CACA,WAAW;CACX,SAAS;CACT,KAAK;CACL,KAAK;CACL,KAAK;CACL,IAAI;AACR;AAEA,SAAgB,eAAe,EAC3B,SAAS,MACT,UAAU,OACV,UAAU,MAsBZ;CACE,MAAM,EAAE,WAAW,SAAS,KAAK,KAAK,IAAI,QAAQ,SAAS,UAAU;CAErE,SAAS,QACL,MACA,MACA,eAAuB,IACvB,GAAG,MAKL;EACE,MAAM,OAAO,YAAY,IAAI;EAE7B,MAAM,SAAS;GACX;GACA,UAAU,QAAQ,KAAK,UAAU,GAAG,OAAO,CAAC,CAAC,SAAS,SAAS,GAAG,CAAC,CAAC;GACpE,IAAI,IAAI;GACR,IAAI,YAAY;GAChB,GAAG;EACP;EAEA,MAAM,QAAQ,SAAiB,GAAG,MAAM,GAAG,GAAG,UAAuB;GACjE,QAAQ,IACJ,GAAG;IACC,GAAG;IACH,UAAU,MAAM;IAChB,GAAG;IACH;IACA,WAAW,YAAY,IAAI,IAAI,KAAA,CAAM,QAAQ,CAAC,CAAC;IAC/C;GACJ,CAAC,CAAC,OAAO,OAAO,CACpB;GACA,QAAQ,SAAS;EACrB;EAEA,MAAM,QAAQ,SAAiB,IAAI,MAAM,GAAG,GAAG,UAAuB,KAAK,QAAQ,GAAG,KAAK;EAE3F,MAAM,OAAO,GAAG,UAAuB;GACnC,QAAQ,IAAI,GAAG,QAAQ,GAAG,KAAK;EACnC;EAEA,OAAO;GAAE;GAAM;GAAM;EAAI;CAC7B;CAEA,OAAO;EAAE;EAAS;EAAW;EAAS;EAAK;EAAK;EAAI;CAAI;AAC5D"}
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "name": "@kirill.konshin/node",
3
3
  "description": "Node Utilities",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "----- BUILD -----": "",
8
8
  "clean": "rm -rf dist .tscache tsconfig.tsbuildinfo",
9
9
  "build": "vite build",
10
- "build:index": "ctix build",
11
- "build:check-types": "attw --pack .",
12
10
  "start": "yarn build --watch",
13
11
  "wait": "wait-on ./dist/index.js",
14
12
  "----- TEST -----": "",
@@ -40,5 +38,17 @@
40
38
  "main": "./dist/index.js",
41
39
  "module": "./dist/index.js",
42
40
  "types": "./dist/index.d.ts",
43
- "peerDependenciesMeta": {}
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/kirill-konshin/utils.git",
44
+ "directory": "packages/node"
45
+ },
46
+ "nx": {
47
+ "tags": [
48
+ "platform:node"
49
+ ]
50
+ },
51
+ "files": [
52
+ "dist"
53
+ ]
44
54
  }
package/.ctirc DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "options": [
3
- {
4
- "mode": "create",
5
- "project": "tsconfig.json",
6
- "include": "src/**/*.{ts,tsx}",
7
- "exclude": [
8
- "**/*.stories.*",
9
- "**/*.test.*",
10
- "**/*.fixture.*"
11
- ],
12
- "startFrom": "src",
13
- "backup": false,
14
- "overwrite": true,
15
- "generationStyle": "default-alias-named-star",
16
- "output": "src",
17
- "verbose": true
18
- }
19
- ]
20
- }
@@ -1,20 +0,0 @@
1
- vite v7.0.6 building SSR bundle for production...
2
- - ctix 'create' mode start, ...
3
- ✔ /home/runner/work/utils/utils/packages/node/tsconfig.json loading complete!
4
- ✔ analysis export statements completed!
5
- - build "index.ts" file start
6
- - output file exists check, ...
7
-
8
-
9
- ✔ ctix 'create' mode complete!
10
- transforming...
11
- ✓ 2 modules transformed.
12
- rendering chunks...
13
-
14
- [vite:dts] Start generate declaration files...
15
- dist/index.js 0.15 kB │ map: 0.09 kB
16
- dist/measure.js 1.44 kB │ map: 4.08 kB
17
- [vite:dts] Declaration files built in 1514ms.
18
-
19
- ✓ built in 4.72s
20
- Updated package.json with exports
@@ -1,29 +0,0 @@
1
- - ctix 'create' mode start, ...
2
- ✔ /home/runner/work/utils/utils/packages/node/tsconfig.json loading complete!
3
- ✔ analysis export statements completed!
4
- - build "index.ts" file start
5
- - output file exists check, ...
6
-
7
-
8
- ✔ ctix 'create' mode complete!
9
-
10
-  RUN  v3.2.4 /home/runner/work/utils/utils/packages/node
11
- Coverage enabled with v8
12
-
13
- ↓ src/measure.test.ts (1 test | 1 skipped)
14
-
15
-  Test Files  1 skipped (1)
16
-  Tests  1 skipped (1)
17
-  Start at  03:26:51
18
-  Duration  358ms (transform 32ms, setup 0ms, collect 18ms, tests 0ms, environment 0ms, prepare 81ms)
19
-
20
-  % Coverage report from v8
21
- ------------|---------|----------|---------|---------|-------------------
22
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
23
- ------------|---------|----------|---------|---------|-------------------
24
- All files | 0 | 0 | 0 | 0 |
25
- index.ts | 0 | 0 | 0 | 0 | 1
26
- measure.ts | 0 | 0 | 0 | 0 | 1-109
27
- ------------|---------|----------|---------|---------|-------------------
28
- Updated package.json with exports
29
- Updated package.json with exports
package/CHANGELOG.md DELETED
@@ -1,7 +0,0 @@
1
- # @kirill.konshin/node
2
-
3
- ## 0.0.2
4
-
5
- ### Patch Changes
6
-
7
- - 63fdba8: Divided core to browser/node/worker-specific packages, CTIX upgrade, etc.
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=measure.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"measure.test.d.ts","sourceRoot":"","sources":["../src/measure.test.ts"],"names":[],"mappings":""}
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './measure';
@@ -1,3 +0,0 @@
1
- import { expect, describe, test, vi } from 'vitest';
2
-
3
- test.skip('Dummy', () => {});
package/src/measure.ts DELETED
@@ -1,109 +0,0 @@
1
- import { bold, magenta, cyan, yellow, red, green } from 'colors/safe';
2
-
3
- export const colored: {
4
- important: typeof bold;
5
- subject: typeof magenta;
6
- arg: typeof cyan;
7
- sup: typeof yellow;
8
- err: typeof red;
9
- ok: typeof green;
10
- } = {
11
- important: bold,
12
- subject: magenta,
13
- arg: cyan,
14
- sup: yellow,
15
- err: red,
16
- ok: green,
17
- };
18
-
19
- const noColor = (str) => str;
20
-
21
- export const uncolored: {
22
- important: (str: any) => any;
23
- subject: (str: any) => any;
24
- arg: (str: any) => any;
25
- sup: (str: any) => any;
26
- err: (str: any) => any;
27
- ok: (str: any) => any;
28
- } = {
29
- important: noColor,
30
- subject: noColor,
31
- arg: noColor,
32
- sup: noColor,
33
- err: noColor,
34
- ok: noColor,
35
- };
36
-
37
- export function createMeasurer({
38
- colors = true,
39
- prepend = 'LOG',
40
- padding = 10,
41
- }: {
42
- colors?: boolean;
43
- prepend?: string;
44
- padding?: number;
45
- }): {
46
- measure: (
47
- what: string,
48
- step: string,
49
- supplemental?: string,
50
- ...args: any[]
51
- ) => {
52
- done: (result?: string, ...args2: any[]) => void;
53
- fail: (result?: string, ...args2: any[]) => void;
54
- log: (...args2: any[]) => void;
55
- };
56
- important: (str: any) => any;
57
- subject: (str: any) => any;
58
- arg: (str: any) => any;
59
- sup: (str: any) => any;
60
- ok: (str: any) => any;
61
- err: (str: any) => any;
62
- } {
63
- const { important, subject, arg, sup, ok, err } = colors ? colored : uncolored;
64
-
65
- function measure(
66
- what: string,
67
- step: string,
68
- supplemental: string = '',
69
- ...args: any[]
70
- ): {
71
- done: (result?: string, ...args2: any[]) => void;
72
- fail: (result?: string, ...args2: any[]) => void;
73
- log: (...args2: any[]) => void;
74
- } {
75
- const time = performance.now();
76
-
77
- const prefix = [
78
- prepend,
79
- important(subject(what.substring(0, padding).padStart(padding, ' '))),
80
- arg(step),
81
- sup(supplemental),
82
- ...args,
83
- ];
84
-
85
- const done = (result: string = ok('DONE'), ...args2: any[]): void => {
86
- console.log(
87
- ...[
88
- ...prefix,
89
- important(result),
90
- ...args2,
91
- 'in',
92
- important((performance.now() - time).toFixed(0)),
93
- 'ms',
94
- ].filter(Boolean),
95
- );
96
- console.groupEnd();
97
- };
98
-
99
- const fail = (result: string = err('FAIL'), ...args2: any[]): void => done(result, ...args2);
100
-
101
- const log = (...args2: any[]): void => {
102
- console.log(...prefix, ...args2);
103
- };
104
-
105
- return { done, fail, log };
106
- }
107
-
108
- return { measure, important, subject, arg, sup, ok, err };
109
- }
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../utils-private/tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "dist",
6
- "declarationDir": "dist"
7
- },
8
- "include": ["src"],
9
- "exclude": []
10
- }
package/turbo.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://turbo.build/schema.json",
3
- "extends": ["//"],
4
- "tasks": {
5
- "build": {
6
- "dependsOn": ["^build"],
7
- "outputs": ["src/**/*/index.ts", "package.json", "dist/**/*"]
8
- }
9
- }
10
- }
package/vite.config.ts DELETED
@@ -1,2 +0,0 @@
1
- import config from '../utils-private/vite.config';
2
- export default config;