@emeryld/manager 0.6.2 → 0.6.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.
|
@@ -83,7 +83,7 @@ async function promptForClientKind(existing) {
|
|
|
83
83
|
let selection;
|
|
84
84
|
const scripts = CLIENT_KIND_OPTIONS.map((opt) => ({
|
|
85
85
|
name: opt.label,
|
|
86
|
-
emoji: '💻',
|
|
86
|
+
emoji: opt.id == 'vite-react' ? '💻' : opt.id == 'expo-react-native' ? '📱' : '🌐',
|
|
87
87
|
description: opt.summary,
|
|
88
88
|
handler: () => {
|
|
89
89
|
selection = opt.id;
|
|
@@ -353,6 +353,7 @@ export async function packageTsConfig(targetDir, options) {
|
|
|
353
353
|
moduleResolution: options?.ModuleResolutionKind !== undefined
|
|
354
354
|
? ModuleResolutionKind[options.ModuleResolutionKind]
|
|
355
355
|
: undefined,
|
|
356
|
+
delcaration: options?.declarationMap,
|
|
356
357
|
declarationMap: options?.declarationMap,
|
|
357
358
|
});
|
|
358
359
|
const config = stripUndefined({
|
|
@@ -309,8 +309,8 @@ function rootPnpmWorkspace(patterns) {
|
|
|
309
309
|
}
|
|
310
310
|
function rootTsconfigBase(baseName, names) {
|
|
311
311
|
const paths = {
|
|
312
|
-
[names.contract]: [`packages/${baseName}-contract/
|
|
313
|
-
[`${names.contract}/*`]: [`packages/${baseName}-contract/
|
|
312
|
+
[names.contract]: [`packages/${baseName}-contract/dist`],
|
|
313
|
+
[`${names.contract}/*`]: [`packages/${baseName}-contract/dist/*`],
|
|
314
314
|
[names.server]: [`packages/${baseName}-server/src`],
|
|
315
315
|
[`${names.server}/*`]: [`packages/${baseName}-server/src/*`],
|
|
316
316
|
[names.client]: [`packages/${baseName}-client/src`],
|
package/dist/helper-cli.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
2
3
|
import { createRequire } from 'node:module';
|
|
3
4
|
import readline from 'node:readline/promises';
|
|
4
5
|
import { stdin as input, stdout as output } from 'node:process';
|
|
5
6
|
import { fileURLToPath } from 'node:url';
|
|
6
7
|
import path from 'node:path';
|
|
7
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
-
const
|
|
9
|
+
const managerRoot = path.resolve(path.dirname(__filename), '..');
|
|
10
|
+
// Workspace root is wherever the CLI is executed.
|
|
11
|
+
const rootDir = process.cwd();
|
|
9
12
|
const managerRequire = createRequire(import.meta.url);
|
|
10
13
|
let tsNodeLoaderPath;
|
|
11
14
|
function getTsNodeLoaderPath() {
|
|
@@ -237,6 +240,15 @@ function runEntry(entry, forwardedArgs) {
|
|
|
237
240
|
}
|
|
238
241
|
const scriptPath = entry.absoluteScript;
|
|
239
242
|
const tsConfigPath = path.join(rootDir, 'tsconfig.base.json');
|
|
243
|
+
const tsConfigFallback = path.join(rootDir, 'tsconfig.json');
|
|
244
|
+
const bundledTsconfig = path.join(managerRoot, 'tsconfig.base.json');
|
|
245
|
+
const projectPath = existsSync(tsConfigPath)
|
|
246
|
+
? tsConfigPath
|
|
247
|
+
: existsSync(tsConfigFallback)
|
|
248
|
+
? tsConfigFallback
|
|
249
|
+
: existsSync(bundledTsconfig)
|
|
250
|
+
? bundledTsconfig
|
|
251
|
+
: undefined;
|
|
240
252
|
const extension = path.extname(scriptPath).toLowerCase();
|
|
241
253
|
const isTypeScript = extension === '.js' || extension === '.mts' || extension === '.cts';
|
|
242
254
|
const command = process.execPath;
|
|
@@ -253,7 +265,10 @@ function runEntry(entry, forwardedArgs) {
|
|
|
253
265
|
cwd: rootDir,
|
|
254
266
|
stdio: 'inherit',
|
|
255
267
|
env: isTypeScript
|
|
256
|
-
? {
|
|
268
|
+
? {
|
|
269
|
+
...process.env,
|
|
270
|
+
...(projectPath ? { TS_NODE_PROJECT: projectPath } : {}),
|
|
271
|
+
}
|
|
257
272
|
: process.env,
|
|
258
273
|
shell: process.platform === 'win32' && isTypeScript,
|
|
259
274
|
});
|
package/dist/utils/run.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/utils/run.js
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const rootDir =
|
|
3
|
+
// Always execute commands from the workspace where the CLI is invoked.
|
|
4
|
+
// This makes installs from node_modules behave correctly instead of
|
|
5
|
+
// running in the package's own directory.
|
|
6
|
+
export const rootDir = process.cwd();
|
|
7
7
|
export function run(command, args, options = {}) {
|
|
8
8
|
return new Promise((resolve, reject) => {
|
|
9
9
|
const child = spawn(command, args, {
|