react-lib-tools 0.0.11 → 0.0.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-lib-tools",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "author": "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
6
6
  "contributors": [
@@ -1,3 +1,4 @@
1
+ import type { AnalyserOptions } from "@ts-ast-parser/core";
1
2
  import { compileComponents } from "./utils/docs/compileComponents.ts";
2
3
  import { compileImperativeHandles } from "./utils/docs/compileImperativeHandles.ts";
3
4
  import type { CompilerOptions } from "typescript";
@@ -10,19 +11,25 @@ import {
10
11
  } from "typescript";
11
12
 
12
13
  export async function compileDocs({
13
- compilerOptions: compilerOptionsParam,
14
- componentNames,
15
- imperativeHandleNames,
14
+ analyserOptions: analyserOptionsParam,
15
+ componentNames = [],
16
+ imperativeHandleNames = [],
16
17
  outputDirName = "docs"
17
18
  }: {
18
- compilerOptions?: Partial<CompilerOptions>;
19
- componentNames: string[];
20
- imperativeHandleNames: string[];
19
+ analyserOptions?: Partial<AnalyserOptions>;
20
+ componentNames?: string[] | undefined;
21
+ imperativeHandleNames?: string[] | undefined;
21
22
  outputDirName?: string | undefined;
22
23
  }) {
23
- const compilerOptions = {
24
+ const compilerOptions: Partial<CompilerOptions> = {
24
25
  ...defaultCompilerOptions,
25
- ...compilerOptionsParam
26
+ ...(analyserOptionsParam?.compilerOptions as CompilerOptions)
27
+ };
28
+
29
+ const analyserOptions: Partial<AnalyserOptions> = {
30
+ ...analyserOptionsParam,
31
+ compilerOptions,
32
+ include: ["lib"]
26
33
  };
27
34
 
28
35
  await compileComponents({
@@ -32,7 +39,7 @@ export async function compileDocs({
32
39
  });
33
40
 
34
41
  await compileImperativeHandles({
35
- compilerOptions,
42
+ analyserOptions,
36
43
  names: imperativeHandleNames,
37
44
  outputDirName
38
45
  });
@@ -26,7 +26,9 @@ export async function compileComponents({
26
26
  const { files, outputDir } = await initialize({
27
27
  fileExtensions: [".ts", ".tsx"],
28
28
  fileFilter: (file) =>
29
- componentNames.some((componentName) => file.endsWith(componentName)),
29
+ componentNames.some((componentName) =>
30
+ file.includes(`${componentName}.ts`)
31
+ ),
30
32
  inputPath: ["lib", "components"],
31
33
  outputDirName
32
34
  });
@@ -1,21 +1,24 @@
1
- import { parseFromProject, type InterfaceNode } from "@ts-ast-parser/core";
1
+ import {
2
+ parseFromProject,
3
+ type AnalyserOptions,
4
+ type InterfaceNode
5
+ } from "@ts-ast-parser/core";
2
6
  import { join } from "node:path";
3
7
  import { cwd } from "node:process";
4
- import type { CompilerOptions } from "typescript";
5
8
  import { compileImperativeHandle } from "./compileImperativeHandle.ts";
6
9
 
7
10
  export async function compileImperativeHandles({
8
- compilerOptions,
11
+ analyserOptions,
9
12
  names,
10
13
  outputDirName
11
14
  }: {
12
- compilerOptions: Partial<CompilerOptions>;
15
+ analyserOptions: Partial<AnalyserOptions>;
13
16
  names: string[];
14
17
  outputDirName: string;
15
18
  }) {
16
19
  const outputDir = join(cwd(), "public", "generated", outputDirName);
17
20
 
18
- const result = await parseFromProject({ compilerOptions });
21
+ const result = await parseFromProject(analyserOptions);
19
22
  const reflectedModules = result.project?.getModules() ?? [];
20
23
 
21
24
  const nodes: {
package/styles.css CHANGED
@@ -27,15 +27,28 @@
27
27
  }
28
28
  }
29
29
 
30
+ @theme {
31
+ --color-background-gradient-1: var(--color-fuchsia-500);
32
+ --color-background-gradient-2: var(--color-violet-500);
33
+ --color-background-gradient-3: var(--color-fuchsia-700);
34
+
35
+ --color-focus-1: var(--color-sky-300);
36
+ --color-focus-2: var(--color-sky-400);
37
+ --color-focus-3: var(--color-sky-600);
38
+
39
+ --color-nav-active: var(--color-fuchsia-400);
40
+ --color-nav-hover: var(--color-fuchsia-200);
41
+ }
42
+
30
43
  #root {
31
44
  width: 100dvw;
32
45
  height: 100dvh;
33
46
  overflow: auto;
34
47
  background: linear-gradient(
35
48
  -45deg,
36
- var(--template-gradient-color-1),
37
- var(--template-gradient-color-2),
38
- var(--template-gradient-color-3)
49
+ var(--color-background-gradient-1),
50
+ var(--color-background-gradient-2),
51
+ var(--color-background-gradient-3)
39
52
  );
40
53
  background-size: 400% 400%;
41
54
  animation: background-gradient-animation 20s ease infinite;
@@ -57,9 +70,9 @@ main {
57
70
  [data-link],
58
71
  a {
59
72
  cursor: pointer;
60
- color: var(--template-focus-color-400);
73
+ color: var(--color-focus-2);
61
74
  &:hover {
62
- color: var(--template-focus-color-300);
75
+ color: var(--color-focus-1);
63
76
  }
64
77
  }
65
78
  }
@@ -67,20 +80,20 @@ main {
67
80
  *[data-focus] {
68
81
  border: 2px solid transparent;
69
82
  &:focus {
70
- border: 2px solid var(--template-focus-color-300);
83
+ border: 2px solid var(--color-focus-1);
71
84
  }
72
85
  }
73
86
 
74
87
  *[data-focus-within] {
75
88
  border: 2px solid transparent;
76
89
  &:focus-within {
77
- border: 2px solid var(--template-focus-color-300);
90
+ border: 2px solid var(--color-focus-1);
78
91
  }
79
92
 
80
93
  &[data-focus-within="bold"] {
81
- border-color: var(--template-focus-color-600);
94
+ border-color: var(--color-focus-3);
82
95
  &:focus-within {
83
- border: 2px solid var(--template-focus-color-300);
96
+ border: 2px solid var(--color-focus-1);
84
97
  }
85
98
  }
86
99
  }
@@ -106,6 +119,7 @@ code {
106
119
  .tok-operator {
107
120
  color: var(--color-slate-400);
108
121
  }
122
+ .tok-labelName,
109
123
  .tok-propertyName {
110
124
  color: var(--color-sky-300);
111
125
  }