@lorion-org/nuxt 1.0.0-beta.0
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/LICENSE +21 -0
- package/README.md +578 -0
- package/dist/descriptor-schema.d.ts +4 -0
- package/dist/descriptor-schema.js +63 -0
- package/dist/extensions-vNob6d2x.d.ts +127 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +864 -0
- package/dist/runtime-config-node.d.ts +15 -0
- package/dist/runtime-config-node.js +106 -0
- package/dist/runtime-config.d.ts +22 -0
- package/dist/runtime-config.js +184 -0
- package/examples/read-runtime-config.server.ts +3 -0
- package/examples/runtime-config-source.nuxt.config.ts +13 -0
- package/examples/selected-extensions.nuxt.config.ts +30 -0
- package/package.json +89 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ValidateRuntimeConfigPatternSourceScopesOptions, RuntimeConfigSchemaTargetInput, RuntimeConfigValidateResult } from '@lorion-org/runtime-config-node';
|
|
2
|
+
import { RuntimeConfigFragmentMap } from '@lorion-org/runtime-config';
|
|
3
|
+
import { C as CreateNuxtRuntimeConfigOptions, n as RuntimeConfigNuxtSourceOptions, a as NuxtRuntimeConfig } from './extensions-vNob6d2x.js';
|
|
4
|
+
import '@lorion-org/composition-graph';
|
|
5
|
+
import '@lorion-org/provider-selection';
|
|
6
|
+
import '@lorion-org/descriptor-discovery';
|
|
7
|
+
|
|
8
|
+
type CreateNuxtRuntimeConfigFromSourceOptions = Omit<CreateNuxtRuntimeConfigOptions, 'fragments' | 'runtimeConfig'>;
|
|
9
|
+
type ValidateNuxtRuntimeConfigSourceScopesOptions = Omit<ValidateRuntimeConfigPatternSourceScopesOptions, 'fileName' | 'runtimeConfigDirName'>;
|
|
10
|
+
declare function resolveNuxtRuntimeConfigPublicRootPath(source: RuntimeConfigNuxtSourceOptions): string | undefined;
|
|
11
|
+
declare function loadNuxtRuntimeConfigFragments(source: RuntimeConfigNuxtSourceOptions, options?: Pick<CreateNuxtRuntimeConfigOptions, 'contextInputKey'>): RuntimeConfigFragmentMap;
|
|
12
|
+
declare function createNuxtRuntimeConfigFromSource(source: RuntimeConfigNuxtSourceOptions, options?: CreateNuxtRuntimeConfigFromSourceOptions): NuxtRuntimeConfig;
|
|
13
|
+
declare function validateNuxtRuntimeConfigSourceScopes(source: RuntimeConfigNuxtSourceOptions, targets: RuntimeConfigSchemaTargetInput[], options?: ValidateNuxtRuntimeConfigSourceScopesOptions): RuntimeConfigValidateResult;
|
|
14
|
+
|
|
15
|
+
export { type CreateNuxtRuntimeConfigFromSourceOptions, RuntimeConfigNuxtSourceOptions, type ValidateNuxtRuntimeConfigSourceScopesOptions, createNuxtRuntimeConfigFromSource, loadNuxtRuntimeConfigFragments, resolveNuxtRuntimeConfigPublicRootPath, validateNuxtRuntimeConfigSourceScopes };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// src/runtime-config-node.ts
|
|
2
|
+
import {
|
|
3
|
+
loadRuntimeConfigSourceTree,
|
|
4
|
+
resolveRuntimeConfigSourcePublicRootPath,
|
|
5
|
+
validateRuntimeConfigSourceScopes
|
|
6
|
+
} from "@lorion-org/runtime-config-node";
|
|
7
|
+
import { toRuntimeConfigFragment as toRuntimeConfigFragment2 } from "@lorion-org/runtime-config";
|
|
8
|
+
|
|
9
|
+
// src/runtime-config.ts
|
|
10
|
+
import {
|
|
11
|
+
getPrivateRuntimeConfigScope,
|
|
12
|
+
getPublicRuntimeConfigScope,
|
|
13
|
+
getRuntimeConfigFragment,
|
|
14
|
+
getRuntimeConfigScope,
|
|
15
|
+
projectSectionedRuntimeConfig,
|
|
16
|
+
resolveRuntimeConfigValueFromRuntimeConfig,
|
|
17
|
+
toRuntimeConfigFragment
|
|
18
|
+
} from "@lorion-org/runtime-config";
|
|
19
|
+
function createContextInputOptions(contextInputKey) {
|
|
20
|
+
return contextInputKey === void 0 ? {} : { contextInputKey };
|
|
21
|
+
}
|
|
22
|
+
function createPrivateOutputOptions(privateOutput) {
|
|
23
|
+
return privateOutput === void 0 ? {} : { privateOutput };
|
|
24
|
+
}
|
|
25
|
+
function normalizeNuxtRuntimeConfigFragments(fragments = {}, options = {}) {
|
|
26
|
+
if (fragments instanceof Map) {
|
|
27
|
+
const normalizedFragments = /* @__PURE__ */ new Map();
|
|
28
|
+
for (const [scopeId, config] of fragments.entries()) {
|
|
29
|
+
normalizedFragments.set(scopeId, toRuntimeConfigFragment(config, options));
|
|
30
|
+
}
|
|
31
|
+
return normalizedFragments;
|
|
32
|
+
}
|
|
33
|
+
if (Array.isArray(fragments)) {
|
|
34
|
+
return fragments.map((fragment) => ({
|
|
35
|
+
scopeId: fragment.scopeId,
|
|
36
|
+
config: toRuntimeConfigFragment(fragment.config, options)
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
return Object.entries(fragments).map(([scopeId, config]) => ({
|
|
40
|
+
scopeId,
|
|
41
|
+
config: toRuntimeConfigFragment(config, options)
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
function toNuxtRuntimeConfig(runtimeConfig, options = {}) {
|
|
45
|
+
if (options.privateOutput === "section") {
|
|
46
|
+
return {
|
|
47
|
+
private: {
|
|
48
|
+
...runtimeConfig.private
|
|
49
|
+
},
|
|
50
|
+
public: {
|
|
51
|
+
...runtimeConfig.public
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...runtimeConfig.private,
|
|
57
|
+
public: {
|
|
58
|
+
...runtimeConfig.public
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function createNuxtRuntimeConfig(options = {}) {
|
|
63
|
+
const { contextInputKey, fragments, runtimeConfig, ...projectOptions } = options;
|
|
64
|
+
const runtimeConfigFragments = fragments ?? {};
|
|
65
|
+
const sectionedRuntimeConfig = runtimeConfig ?? projectSectionedRuntimeConfig(
|
|
66
|
+
normalizeNuxtRuntimeConfigFragments(
|
|
67
|
+
runtimeConfigFragments,
|
|
68
|
+
createContextInputOptions(contextInputKey)
|
|
69
|
+
),
|
|
70
|
+
projectOptions
|
|
71
|
+
);
|
|
72
|
+
return toNuxtRuntimeConfig(
|
|
73
|
+
sectionedRuntimeConfig,
|
|
74
|
+
createPrivateOutputOptions(options.privateOutput)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/runtime-config-node.ts
|
|
79
|
+
function resolveNuxtRuntimeConfigPublicRootPath(source) {
|
|
80
|
+
return resolveRuntimeConfigSourcePublicRootPath(source);
|
|
81
|
+
}
|
|
82
|
+
function loadNuxtRuntimeConfigFragments(source, options = {}) {
|
|
83
|
+
const fragments = loadRuntimeConfigSourceTree(source);
|
|
84
|
+
const normalizedFragments = /* @__PURE__ */ new Map();
|
|
85
|
+
for (const [scopeId, config] of fragments.entries()) {
|
|
86
|
+
normalizedFragments.set(scopeId, toRuntimeConfigFragment2(config, options));
|
|
87
|
+
}
|
|
88
|
+
return normalizedFragments;
|
|
89
|
+
}
|
|
90
|
+
function createNuxtRuntimeConfigFromSource(source, options = {}) {
|
|
91
|
+
return createNuxtRuntimeConfig({
|
|
92
|
+
...options,
|
|
93
|
+
fragments: loadNuxtRuntimeConfigFragments(source, {
|
|
94
|
+
...options.contextInputKey ? { contextInputKey: options.contextInputKey } : {}
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function validateNuxtRuntimeConfigSourceScopes(source, targets, options = {}) {
|
|
99
|
+
return validateRuntimeConfigSourceScopes(source, targets, options);
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
createNuxtRuntimeConfigFromSource,
|
|
103
|
+
loadNuxtRuntimeConfigFragments,
|
|
104
|
+
resolveNuxtRuntimeConfigPublicRootPath,
|
|
105
|
+
validateNuxtRuntimeConfigSourceScopes
|
|
106
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SectionedRuntimeConfig, GetRuntimeConfigFragmentOptions, RuntimeConfigContext, RuntimeConfigSection, GetRuntimeConfigScopeOptions, NamedRuntimeConfigFragment, RuntimeConfigFragmentMap, ResolveRuntimeConfigValueFromRuntimeConfigOptions } from '@lorion-org/runtime-config';
|
|
2
|
+
import { C as CreateNuxtRuntimeConfigOptions, a as NuxtRuntimeConfig, o as NuxtRuntimeConfigInput, p as ReadNuxtRuntimeConfigOptions, q as NuxtExtensionSelection, j as NuxtProviderSelectionRuntimeConfig, s as RuntimeConfigNuxtFragments } from './extensions-vNob6d2x.js';
|
|
3
|
+
export { t as NuxtExtensionSelectionRuntimeConfig, u as NuxtPrivateRuntimeConfigMode } from './extensions-vNob6d2x.js';
|
|
4
|
+
import '@lorion-org/composition-graph';
|
|
5
|
+
import '@lorion-org/provider-selection';
|
|
6
|
+
import '@lorion-org/descriptor-discovery';
|
|
7
|
+
import '@lorion-org/runtime-config-node';
|
|
8
|
+
|
|
9
|
+
declare function normalizeNuxtRuntimeConfigFragments(fragments?: RuntimeConfigNuxtFragments, options?: Pick<CreateNuxtRuntimeConfigOptions, 'contextInputKey'>): NamedRuntimeConfigFragment[] | RuntimeConfigFragmentMap;
|
|
10
|
+
declare function toNuxtRuntimeConfig(runtimeConfig: SectionedRuntimeConfig, options?: Pick<CreateNuxtRuntimeConfigOptions, 'privateOutput'>): NuxtRuntimeConfig;
|
|
11
|
+
declare function fromNuxtRuntimeConfig(runtimeConfig: NuxtRuntimeConfigInput, options?: ReadNuxtRuntimeConfigOptions): SectionedRuntimeConfig;
|
|
12
|
+
declare function createNuxtRuntimeConfig(options?: CreateNuxtRuntimeConfigOptions): NuxtRuntimeConfig;
|
|
13
|
+
declare function mergeNuxtRuntimeConfig(target?: NuxtRuntimeConfigInput, source?: NuxtRuntimeConfigInput): NuxtRuntimeConfig;
|
|
14
|
+
declare function getNuxtExtensionSelection(runtimeConfig: NuxtRuntimeConfigInput): NuxtExtensionSelection;
|
|
15
|
+
declare function getNuxtProviderSelection(runtimeConfig: NuxtRuntimeConfigInput): NuxtProviderSelectionRuntimeConfig | undefined;
|
|
16
|
+
declare function getPublicNuxtRuntimeConfigScope<T extends RuntimeConfigSection = RuntimeConfigSection>(runtimeConfig: NuxtRuntimeConfigInput, scopeId: string, options?: Omit<GetRuntimeConfigScopeOptions, 'visibility'> & ReadNuxtRuntimeConfigOptions): T;
|
|
17
|
+
declare function getNuxtRuntimeConfigScope<T extends RuntimeConfigSection = RuntimeConfigSection>(runtimeConfig: NuxtRuntimeConfigInput, scopeId: string, options?: GetRuntimeConfigScopeOptions & ReadNuxtRuntimeConfigOptions): T;
|
|
18
|
+
declare function getPrivateNuxtRuntimeConfigScope<T extends RuntimeConfigSection = RuntimeConfigSection>(runtimeConfig: NuxtRuntimeConfigInput, scopeId: string, options?: Omit<GetRuntimeConfigScopeOptions, 'visibility'> & ReadNuxtRuntimeConfigOptions): T;
|
|
19
|
+
declare function resolveNuxtRuntimeConfigValue<T = unknown>(runtimeConfig: NuxtRuntimeConfigInput, scopeId: string, key: string, options?: ResolveRuntimeConfigValueFromRuntimeConfigOptions<T> & ReadNuxtRuntimeConfigOptions): T | undefined;
|
|
20
|
+
declare function getNuxtRuntimeConfigFragment(runtimeConfig: NuxtRuntimeConfigInput, scopeId: string, options?: GetRuntimeConfigFragmentOptions & ReadNuxtRuntimeConfigOptions): RuntimeConfigContext;
|
|
21
|
+
|
|
22
|
+
export { CreateNuxtRuntimeConfigOptions, NuxtExtensionSelection, NuxtRuntimeConfig, NuxtRuntimeConfigInput, ReadNuxtRuntimeConfigOptions, RuntimeConfigNuxtFragments, createNuxtRuntimeConfig, fromNuxtRuntimeConfig, getNuxtExtensionSelection, getNuxtProviderSelection, getNuxtRuntimeConfigFragment, getNuxtRuntimeConfigScope, getPrivateNuxtRuntimeConfigScope, getPublicNuxtRuntimeConfigScope, mergeNuxtRuntimeConfig, normalizeNuxtRuntimeConfigFragments, resolveNuxtRuntimeConfigValue, toNuxtRuntimeConfig };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// src/runtime-config.ts
|
|
2
|
+
import {
|
|
3
|
+
getPrivateRuntimeConfigScope,
|
|
4
|
+
getPublicRuntimeConfigScope,
|
|
5
|
+
getRuntimeConfigFragment,
|
|
6
|
+
getRuntimeConfigScope,
|
|
7
|
+
projectSectionedRuntimeConfig,
|
|
8
|
+
resolveRuntimeConfigValueFromRuntimeConfig,
|
|
9
|
+
toRuntimeConfigFragment
|
|
10
|
+
} from "@lorion-org/runtime-config";
|
|
11
|
+
var isObject = (value) => {
|
|
12
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
|
+
};
|
|
14
|
+
var toStringArray = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
15
|
+
function createContextInputOptions(contextInputKey) {
|
|
16
|
+
return contextInputKey === void 0 ? {} : { contextInputKey };
|
|
17
|
+
}
|
|
18
|
+
function createPrivateOutputOptions(privateOutput) {
|
|
19
|
+
return privateOutput === void 0 ? {} : { privateOutput };
|
|
20
|
+
}
|
|
21
|
+
function createPrivateInputOptions(privateInput) {
|
|
22
|
+
return privateInput === void 0 ? {} : { privateInput };
|
|
23
|
+
}
|
|
24
|
+
function withoutPublicRuntimeConfig(config) {
|
|
25
|
+
const privateConfig = { ...config };
|
|
26
|
+
delete privateConfig.public;
|
|
27
|
+
return privateConfig;
|
|
28
|
+
}
|
|
29
|
+
function normalizeNuxtRuntimeConfigFragments(fragments = {}, options = {}) {
|
|
30
|
+
if (fragments instanceof Map) {
|
|
31
|
+
const normalizedFragments = /* @__PURE__ */ new Map();
|
|
32
|
+
for (const [scopeId, config] of fragments.entries()) {
|
|
33
|
+
normalizedFragments.set(scopeId, toRuntimeConfigFragment(config, options));
|
|
34
|
+
}
|
|
35
|
+
return normalizedFragments;
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(fragments)) {
|
|
38
|
+
return fragments.map((fragment) => ({
|
|
39
|
+
scopeId: fragment.scopeId,
|
|
40
|
+
config: toRuntimeConfigFragment(fragment.config, options)
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
return Object.entries(fragments).map(([scopeId, config]) => ({
|
|
44
|
+
scopeId,
|
|
45
|
+
config: toRuntimeConfigFragment(config, options)
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
function toNuxtRuntimeConfig(runtimeConfig, options = {}) {
|
|
49
|
+
if (options.privateOutput === "section") {
|
|
50
|
+
return {
|
|
51
|
+
private: {
|
|
52
|
+
...runtimeConfig.private
|
|
53
|
+
},
|
|
54
|
+
public: {
|
|
55
|
+
...runtimeConfig.public
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
...runtimeConfig.private,
|
|
61
|
+
public: {
|
|
62
|
+
...runtimeConfig.public
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function fromNuxtRuntimeConfig(runtimeConfig, options = {}) {
|
|
67
|
+
if (options.privateInput === "section") {
|
|
68
|
+
return {
|
|
69
|
+
public: isObject(runtimeConfig.public) ? runtimeConfig.public : {},
|
|
70
|
+
private: isObject(runtimeConfig.private) ? runtimeConfig.private : {}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const { public: publicConfig = {}, ...privateConfig } = runtimeConfig;
|
|
74
|
+
return {
|
|
75
|
+
public: publicConfig,
|
|
76
|
+
private: privateConfig
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function createNuxtRuntimeConfig(options = {}) {
|
|
80
|
+
const { contextInputKey, fragments, runtimeConfig, ...projectOptions } = options;
|
|
81
|
+
const runtimeConfigFragments = fragments ?? {};
|
|
82
|
+
const sectionedRuntimeConfig = runtimeConfig ?? projectSectionedRuntimeConfig(
|
|
83
|
+
normalizeNuxtRuntimeConfigFragments(
|
|
84
|
+
runtimeConfigFragments,
|
|
85
|
+
createContextInputOptions(contextInputKey)
|
|
86
|
+
),
|
|
87
|
+
projectOptions
|
|
88
|
+
);
|
|
89
|
+
return toNuxtRuntimeConfig(
|
|
90
|
+
sectionedRuntimeConfig,
|
|
91
|
+
createPrivateOutputOptions(options.privateOutput)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function mergeNuxtRuntimeConfig(target = {}, source = {}) {
|
|
95
|
+
const targetPublic = isObject(target.public) ? target.public : {};
|
|
96
|
+
const sourcePublic = isObject(source.public) ? source.public : {};
|
|
97
|
+
return {
|
|
98
|
+
...withoutPublicRuntimeConfig(target),
|
|
99
|
+
...withoutPublicRuntimeConfig(source),
|
|
100
|
+
public: {
|
|
101
|
+
...targetPublic,
|
|
102
|
+
...sourcePublic
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function getNuxtExtensionSelection(runtimeConfig) {
|
|
107
|
+
const selection = isObject(runtimeConfig.public?.extensionSelection) ? runtimeConfig.public.extensionSelection : void 0;
|
|
108
|
+
if (!selection) {
|
|
109
|
+
return {
|
|
110
|
+
discoveredExtensionIds: [],
|
|
111
|
+
notInjectedExtensionIds: [],
|
|
112
|
+
resolvedExtensionIds: [],
|
|
113
|
+
selectedExtensionIds: []
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const discoveredExtensionIds = toStringArray(selection.discoveredExtensionIds);
|
|
117
|
+
const resolvedExtensionIds = toStringArray(selection.resolvedExtensionIds);
|
|
118
|
+
const resolvedExtensionIdSet = new Set(resolvedExtensionIds);
|
|
119
|
+
return {
|
|
120
|
+
discoveredExtensionIds,
|
|
121
|
+
notInjectedExtensionIds: discoveredExtensionIds.filter((id) => !resolvedExtensionIdSet.has(id)).sort((left, right) => left.localeCompare(right)),
|
|
122
|
+
resolvedExtensionIds,
|
|
123
|
+
selectedExtensionIds: toStringArray(selection.selectedExtensionIds)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function getNuxtProviderSelection(runtimeConfig) {
|
|
127
|
+
const providerSelection = runtimeConfig.public?.providerSelection;
|
|
128
|
+
return isObject(providerSelection) && isObject(providerSelection.selections) ? providerSelection : void 0;
|
|
129
|
+
}
|
|
130
|
+
function getPublicNuxtRuntimeConfigScope(runtimeConfig, scopeId, options = {}) {
|
|
131
|
+
const { privateInput, ...scopeOptions } = options;
|
|
132
|
+
return getPublicRuntimeConfigScope(
|
|
133
|
+
fromNuxtRuntimeConfig(runtimeConfig, createPrivateInputOptions(privateInput)),
|
|
134
|
+
scopeId,
|
|
135
|
+
scopeOptions
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
function getNuxtRuntimeConfigScope(runtimeConfig, scopeId, options = {}) {
|
|
139
|
+
const { privateInput, ...scopeOptions } = options;
|
|
140
|
+
return getRuntimeConfigScope(
|
|
141
|
+
fromNuxtRuntimeConfig(runtimeConfig, createPrivateInputOptions(privateInput)),
|
|
142
|
+
scopeId,
|
|
143
|
+
scopeOptions
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
function getPrivateNuxtRuntimeConfigScope(runtimeConfig, scopeId, options = {}) {
|
|
147
|
+
const { privateInput, ...scopeOptions } = options;
|
|
148
|
+
return getPrivateRuntimeConfigScope(
|
|
149
|
+
fromNuxtRuntimeConfig(runtimeConfig, createPrivateInputOptions(privateInput)),
|
|
150
|
+
scopeId,
|
|
151
|
+
scopeOptions
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function resolveNuxtRuntimeConfigValue(runtimeConfig, scopeId, key, options = {}) {
|
|
155
|
+
const { privateInput, ...resolveOptions } = options;
|
|
156
|
+
return resolveRuntimeConfigValueFromRuntimeConfig(
|
|
157
|
+
fromNuxtRuntimeConfig(runtimeConfig, createPrivateInputOptions(privateInput)),
|
|
158
|
+
scopeId,
|
|
159
|
+
key,
|
|
160
|
+
resolveOptions
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
function getNuxtRuntimeConfigFragment(runtimeConfig, scopeId, options = {}) {
|
|
164
|
+
const { privateInput, ...fragmentOptions } = options;
|
|
165
|
+
return getRuntimeConfigFragment(
|
|
166
|
+
fromNuxtRuntimeConfig(runtimeConfig, createPrivateInputOptions(privateInput)),
|
|
167
|
+
scopeId,
|
|
168
|
+
fragmentOptions
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
createNuxtRuntimeConfig,
|
|
173
|
+
fromNuxtRuntimeConfig,
|
|
174
|
+
getNuxtExtensionSelection,
|
|
175
|
+
getNuxtProviderSelection,
|
|
176
|
+
getNuxtRuntimeConfigFragment,
|
|
177
|
+
getNuxtRuntimeConfigScope,
|
|
178
|
+
getPrivateNuxtRuntimeConfigScope,
|
|
179
|
+
getPublicNuxtRuntimeConfigScope,
|
|
180
|
+
mergeNuxtRuntimeConfig,
|
|
181
|
+
normalizeNuxtRuntimeConfigFragments,
|
|
182
|
+
resolveNuxtRuntimeConfigValue,
|
|
183
|
+
toNuxtRuntimeConfig
|
|
184
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineNuxtConfig } from 'nuxt/config';
|
|
2
|
+
import type {} from '@lorion-org/nuxt';
|
|
3
|
+
|
|
4
|
+
export default defineNuxtConfig({
|
|
5
|
+
modules: ['@lorion-org/nuxt'],
|
|
6
|
+
lorion: {
|
|
7
|
+
runtimeConfig: {
|
|
8
|
+
source: {
|
|
9
|
+
paths: ['.runtimeconfig/runtime-config/*/runtime.config.json'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineNuxtConfig } from 'nuxt/config';
|
|
2
|
+
import LorionNuxtModule, {
|
|
3
|
+
createNuxtExtensionBootstrap,
|
|
4
|
+
createNuxtExtensionLayerPaths,
|
|
5
|
+
} from '@lorion-org/nuxt';
|
|
6
|
+
|
|
7
|
+
const extensionBootstrap = createNuxtExtensionBootstrap({
|
|
8
|
+
rootDir: __dirname,
|
|
9
|
+
options: {
|
|
10
|
+
defaultSelection: 'default',
|
|
11
|
+
descriptorPaths: ['extensions/*/extension.json'],
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default defineNuxtConfig({
|
|
16
|
+
extends: createNuxtExtensionLayerPaths(extensionBootstrap),
|
|
17
|
+
modules: [
|
|
18
|
+
[
|
|
19
|
+
LorionNuxtModule,
|
|
20
|
+
{
|
|
21
|
+
extensionBootstrap,
|
|
22
|
+
providers: {
|
|
23
|
+
configuredProviders: {
|
|
24
|
+
'payment-checkout': 'payment-provider-stripe',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
],
|
|
30
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lorion-org/nuxt",
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
|
+
"description": "Nuxt module for LORION libraries and framework adapters.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/lorion-org/lorion.git",
|
|
9
|
+
"directory": "packages/nuxt"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/lorion-org/lorion/tree/main/packages/nuxt#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/lorion-org/lorion/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./runtime-config": {
|
|
29
|
+
"types": "./dist/runtime-config.d.ts",
|
|
30
|
+
"import": "./dist/runtime-config.js",
|
|
31
|
+
"default": "./dist/runtime-config.js"
|
|
32
|
+
},
|
|
33
|
+
"./runtime-config-node": {
|
|
34
|
+
"types": "./dist/runtime-config-node.d.ts",
|
|
35
|
+
"import": "./dist/runtime-config-node.js",
|
|
36
|
+
"default": "./dist/runtime-config-node.js"
|
|
37
|
+
},
|
|
38
|
+
"./descriptor-schema": {
|
|
39
|
+
"types": "./dist/descriptor-schema.d.ts",
|
|
40
|
+
"import": "./dist/descriptor-schema.js",
|
|
41
|
+
"default": "./dist/descriptor-schema.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"examples",
|
|
47
|
+
"LICENSE"
|
|
48
|
+
],
|
|
49
|
+
"keywords": [
|
|
50
|
+
"lorion",
|
|
51
|
+
"nuxt",
|
|
52
|
+
"module",
|
|
53
|
+
"runtime-config"
|
|
54
|
+
],
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@lorion-org/provider-selection": "^1.0.0-beta.0",
|
|
60
|
+
"@lorion-org/composition-graph": "^1.0.0-beta.0",
|
|
61
|
+
"@lorion-org/descriptor-discovery": "^1.0.0-beta.0",
|
|
62
|
+
"@lorion-org/runtime-config": "^1.0.0-beta.0",
|
|
63
|
+
"@lorion-org/runtime-config-node": "^1.0.0-beta.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@nuxt/kit": "^4.0.0",
|
|
67
|
+
"nuxt": "^4.0.0"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@nuxt/kit": "^4.2.1",
|
|
71
|
+
"@nuxt/schema": "^4.4.2",
|
|
72
|
+
"@nuxt/test-utils": "^3.23.0",
|
|
73
|
+
"nuxt": "^4.4.2",
|
|
74
|
+
"@lorion-org/registry-hub": "^1.0.0-beta.0"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "rimraf dist && tsup src/index.ts src/runtime-config.ts src/runtime-config-node.ts src/descriptor-schema.ts --format esm --dts --splitting false",
|
|
78
|
+
"clean": "rimraf coverage dist tsconfig.tsbuildinfo",
|
|
79
|
+
"lint": "eslint src --ext .ts",
|
|
80
|
+
"package:check": "pnpm build && pnpm pack --dry-run && publint",
|
|
81
|
+
"test": "pnpm test:unit && pnpm test:e2e",
|
|
82
|
+
"test:unit": "vitest run --config test/vitest.unit.config.mts",
|
|
83
|
+
"test:e2e": "vitest run --config test/vitest.e2e.config.mts",
|
|
84
|
+
"build:playground": "nuxi build playground",
|
|
85
|
+
"dev:playground": "nuxi dev playground",
|
|
86
|
+
"typecheck:playground": "nuxi typecheck playground",
|
|
87
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
88
|
+
}
|
|
89
|
+
}
|