@djodjonx/neo-syringe 1.2.0 → 1.2.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/.github/workflows/docs.yml +59 -0
- package/CHANGELOG.md +14 -0
- package/README.md +72 -779
- package/dist/cli/index.cjs +15 -0
- package/dist/cli/index.mjs +15 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/unplugin/index.cjs +31 -7
- package/dist/unplugin/index.d.cts +7 -5
- package/dist/unplugin/index.d.mts +7 -5
- package/dist/unplugin/index.mjs +31 -7
- package/docs/.vitepress/config.ts +109 -0
- package/docs/.vitepress/theme/custom.css +150 -0
- package/docs/.vitepress/theme/index.ts +17 -0
- package/docs/api/configuration.md +274 -0
- package/docs/api/functions.md +291 -0
- package/docs/api/types.md +158 -0
- package/docs/guide/basic-usage.md +267 -0
- package/docs/guide/cli.md +174 -0
- package/docs/guide/generated-code.md +284 -0
- package/docs/guide/getting-started.md +171 -0
- package/docs/guide/ide-plugin.md +203 -0
- package/docs/guide/injection-types.md +287 -0
- package/docs/guide/legacy-migration.md +333 -0
- package/docs/guide/lifecycle.md +223 -0
- package/docs/guide/parent-container.md +321 -0
- package/docs/guide/scoped-injections.md +271 -0
- package/docs/guide/what-is-neo-syringe.md +162 -0
- package/docs/guide/why-neo-syringe.md +219 -0
- package/docs/index.md +138 -0
- package/docs/public/logo.png +0 -0
- package/package.json +5 -3
- package/src/analyzer/types.ts +52 -52
- package/src/cli/index.ts +15 -0
- package/src/generator/Generator.ts +23 -1
- package/src/types.ts +1 -1
- package/src/unplugin/index.ts +13 -41
- package/tests/analyzer/AnalyzerDeclarative.test.ts +1 -1
- package/tests/e2e/container-integration.test.ts +19 -19
- package/tests/e2e/generated-code.test.ts +2 -2
- package/tsconfig.json +2 -1
- package/typedoc.json +0 -5
package/dist/cli/index.cjs
CHANGED
|
@@ -4,6 +4,21 @@ let typescript = require("typescript");
|
|
|
4
4
|
typescript = require_GraphValidator.__toESM(typescript);
|
|
5
5
|
|
|
6
6
|
//#region src/cli/index.ts
|
|
7
|
+
/**
|
|
8
|
+
* Neo-Syringe CLI
|
|
9
|
+
*
|
|
10
|
+
* Validates the dependency graph for a TypeScript project.
|
|
11
|
+
* Detects circular dependencies, missing bindings, and duplicate registrations.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```bash
|
|
15
|
+
* npx neo-syringe
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* CLI entry point.
|
|
20
|
+
* Reads tsconfig.json, analyzes the project, and validates the dependency graph.
|
|
21
|
+
*/
|
|
7
22
|
function main() {
|
|
8
23
|
const cwd = process.cwd();
|
|
9
24
|
const configPath = typescript.findConfigFile(cwd, typescript.sys.fileExists, "tsconfig.json");
|
package/dist/cli/index.mjs
CHANGED
|
@@ -3,6 +3,21 @@ import { n as Analyzer, t as GraphValidator } from "../GraphValidator-DXqqkNdS.m
|
|
|
3
3
|
import * as ts from "typescript";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Neo-Syringe CLI
|
|
8
|
+
*
|
|
9
|
+
* Validates the dependency graph for a TypeScript project.
|
|
10
|
+
* Detects circular dependencies, missing bindings, and duplicate registrations.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```bash
|
|
14
|
+
* npx neo-syringe
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* CLI entry point.
|
|
19
|
+
* Reads tsconfig.json, analyzes the project, and validates the dependency graph.
|
|
20
|
+
*/
|
|
6
21
|
function main() {
|
|
7
22
|
const cwd = process.cwd();
|
|
8
23
|
const configPath = ts.findConfigFile(cwd, ts.sys.fileExists, "tsconfig.json");
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Represents a generic class constructor.
|
|
4
4
|
* @template T - The type of the instance created by the constructor.
|
|
5
5
|
*/
|
|
6
|
-
type Constructor<T =
|
|
6
|
+
type Constructor<T = any> = new (...args: any[]) => T;
|
|
7
7
|
/**
|
|
8
8
|
* Defines the lifecycle of a service.
|
|
9
9
|
* - `singleton`: One instance per container.
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Represents a generic class constructor.
|
|
4
4
|
* @template T - The type of the instance created by the constructor.
|
|
5
5
|
*/
|
|
6
|
-
type Constructor<T =
|
|
6
|
+
type Constructor<T = any> = new (...args: any[]) => T;
|
|
7
7
|
/**
|
|
8
8
|
* Defines the lifecycle of a service.
|
|
9
9
|
* - `singleton`: One instance per container.
|
package/dist/unplugin/index.cjs
CHANGED
|
@@ -5,12 +5,25 @@ typescript = require_GraphValidator.__toESM(typescript);
|
|
|
5
5
|
|
|
6
6
|
//#region src/generator/Generator.ts
|
|
7
7
|
/**
|
|
8
|
-
* Generates
|
|
8
|
+
* Generates TypeScript code for the dependency injection container.
|
|
9
|
+
*
|
|
10
|
+
* Takes a validated dependency graph and produces:
|
|
11
|
+
* - Import statements for all dependencies
|
|
12
|
+
* - Factory functions for each service
|
|
13
|
+
* - A NeoContainer class with resolve logic
|
|
9
14
|
*/
|
|
10
15
|
var Generator = class {
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new Generator.
|
|
18
|
+
* @param graph - The validated dependency graph to generate code from.
|
|
19
|
+
*/
|
|
11
20
|
constructor(graph) {
|
|
12
21
|
this.graph = graph;
|
|
13
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Generates the complete container code as a string.
|
|
25
|
+
* @returns TypeScript source code for the generated container.
|
|
26
|
+
*/
|
|
14
27
|
generate() {
|
|
15
28
|
const sorted = this.topologicalSort();
|
|
16
29
|
const imports = /* @__PURE__ */ new Map();
|
|
@@ -147,6 +160,10 @@ export class NeoContainer {
|
|
|
147
160
|
export const container = new NeoContainer(${containerArgs});
|
|
148
161
|
`;
|
|
149
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Sorts services in topological order (dependencies before dependents).
|
|
165
|
+
* @returns Array of TokenIds in dependency order.
|
|
166
|
+
*/
|
|
150
167
|
topologicalSort() {
|
|
151
168
|
const visited = /* @__PURE__ */ new Set();
|
|
152
169
|
const sorted = [];
|
|
@@ -162,6 +179,11 @@ export const container = new NeoContainer(${containerArgs});
|
|
|
162
179
|
for (const id of this.graph.nodes.keys()) visit(id);
|
|
163
180
|
return sorted;
|
|
164
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Creates a valid JavaScript function name from a token ID.
|
|
184
|
+
* @param tokenId - The token identifier.
|
|
185
|
+
* @returns A sanitized factory function name.
|
|
186
|
+
*/
|
|
165
187
|
getFactoryName(tokenId) {
|
|
166
188
|
return `create_${tokenId.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
167
189
|
}
|
|
@@ -170,21 +192,23 @@ export const container = new NeoContainer(${containerArgs});
|
|
|
170
192
|
//#endregion
|
|
171
193
|
//#region src/unplugin/index.ts
|
|
172
194
|
/**
|
|
173
|
-
*
|
|
195
|
+
* Neo-Syringe build plugin for Vite, Rollup, Webpack, and other bundlers.
|
|
174
196
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
197
|
+
* Intercepts files containing `defineBuilderConfig` calls, analyzes the
|
|
198
|
+
* dependency graph, validates it, and replaces the configuration with
|
|
199
|
+
* generated factory code.
|
|
178
200
|
*
|
|
179
201
|
* @example
|
|
202
|
+
* ```typescript
|
|
180
203
|
* // vite.config.ts
|
|
181
204
|
* import { neoSyringePlugin } from '@djodjonx/neo-syringe/plugin';
|
|
182
205
|
*
|
|
183
206
|
* export default defineConfig({
|
|
184
|
-
* plugins: [neoSyringePlugin.vite()]
|
|
207
|
+
* plugins: [neoSyringePlugin.vite()]
|
|
185
208
|
* });
|
|
209
|
+
* ```
|
|
186
210
|
*/
|
|
187
|
-
const neoSyringePlugin = (0, unplugin.createUnplugin)((
|
|
211
|
+
const neoSyringePlugin = (0, unplugin.createUnplugin)(() => {
|
|
188
212
|
return {
|
|
189
213
|
name: "neo-syringe-plugin",
|
|
190
214
|
transformInclude(id) {
|
|
@@ -2,19 +2,21 @@ import * as unplugin0 from "unplugin";
|
|
|
2
2
|
|
|
3
3
|
//#region src/unplugin/index.d.ts
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Neo-Syringe build plugin for Vite, Rollup, Webpack, and other bundlers.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Intercepts files containing `defineBuilderConfig` calls, analyzes the
|
|
8
|
+
* dependency graph, validates it, and replaces the configuration with
|
|
9
|
+
* generated factory code.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
|
+
* ```typescript
|
|
12
13
|
* // vite.config.ts
|
|
13
14
|
* import { neoSyringePlugin } from '@djodjonx/neo-syringe/plugin';
|
|
14
15
|
*
|
|
15
16
|
* export default defineConfig({
|
|
16
|
-
* plugins: [neoSyringePlugin.vite()]
|
|
17
|
+
* plugins: [neoSyringePlugin.vite()]
|
|
17
18
|
* });
|
|
19
|
+
* ```
|
|
18
20
|
*/
|
|
19
21
|
declare const neoSyringePlugin: unplugin0.UnpluginInstance<unknown, boolean>;
|
|
20
22
|
//#endregion
|
|
@@ -2,19 +2,21 @@ import * as unplugin0 from "unplugin";
|
|
|
2
2
|
|
|
3
3
|
//#region src/unplugin/index.d.ts
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Neo-Syringe build plugin for Vite, Rollup, Webpack, and other bundlers.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Intercepts files containing `defineBuilderConfig` calls, analyzes the
|
|
8
|
+
* dependency graph, validates it, and replaces the configuration with
|
|
9
|
+
* generated factory code.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
|
+
* ```typescript
|
|
12
13
|
* // vite.config.ts
|
|
13
14
|
* import { neoSyringePlugin } from '@djodjonx/neo-syringe/plugin';
|
|
14
15
|
*
|
|
15
16
|
* export default defineConfig({
|
|
16
|
-
* plugins: [neoSyringePlugin.vite()]
|
|
17
|
+
* plugins: [neoSyringePlugin.vite()]
|
|
17
18
|
* });
|
|
19
|
+
* ```
|
|
18
20
|
*/
|
|
19
21
|
declare const neoSyringePlugin: unplugin0.UnpluginInstance<unknown, boolean>;
|
|
20
22
|
//#endregion
|
package/dist/unplugin/index.mjs
CHANGED
|
@@ -4,12 +4,25 @@ import * as ts from "typescript";
|
|
|
4
4
|
|
|
5
5
|
//#region src/generator/Generator.ts
|
|
6
6
|
/**
|
|
7
|
-
* Generates
|
|
7
|
+
* Generates TypeScript code for the dependency injection container.
|
|
8
|
+
*
|
|
9
|
+
* Takes a validated dependency graph and produces:
|
|
10
|
+
* - Import statements for all dependencies
|
|
11
|
+
* - Factory functions for each service
|
|
12
|
+
* - A NeoContainer class with resolve logic
|
|
8
13
|
*/
|
|
9
14
|
var Generator = class {
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new Generator.
|
|
17
|
+
* @param graph - The validated dependency graph to generate code from.
|
|
18
|
+
*/
|
|
10
19
|
constructor(graph) {
|
|
11
20
|
this.graph = graph;
|
|
12
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Generates the complete container code as a string.
|
|
24
|
+
* @returns TypeScript source code for the generated container.
|
|
25
|
+
*/
|
|
13
26
|
generate() {
|
|
14
27
|
const sorted = this.topologicalSort();
|
|
15
28
|
const imports = /* @__PURE__ */ new Map();
|
|
@@ -146,6 +159,10 @@ export class NeoContainer {
|
|
|
146
159
|
export const container = new NeoContainer(${containerArgs});
|
|
147
160
|
`;
|
|
148
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Sorts services in topological order (dependencies before dependents).
|
|
164
|
+
* @returns Array of TokenIds in dependency order.
|
|
165
|
+
*/
|
|
149
166
|
topologicalSort() {
|
|
150
167
|
const visited = /* @__PURE__ */ new Set();
|
|
151
168
|
const sorted = [];
|
|
@@ -161,6 +178,11 @@ export const container = new NeoContainer(${containerArgs});
|
|
|
161
178
|
for (const id of this.graph.nodes.keys()) visit(id);
|
|
162
179
|
return sorted;
|
|
163
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Creates a valid JavaScript function name from a token ID.
|
|
183
|
+
* @param tokenId - The token identifier.
|
|
184
|
+
* @returns A sanitized factory function name.
|
|
185
|
+
*/
|
|
164
186
|
getFactoryName(tokenId) {
|
|
165
187
|
return `create_${tokenId.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
166
188
|
}
|
|
@@ -169,21 +191,23 @@ export const container = new NeoContainer(${containerArgs});
|
|
|
169
191
|
//#endregion
|
|
170
192
|
//#region src/unplugin/index.ts
|
|
171
193
|
/**
|
|
172
|
-
*
|
|
194
|
+
* Neo-Syringe build plugin for Vite, Rollup, Webpack, and other bundlers.
|
|
173
195
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
196
|
+
* Intercepts files containing `defineBuilderConfig` calls, analyzes the
|
|
197
|
+
* dependency graph, validates it, and replaces the configuration with
|
|
198
|
+
* generated factory code.
|
|
177
199
|
*
|
|
178
200
|
* @example
|
|
201
|
+
* ```typescript
|
|
179
202
|
* // vite.config.ts
|
|
180
203
|
* import { neoSyringePlugin } from '@djodjonx/neo-syringe/plugin';
|
|
181
204
|
*
|
|
182
205
|
* export default defineConfig({
|
|
183
|
-
* plugins: [neoSyringePlugin.vite()]
|
|
206
|
+
* plugins: [neoSyringePlugin.vite()]
|
|
184
207
|
* });
|
|
208
|
+
* ```
|
|
185
209
|
*/
|
|
186
|
-
const neoSyringePlugin = createUnplugin((
|
|
210
|
+
const neoSyringePlugin = createUnplugin(() => {
|
|
187
211
|
return {
|
|
188
212
|
name: "neo-syringe-plugin",
|
|
189
213
|
transformInclude(id) {
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { defineConfig } from 'vitepress'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
title: 'Neo-Syringe',
|
|
5
|
+
description: 'Zero-Overhead, Compile-Time Dependency Injection for TypeScript',
|
|
6
|
+
|
|
7
|
+
head: [
|
|
8
|
+
['link', { rel: 'icon', href: '/logo.png' }],
|
|
9
|
+
['meta', { name: 'theme-color', content: '#0d9488' }],
|
|
10
|
+
['meta', { property: 'og:type', content: 'website' }],
|
|
11
|
+
['meta', { property: 'og:title', content: 'Neo-Syringe' }],
|
|
12
|
+
['meta', { property: 'og:description', content: 'Zero-Overhead, Compile-Time Dependency Injection for TypeScript' }],
|
|
13
|
+
['meta', { property: 'og:image', content: '/logo.png' }],
|
|
14
|
+
],
|
|
15
|
+
|
|
16
|
+
base: '/neo-syringe/',
|
|
17
|
+
|
|
18
|
+
themeConfig: {
|
|
19
|
+
logo: '/logo.png',
|
|
20
|
+
|
|
21
|
+
nav: [
|
|
22
|
+
{ text: 'Guide', link: '/guide/getting-started' },
|
|
23
|
+
{ text: 'API', link: '/api/types' },
|
|
24
|
+
{
|
|
25
|
+
text: 'Examples',
|
|
26
|
+
items: [
|
|
27
|
+
{ text: 'Basic Usage', link: '/guide/basic-usage' },
|
|
28
|
+
{ text: 'Parent Container', link: '/guide/parent-container' },
|
|
29
|
+
{ text: 'Legacy Migration', link: '/guide/legacy-migration' },
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
text: 'Links',
|
|
34
|
+
items: [
|
|
35
|
+
{ text: 'GitHub', link: 'https://github.com/djodjonx/neo-syringe' },
|
|
36
|
+
{ text: 'NPM', link: 'https://www.npmjs.com/package/@djodjonx/neo-syringe' },
|
|
37
|
+
{ text: 'Changelog', link: 'https://github.com/djodjonx/neo-syringe/blob/main/CHANGELOG.md' },
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
|
|
42
|
+
sidebar: {
|
|
43
|
+
'/guide/': [
|
|
44
|
+
{
|
|
45
|
+
text: 'Introduction',
|
|
46
|
+
items: [
|
|
47
|
+
{ text: 'What is Neo-Syringe?', link: '/guide/what-is-neo-syringe' },
|
|
48
|
+
{ text: 'Getting Started', link: '/guide/getting-started' },
|
|
49
|
+
{ text: 'Why Neo-Syringe?', link: '/guide/why-neo-syringe' },
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
text: 'Core Concepts',
|
|
54
|
+
items: [
|
|
55
|
+
{ text: 'Basic Usage', link: '/guide/basic-usage' },
|
|
56
|
+
{ text: 'Injection Types', link: '/guide/injection-types' },
|
|
57
|
+
{ text: 'Lifecycle', link: '/guide/lifecycle' },
|
|
58
|
+
{ text: 'Scoped Injections', link: '/guide/scoped-injections' },
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
text: 'Advanced',
|
|
63
|
+
items: [
|
|
64
|
+
{ text: 'Parent Container', link: '/guide/parent-container' },
|
|
65
|
+
{ text: 'Legacy Migration', link: '/guide/legacy-migration' },
|
|
66
|
+
{ text: 'Generated Code', link: '/guide/generated-code' },
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
text: 'Tools',
|
|
71
|
+
items: [
|
|
72
|
+
{ text: 'CLI Validator', link: '/guide/cli' },
|
|
73
|
+
{ text: 'IDE Plugin', link: '/guide/ide-plugin' },
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
'/api/': [
|
|
78
|
+
{
|
|
79
|
+
text: 'API Reference',
|
|
80
|
+
items: [
|
|
81
|
+
{ text: 'Types', link: '/api/types' },
|
|
82
|
+
{ text: 'Functions', link: '/api/functions' },
|
|
83
|
+
{ text: 'Configuration', link: '/api/configuration' },
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
socialLinks: [
|
|
90
|
+
{ icon: 'github', link: 'https://github.com/djodjonx/neo-syringe' },
|
|
91
|
+
{ icon: 'npm', link: 'https://www.npmjs.com/package/@djodjonx/neo-syringe' }
|
|
92
|
+
],
|
|
93
|
+
|
|
94
|
+
footer: {
|
|
95
|
+
message: 'Released under the MIT License.',
|
|
96
|
+
copyright: 'Copyright © 2024-present Neo-Syringe Contributors'
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
search: {
|
|
100
|
+
provider: 'local'
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
editLink: {
|
|
104
|
+
pattern: 'https://github.com/djodjonx/neo-syringe/edit/main/docs/:path',
|
|
105
|
+
text: 'Edit this page on GitHub'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neo-Syringe Custom Theme
|
|
3
|
+
* Colors: Teal (#0d9488) + Orange (#f97316)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
/* Brand Colors */
|
|
8
|
+
--neo-teal: #0d9488;
|
|
9
|
+
--neo-teal-light: #14b8a6;
|
|
10
|
+
--neo-teal-dark: #0f766e;
|
|
11
|
+
--neo-orange: #f97316;
|
|
12
|
+
--neo-orange-light: #fb923c;
|
|
13
|
+
--neo-orange-dark: #ea580c;
|
|
14
|
+
|
|
15
|
+
/* VitePress Color Overrides */
|
|
16
|
+
--vp-c-brand-1: var(--neo-teal);
|
|
17
|
+
--vp-c-brand-2: var(--neo-teal-light);
|
|
18
|
+
--vp-c-brand-3: var(--neo-teal-dark);
|
|
19
|
+
--vp-c-brand-soft: rgba(13, 148, 136, 0.14);
|
|
20
|
+
|
|
21
|
+
/* Accent for highlights */
|
|
22
|
+
--vp-c-tip-1: var(--neo-teal);
|
|
23
|
+
--vp-c-tip-2: var(--neo-teal-light);
|
|
24
|
+
--vp-c-tip-3: var(--neo-teal-dark);
|
|
25
|
+
--vp-c-tip-soft: rgba(13, 148, 136, 0.14);
|
|
26
|
+
|
|
27
|
+
/* Warning with orange */
|
|
28
|
+
--vp-c-warning-1: var(--neo-orange);
|
|
29
|
+
--vp-c-warning-2: var(--neo-orange-light);
|
|
30
|
+
--vp-c-warning-3: var(--neo-orange-dark);
|
|
31
|
+
--vp-c-warning-soft: rgba(249, 115, 22, 0.14);
|
|
32
|
+
|
|
33
|
+
/* Button colors */
|
|
34
|
+
--vp-button-brand-border: transparent;
|
|
35
|
+
--vp-button-brand-text: #fff;
|
|
36
|
+
--vp-button-brand-bg: var(--neo-teal);
|
|
37
|
+
--vp-button-brand-hover-border: transparent;
|
|
38
|
+
--vp-button-brand-hover-text: #fff;
|
|
39
|
+
--vp-button-brand-hover-bg: var(--neo-teal-light);
|
|
40
|
+
--vp-button-brand-active-border: transparent;
|
|
41
|
+
--vp-button-brand-active-text: #fff;
|
|
42
|
+
--vp-button-brand-active-bg: var(--neo-teal-dark);
|
|
43
|
+
|
|
44
|
+
/* Alt button with orange accent */
|
|
45
|
+
--vp-button-alt-border: var(--neo-orange);
|
|
46
|
+
--vp-button-alt-text: var(--neo-orange);
|
|
47
|
+
--vp-button-alt-bg: transparent;
|
|
48
|
+
--vp-button-alt-hover-border: var(--neo-orange-light);
|
|
49
|
+
--vp-button-alt-hover-text: var(--neo-orange-light);
|
|
50
|
+
--vp-button-alt-hover-bg: rgba(249, 115, 22, 0.1);
|
|
51
|
+
|
|
52
|
+
/* Home hero gradient */
|
|
53
|
+
--vp-home-hero-name-color: transparent;
|
|
54
|
+
--vp-home-hero-name-background: linear-gradient(135deg, var(--neo-teal) 0%, var(--neo-orange) 100%);
|
|
55
|
+
|
|
56
|
+
--vp-home-hero-image-background-image: linear-gradient(135deg, rgba(13, 148, 136, 0.3) 0%, rgba(249, 115, 22, 0.3) 100%);
|
|
57
|
+
--vp-home-hero-image-filter: blur(44px);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.dark {
|
|
61
|
+
--vp-c-brand-1: var(--neo-teal-light);
|
|
62
|
+
--vp-c-brand-2: var(--neo-teal);
|
|
63
|
+
--vp-c-brand-3: var(--neo-teal-dark);
|
|
64
|
+
|
|
65
|
+
--vp-home-hero-image-background-image: linear-gradient(135deg, rgba(13, 148, 136, 0.4) 0%, rgba(249, 115, 22, 0.4) 100%);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Hero section enhancements */
|
|
69
|
+
.VPHero .VPImage {
|
|
70
|
+
max-width: 280px;
|
|
71
|
+
max-height: 280px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.VPHero .tagline {
|
|
75
|
+
font-size: 1.25rem !important;
|
|
76
|
+
color: var(--vp-c-text-2);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Feature cards */
|
|
80
|
+
.VPFeature {
|
|
81
|
+
border: 1px solid var(--vp-c-divider);
|
|
82
|
+
transition: all 0.3s ease;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.VPFeature:hover {
|
|
86
|
+
border-color: var(--neo-teal);
|
|
87
|
+
box-shadow: 0 4px 20px rgba(13, 148, 136, 0.15);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.VPFeature .icon {
|
|
91
|
+
font-size: 2rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Code blocks */
|
|
95
|
+
.vp-code-group .tabs label.active {
|
|
96
|
+
color: var(--neo-teal);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Custom badges */
|
|
100
|
+
.vp-badge.tip {
|
|
101
|
+
background-color: var(--neo-teal);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.vp-badge.warning {
|
|
105
|
+
background-color: var(--neo-orange);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Navigation active state */
|
|
109
|
+
.VPNavBarMenuLink.active,
|
|
110
|
+
.VPSidebarItem.is-active > .item > .link > .text {
|
|
111
|
+
color: var(--neo-teal) !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Custom container styles */
|
|
115
|
+
.custom-block.tip {
|
|
116
|
+
border-color: var(--neo-teal);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.custom-block.warning {
|
|
120
|
+
border-color: var(--neo-orange);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Table styling */
|
|
124
|
+
table {
|
|
125
|
+
border-collapse: collapse;
|
|
126
|
+
width: 100%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
th {
|
|
130
|
+
background-color: rgba(13, 148, 136, 0.1);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Gradient text utility */
|
|
134
|
+
.gradient-text {
|
|
135
|
+
background: linear-gradient(135deg, var(--neo-teal) 0%, var(--neo-orange) 100%);
|
|
136
|
+
-webkit-background-clip: text;
|
|
137
|
+
-webkit-text-fill-color: transparent;
|
|
138
|
+
background-clip: text;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Animation for hero */
|
|
142
|
+
@keyframes float {
|
|
143
|
+
0%, 100% { transform: translateY(0); }
|
|
144
|
+
50% { transform: translateY(-10px); }
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.VPHero .VPImage img {
|
|
148
|
+
animation: float 3s ease-in-out infinite;
|
|
149
|
+
}
|
|
150
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Customize VitePress theme with Neo-Syringe colors
|
|
3
|
+
* Primary: Teal/Cyan (#0d9488)
|
|
4
|
+
* Accent: Orange (#f97316)
|
|
5
|
+
*/
|
|
6
|
+
import { h } from 'vue'
|
|
7
|
+
import type { Theme } from 'vitepress'
|
|
8
|
+
import DefaultTheme from 'vitepress/theme'
|
|
9
|
+
import './custom.css'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
extends: DefaultTheme,
|
|
13
|
+
Layout: () => {
|
|
14
|
+
return h(DefaultTheme.Layout, null, {})
|
|
15
|
+
},
|
|
16
|
+
} satisfies Theme
|
|
17
|
+
|