@lexibase/rdx-next 1.0.0-beta.8 → 1.0.0-beta.9
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/README.md +9 -0
- package/bin/add-plugin.mjs +234 -0
- package/bin/plugin-config.mjs +155 -0
- package/bin/rdx.mjs +13 -3
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -5,6 +5,15 @@ The official Next.js runtime for RDX documentation projects.
|
|
|
5
5
|
It exposes the `rdx` command used by generated projects to create their
|
|
6
6
|
internal `.rdx` application and run Next.js.
|
|
7
7
|
|
|
8
|
+
Run `pnpm rdx add versioning` (or `npm exec -- rdx add versioning`) from a
|
|
9
|
+
documentation project to install and activate the official optional plugin.
|
|
10
|
+
The command detects the package manager, preserves config and plugin options,
|
|
11
|
+
creates a config backup when changing it, validates the result and prepares
|
|
12
|
+
the runtime. Repeating it does not duplicate or upgrade an installed plugin.
|
|
13
|
+
Use `--package-manager npm|pnpm|yarn` to resolve ambiguous lockfiles. Dynamic
|
|
14
|
+
configurations receive manual instructions and are not automatically edited.
|
|
15
|
+
Installing a package with npm/pnpm/yarn alone never edits `rdx.config.ts`.
|
|
16
|
+
|
|
8
17
|
Generated sites use the same theme and components as the development website,
|
|
9
18
|
through `@lexibase/rdx-ui`: logo, navbar, Radix version dropdown, mobile/desktop
|
|
10
19
|
sidebar, landing page, MDX styles and theme provider. The adapter owns content
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto'
|
|
2
|
+
import { createRequire } from 'node:module'
|
|
3
|
+
import { lstat, readFile, writeFile, rename, unlink } from 'node:fs/promises'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import process from 'node:process'
|
|
6
|
+
|
|
7
|
+
import { createRdxProject, resolveConfig } from '@lexibase/rdx-core/config'
|
|
8
|
+
import spawn from 'cross-spawn'
|
|
9
|
+
import { createJiti } from 'jiti'
|
|
10
|
+
|
|
11
|
+
import { activateVersioning, versioningPackage } from './plugin-config.mjs'
|
|
12
|
+
|
|
13
|
+
const managers = new Set(['npm', 'pnpm', 'yarn'])
|
|
14
|
+
|
|
15
|
+
export function parseAddArguments(args) {
|
|
16
|
+
const [plugin, ...rest] = args
|
|
17
|
+
if (plugin !== 'versioning')
|
|
18
|
+
throw new Error(
|
|
19
|
+
'Usage: rdx add versioning [--package-manager npm|pnpm|yarn]. Only the official versioning plugin is currently supported.'
|
|
20
|
+
)
|
|
21
|
+
if (!rest.length) return {}
|
|
22
|
+
if (
|
|
23
|
+
rest.length === 2 &&
|
|
24
|
+
rest[0] === '--package-manager' &&
|
|
25
|
+
managers.has(rest[1])
|
|
26
|
+
)
|
|
27
|
+
return { packageManager: rest[1] }
|
|
28
|
+
throw new Error(
|
|
29
|
+
'Usage: rdx add versioning [--package-manager npm|pnpm|yarn].'
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function exists(filename) {
|
|
34
|
+
try {
|
|
35
|
+
await lstat(filename)
|
|
36
|
+
return true
|
|
37
|
+
} catch (error) {
|
|
38
|
+
if (error.code === 'ENOENT') return false
|
|
39
|
+
throw error
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function detectPackageManager(
|
|
44
|
+
rootDir,
|
|
45
|
+
pkg,
|
|
46
|
+
env = process.env,
|
|
47
|
+
explicit
|
|
48
|
+
) {
|
|
49
|
+
if (explicit) {
|
|
50
|
+
if (!managers.has(explicit)) throw new Error('Unsupported package manager.')
|
|
51
|
+
return explicit
|
|
52
|
+
}
|
|
53
|
+
if (
|
|
54
|
+
pkg.packageManager !== undefined &&
|
|
55
|
+
typeof pkg.packageManager !== 'string'
|
|
56
|
+
)
|
|
57
|
+
throw new Error('packageManager in package.json must be a string.')
|
|
58
|
+
const declared = pkg.packageManager?.split('@')[0]
|
|
59
|
+
if (declared && !managers.has(declared))
|
|
60
|
+
throw new Error(
|
|
61
|
+
'Unsupported packageManager in package.json. Choose --package-manager npm, pnpm or yarn explicitly.'
|
|
62
|
+
)
|
|
63
|
+
const locks = []
|
|
64
|
+
for (const [manager, filenames] of [
|
|
65
|
+
['npm', ['package-lock.json', 'npm-shrinkwrap.json']],
|
|
66
|
+
['pnpm', ['pnpm-lock.yaml']],
|
|
67
|
+
['yarn', ['yarn.lock']],
|
|
68
|
+
]) {
|
|
69
|
+
if (
|
|
70
|
+
(
|
|
71
|
+
await Promise.all(
|
|
72
|
+
filenames.map((filename) => exists(path.join(rootDir, filename)))
|
|
73
|
+
)
|
|
74
|
+
).some(Boolean)
|
|
75
|
+
)
|
|
76
|
+
locks.push(manager)
|
|
77
|
+
}
|
|
78
|
+
if (locks.length > 1 || (declared && locks.length && locks[0] !== declared))
|
|
79
|
+
throw new Error(
|
|
80
|
+
'Conflicting package managers. Keep the intended lockfile or choose --package-manager npm, pnpm or yarn explicitly.'
|
|
81
|
+
)
|
|
82
|
+
const agent = env.npm_config_user_agent?.split('/')[0]
|
|
83
|
+
return declared ?? locks[0] ?? (managers.has(agent) ? agent : 'npm')
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function installPackage(manager, rootDir, env = process.env) {
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
const args = [
|
|
89
|
+
manager === 'npm' ? 'install' : 'add',
|
|
90
|
+
`${versioningPackage}@beta`,
|
|
91
|
+
]
|
|
92
|
+
const nodeEntry =
|
|
93
|
+
env.npm_config_user_agent?.startsWith(`${manager}/`) &&
|
|
94
|
+
env.npm_execpath &&
|
|
95
|
+
/\.[cm]?js$/i.test(env.npm_execpath)
|
|
96
|
+
const child = spawn(
|
|
97
|
+
nodeEntry ? process.execPath : manager,
|
|
98
|
+
nodeEntry ? [env.npm_execpath, ...args] : args,
|
|
99
|
+
{ cwd: rootDir, env, stdio: 'inherit' }
|
|
100
|
+
)
|
|
101
|
+
child.once('error', (error) =>
|
|
102
|
+
reject(
|
|
103
|
+
new Error(
|
|
104
|
+
`Could not run ${manager}: ${error.message}. Install it or choose --package-manager explicitly.`
|
|
105
|
+
)
|
|
106
|
+
)
|
|
107
|
+
)
|
|
108
|
+
child.once('exit', (code, signal) => {
|
|
109
|
+
if (code === 0) resolve()
|
|
110
|
+
else
|
|
111
|
+
reject(
|
|
112
|
+
new Error(
|
|
113
|
+
`${manager} installation failed (${signal ?? code}). rdx.config.ts was not changed. Package/lock files may have changed; inspect them before retrying. If pnpm reports a release-age policy error, approve only the trusted RDX release in your project policy.`
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async function validateCandidate(filename) {
|
|
121
|
+
const jiti = createJiti(import.meta.url, {
|
|
122
|
+
moduleCache: false,
|
|
123
|
+
fsCache: false,
|
|
124
|
+
jsx: { runtime: 'automatic' },
|
|
125
|
+
})
|
|
126
|
+
const input = await jiti.import(filename, { default: true })
|
|
127
|
+
const config = resolveConfig(input)
|
|
128
|
+
// Validate paths and command registrations without running plugin setup hooks.
|
|
129
|
+
await createRdxProject(
|
|
130
|
+
{
|
|
131
|
+
...config,
|
|
132
|
+
plugins: config.plugins.map((plugin) => ({
|
|
133
|
+
...plugin,
|
|
134
|
+
setup: undefined,
|
|
135
|
+
})),
|
|
136
|
+
},
|
|
137
|
+
{ rootDir: path.dirname(filename), command: 'prepare' }
|
|
138
|
+
)
|
|
139
|
+
if (
|
|
140
|
+
config.plugins.filter((plugin) => plugin.name === versioningPackage)
|
|
141
|
+
.length !== 1
|
|
142
|
+
)
|
|
143
|
+
throw new Error(
|
|
144
|
+
'Expected exactly one official versioning plugin in the resulting configuration.'
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export async function addVersioning(rootDir, options = {}) {
|
|
149
|
+
const {
|
|
150
|
+
install = installPackage,
|
|
151
|
+
log = console.log,
|
|
152
|
+
env = process.env,
|
|
153
|
+
} = options
|
|
154
|
+
const filename = path.join(rootDir, 'rdx.config.ts')
|
|
155
|
+
let info
|
|
156
|
+
try {
|
|
157
|
+
info = await lstat(filename)
|
|
158
|
+
} catch (error) {
|
|
159
|
+
if (error.code === 'ENOENT')
|
|
160
|
+
throw new Error(
|
|
161
|
+
'Missing rdx.config.ts. Run rdx add from the documentation project root.'
|
|
162
|
+
)
|
|
163
|
+
throw error
|
|
164
|
+
}
|
|
165
|
+
if (!info.isFile() || info.isSymbolicLink())
|
|
166
|
+
throw new Error('rdx.config.ts must be a regular project file, not a link.')
|
|
167
|
+
const original = await readFile(filename, 'utf8')
|
|
168
|
+
// Refuse unsupported configurations before running the package manager.
|
|
169
|
+
const updated = activateVersioning(original)
|
|
170
|
+
const pkg = JSON.parse(
|
|
171
|
+
await readFile(path.join(rootDir, 'package.json'), 'utf8')
|
|
172
|
+
)
|
|
173
|
+
const manager = await detectPackageManager(
|
|
174
|
+
rootDir,
|
|
175
|
+
pkg,
|
|
176
|
+
env,
|
|
177
|
+
options.packageManager
|
|
178
|
+
)
|
|
179
|
+
const declared =
|
|
180
|
+
pkg.dependencies?.[versioningPackage] ??
|
|
181
|
+
pkg.devDependencies?.[versioningPackage]
|
|
182
|
+
let installed = false
|
|
183
|
+
try {
|
|
184
|
+
createRequire(path.join(rootDir, 'package.json')).resolve(versioningPackage)
|
|
185
|
+
installed = true
|
|
186
|
+
} catch (error) {
|
|
187
|
+
// The official package exposes ESM imports only. require.resolve can find
|
|
188
|
+
// its manifest but reject the require condition; validation below uses Jiti.
|
|
189
|
+
if (error.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') installed = true
|
|
190
|
+
else if (!['MODULE_NOT_FOUND', 'ERR_MODULE_NOT_FOUND'].includes(error.code))
|
|
191
|
+
throw error
|
|
192
|
+
}
|
|
193
|
+
if (!declared || !installed) {
|
|
194
|
+
log(`Installing ${versioningPackage}@beta with ${manager}...`)
|
|
195
|
+
await install(manager, rootDir, env)
|
|
196
|
+
} else
|
|
197
|
+
log(`${versioningPackage} is already installed; preserving its version.`)
|
|
198
|
+
|
|
199
|
+
const temporary = path.join(rootDir, `rdx.config.add-${randomUUID()}.ts`)
|
|
200
|
+
let backup
|
|
201
|
+
try {
|
|
202
|
+
await writeFile(temporary, updated, { flag: 'wx', mode: info.mode })
|
|
203
|
+
try {
|
|
204
|
+
await validateCandidate(temporary)
|
|
205
|
+
} catch (error) {
|
|
206
|
+
throw new Error(
|
|
207
|
+
`Plugin configuration validation failed: ${error.message}. rdx.config.ts was not changed. Installed dependencies were kept; fix the error and retry.`
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
if ((await readFile(filename, 'utf8')) !== original)
|
|
211
|
+
throw new Error(
|
|
212
|
+
'rdx.config.ts changed during installation. No configuration was overwritten; retry after reviewing your edits.'
|
|
213
|
+
)
|
|
214
|
+
const currentInfo = await lstat(filename)
|
|
215
|
+
if (!currentInfo.isFile() || currentInfo.isSymbolicLink())
|
|
216
|
+
throw new Error(
|
|
217
|
+
'rdx.config.ts was replaced during installation. No configuration was overwritten.'
|
|
218
|
+
)
|
|
219
|
+
if (updated !== original) {
|
|
220
|
+
backup = path.join(rootDir, `rdx.config.ts.${randomUUID()}.bak`)
|
|
221
|
+
await writeFile(backup, original, { flag: 'wx', mode: info.mode })
|
|
222
|
+
await rename(temporary, filename)
|
|
223
|
+
log(
|
|
224
|
+
`Versioning activated. Original configuration saved to ${path.basename(backup)}.`
|
|
225
|
+
)
|
|
226
|
+
} else
|
|
227
|
+
log('Versioning is already configured; no configuration changes needed.')
|
|
228
|
+
} finally {
|
|
229
|
+
await unlink(temporary).catch((error) => {
|
|
230
|
+
if (error.code !== 'ENOENT') throw error
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
return { backup, changed: updated !== original }
|
|
234
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import ts from 'typescript'
|
|
2
|
+
|
|
3
|
+
export const versioningPackage = '@lexibase/rdx-versioning'
|
|
4
|
+
const manual = `Cannot safely edit rdx.config.ts. Add "import { versioning } from '${versioningPackage}'" and versioning() to plugins manually, then run rdx prepare.`
|
|
5
|
+
|
|
6
|
+
function unwrap(node) {
|
|
7
|
+
while (
|
|
8
|
+
ts.isParenthesizedExpression(node) ||
|
|
9
|
+
ts.isAsExpression(node) ||
|
|
10
|
+
ts.isSatisfiesExpression(node)
|
|
11
|
+
)
|
|
12
|
+
node = node.expression
|
|
13
|
+
return node
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Edit only known literal shapes; never print/reconstruct the user's entire file.
|
|
17
|
+
export function activateVersioning(source) {
|
|
18
|
+
const file = ts.createSourceFile(
|
|
19
|
+
'rdx.config.ts',
|
|
20
|
+
source,
|
|
21
|
+
ts.ScriptTarget.Latest,
|
|
22
|
+
true,
|
|
23
|
+
ts.ScriptKind.TS
|
|
24
|
+
)
|
|
25
|
+
if (file.parseDiagnostics.length) throw new Error(manual)
|
|
26
|
+
const imports = file.statements.filter(ts.isImportDeclaration)
|
|
27
|
+
const definitions = new Set()
|
|
28
|
+
let factory
|
|
29
|
+
for (const entry of imports) {
|
|
30
|
+
const name = entry.moduleSpecifier.text
|
|
31
|
+
const clause = entry.importClause
|
|
32
|
+
if (!clause || clause.isTypeOnly) continue
|
|
33
|
+
const bindings = clause.namedBindings
|
|
34
|
+
if (bindings && ts.isNamedImports(bindings)) {
|
|
35
|
+
for (const specifier of bindings.elements) {
|
|
36
|
+
if (specifier.isTypeOnly) continue
|
|
37
|
+
const imported = (specifier.propertyName ?? specifier.name).text
|
|
38
|
+
if (
|
|
39
|
+
['@lexibase/rdx-next', '@lexibase/rdx-core/config'].includes(name) &&
|
|
40
|
+
imported === 'defineConfig'
|
|
41
|
+
)
|
|
42
|
+
definitions.add(specifier.name.text)
|
|
43
|
+
if (name === versioningPackage && imported === 'versioning') {
|
|
44
|
+
if (factory) throw new Error(manual)
|
|
45
|
+
factory = specifier.name.text
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} else if (
|
|
49
|
+
bindings &&
|
|
50
|
+
ts.isNamespaceImport(bindings) &&
|
|
51
|
+
name === versioningPackage
|
|
52
|
+
) {
|
|
53
|
+
if (factory) throw new Error(manual)
|
|
54
|
+
factory = `${bindings.name.text}.versioning`
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const exports = file.statements.filter(ts.isExportAssignment)
|
|
58
|
+
if (exports.length !== 1 || exports[0].isExportEquals) throw new Error(manual)
|
|
59
|
+
let config = unwrap(exports[0].expression)
|
|
60
|
+
if (ts.isCallExpression(config)) {
|
|
61
|
+
if (
|
|
62
|
+
!ts.isIdentifier(config.expression) ||
|
|
63
|
+
!definitions.has(config.expression.text) ||
|
|
64
|
+
config.arguments.length !== 1
|
|
65
|
+
)
|
|
66
|
+
throw new Error(manual)
|
|
67
|
+
config = unwrap(config.arguments[0])
|
|
68
|
+
}
|
|
69
|
+
if (!ts.isObjectLiteralExpression(config)) throw new Error(manual)
|
|
70
|
+
const properties = config.properties
|
|
71
|
+
if (
|
|
72
|
+
properties.some(
|
|
73
|
+
(entry) =>
|
|
74
|
+
!ts.isPropertyAssignment(entry) || ts.isComputedPropertyName(entry.name)
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
throw new Error(manual)
|
|
78
|
+
const pluginsProperties = properties.filter(
|
|
79
|
+
(entry) => entry.name.text === 'plugins'
|
|
80
|
+
)
|
|
81
|
+
if (pluginsProperties.length > 1) throw new Error(manual)
|
|
82
|
+
const plugins = pluginsProperties.length
|
|
83
|
+
? unwrap(pluginsProperties[0].initializer)
|
|
84
|
+
: undefined
|
|
85
|
+
if (
|
|
86
|
+
plugins &&
|
|
87
|
+
(!ts.isArrayLiteralExpression(plugins) ||
|
|
88
|
+
plugins.elements.some(ts.isSpreadElement))
|
|
89
|
+
)
|
|
90
|
+
throw new Error(manual)
|
|
91
|
+
if (plugins && factory) {
|
|
92
|
+
const matches = plugins.elements.filter(
|
|
93
|
+
(entry) =>
|
|
94
|
+
ts.isCallExpression(unwrap(entry)) &&
|
|
95
|
+
unwrap(entry).expression.getText(file) === factory
|
|
96
|
+
)
|
|
97
|
+
if (matches.length > 1)
|
|
98
|
+
throw new Error(
|
|
99
|
+
'Versioning is configured more than once. Remove the duplicate plugin before retrying.'
|
|
100
|
+
)
|
|
101
|
+
if (matches.length === 1) return source
|
|
102
|
+
}
|
|
103
|
+
const newline = source.includes('\r\n') ? '\r\n' : '\n'
|
|
104
|
+
const edits = []
|
|
105
|
+
if (!factory) {
|
|
106
|
+
const identifiers = new Set()
|
|
107
|
+
function visit(node) {
|
|
108
|
+
if (ts.isIdentifier(node)) identifiers.add(node.text)
|
|
109
|
+
ts.forEachChild(node, visit)
|
|
110
|
+
}
|
|
111
|
+
visit(file)
|
|
112
|
+
factory = 'versioning'
|
|
113
|
+
let suffix = 1
|
|
114
|
+
while (identifiers.has(factory)) factory = `rdxVersioning${suffix++}`
|
|
115
|
+
const specifier =
|
|
116
|
+
factory === 'versioning' ? 'versioning' : `versioning as ${factory}`
|
|
117
|
+
let position = imports.length
|
|
118
|
+
? imports.at(-1).end
|
|
119
|
+
: file.statements[0].getStart(file)
|
|
120
|
+
if (!imports.length) {
|
|
121
|
+
for (const statement of file.statements) {
|
|
122
|
+
if (
|
|
123
|
+
!ts.isExpressionStatement(statement) ||
|
|
124
|
+
!ts.isStringLiteral(statement.expression)
|
|
125
|
+
)
|
|
126
|
+
break
|
|
127
|
+
position = statement.end
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
edits.push({
|
|
131
|
+
position,
|
|
132
|
+
text: `${newline}import { ${specifier} } from '${versioningPackage}'${newline}`,
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
if (plugins) {
|
|
136
|
+
const position = plugins.elements.length
|
|
137
|
+
? plugins.elements.at(-1).end
|
|
138
|
+
: plugins.getStart(file) + 1
|
|
139
|
+
edits.push({
|
|
140
|
+
position,
|
|
141
|
+
text: `${plugins.elements.length ? ',' : ''} ${factory}()`,
|
|
142
|
+
})
|
|
143
|
+
} else {
|
|
144
|
+
if (properties.length && !properties.hasTrailingComma)
|
|
145
|
+
edits.push({ position: properties.at(-1).end, text: ',' })
|
|
146
|
+
edits.push({
|
|
147
|
+
position: config.end - 1,
|
|
148
|
+
text: `${newline} plugins: [${factory}()],${newline}`,
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
for (const edit of edits.sort((a, b) => b.position - a.position))
|
|
152
|
+
source =
|
|
153
|
+
source.slice(0, edit.position) + edit.text + source.slice(edit.position)
|
|
154
|
+
return source
|
|
155
|
+
}
|
package/bin/rdx.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { createJiti } from 'jiti'
|
|
|
13
13
|
import { preparePublicAssets } from './public-assets.mjs'
|
|
14
14
|
|
|
15
15
|
const supportedCommands = new Set(['dev', 'build', 'start'])
|
|
16
|
-
|
|
16
|
+
let command = process.argv[2]
|
|
17
17
|
const commandArgs = process.argv.slice(3)
|
|
18
18
|
const projectRoot = process.cwd()
|
|
19
19
|
const packageRoot = path.resolve(
|
|
@@ -31,13 +31,23 @@ async function prepareRuntime() {
|
|
|
31
31
|
|
|
32
32
|
async function main() {
|
|
33
33
|
if (!command || command === 'help' || command === '--help') {
|
|
34
|
-
console.log('Usage: rdx <dev|build|start|prepare|plugin-command>')
|
|
34
|
+
console.log('Usage: rdx <dev|build|start|prepare|add|plugin-command>')
|
|
35
|
+
console.log(' rdx add versioning [--package-manager npm|pnpm|yarn]')
|
|
35
36
|
console.log(
|
|
36
37
|
'Plugin commands are registered through plugins in rdx.config.ts.'
|
|
37
38
|
)
|
|
38
39
|
return
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
if (command === 'add') {
|
|
43
|
+
const { addVersioning, parseAddArguments } = await import(
|
|
44
|
+
'./add-plugin.mjs'
|
|
45
|
+
)
|
|
46
|
+
const options = parseAddArguments(commandArgs)
|
|
47
|
+
await addVersioning(projectRoot, options)
|
|
48
|
+
command = 'prepare'
|
|
49
|
+
}
|
|
50
|
+
|
|
41
51
|
const configPath = path.join(projectRoot, 'rdx.config.ts')
|
|
42
52
|
try {
|
|
43
53
|
await access(configPath)
|
|
@@ -78,7 +88,7 @@ async function main() {
|
|
|
78
88
|
)
|
|
79
89
|
if (!pluginCommand)
|
|
80
90
|
throw new Error(
|
|
81
|
-
`Unknown command "${command}". Available: dev, build, start, prepare${project.commands.map((entry) => `, ${entry.name}`).join('')}. Install and configure the plugin that provides this command.`
|
|
91
|
+
`Unknown command "${command}". Available: dev, build, start, prepare, add${project.commands.map((entry) => `, ${entry.name}`).join('')}. Install and configure the plugin that provides this command.`
|
|
82
92
|
)
|
|
83
93
|
await pluginCommand.run({
|
|
84
94
|
rootDir: projectRoot,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexibase/rdx-next",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.9",
|
|
4
4
|
"description": "The Next.js runtime for RDX documentation projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,11 +28,13 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"cross-spawn": "^7.0.6",
|
|
32
|
+
"typescript": "5.9.2",
|
|
31
33
|
"jiti": "^2.6.1",
|
|
32
34
|
"next-mdx-remote": "^5.0.0",
|
|
33
35
|
"@lexibase/rdx-ui": "1.0.0-beta.1",
|
|
34
36
|
"@lexibase/rdx-types": "1.0.0-beta.4",
|
|
35
|
-
"@lexibase/rdx-core": "1.0.0-beta.
|
|
37
|
+
"@lexibase/rdx-core": "1.0.0-beta.6"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
40
|
"next": "^15.5.0",
|
|
@@ -59,9 +61,8 @@
|
|
|
59
61
|
"next": "^15.5.0",
|
|
60
62
|
"react": "19.1.0",
|
|
61
63
|
"react-dom": "19.1.0",
|
|
62
|
-
"
|
|
63
|
-
"@rdx/typescript-config": "1.0.0"
|
|
64
|
-
"@rdx/eslint-config": "1.0.0"
|
|
64
|
+
"@rdx/eslint-config": "1.0.0",
|
|
65
|
+
"@rdx/typescript-config": "1.0.0"
|
|
65
66
|
},
|
|
66
67
|
"scripts": {
|
|
67
68
|
"build": "tsup src/index.ts src/runtime/index.tsx --format esm --dts --clean --external @lexibase/rdx-core --external @lexibase/rdx-types --external next --external react --external react-dom --external next-mdx-remote",
|