@emeryld/manager 0.6.1 → 0.6.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/dist/create-package/index.js +7 -8
- package/dist/create-package/shared.js +7 -0
- package/dist/create-package/variants/client/client_expo_rn.js +4 -0
- package/dist/create-package/variants/client/client_vite_r.js +7 -1
- package/dist/create-package/variants/contract.js +6 -8
- package/package.json +1 -1
|
@@ -89,14 +89,13 @@ async function promptForClientKind(existing) {
|
|
|
89
89
|
selection = opt.id;
|
|
90
90
|
},
|
|
91
91
|
}));
|
|
92
|
-
scripts.push({
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
92
|
+
// scripts.push({
|
|
93
|
+
// name: `Use default (${defaultKind})`,
|
|
94
|
+
// emoji: '✅',
|
|
95
|
+
// handler: () => {
|
|
96
|
+
// selection = defaultKind
|
|
97
|
+
// },
|
|
98
|
+
// })
|
|
100
99
|
await runHelperCli({
|
|
101
100
|
title: 'Select a client template',
|
|
102
101
|
scripts,
|
|
@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { access, mkdir, writeFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { promptYesNoAll } from '../prompts.js';
|
|
5
|
+
import { ModuleResolutionKind } from 'typescript';
|
|
5
6
|
export const workspaceRoot = process.cwd();
|
|
6
7
|
export function isWorkspaceRoot(dir) {
|
|
7
8
|
return path.resolve(dir) === path.resolve(workspaceRoot);
|
|
@@ -347,6 +348,12 @@ export async function packageTsConfig(targetDir, options) {
|
|
|
347
348
|
esModuleInterop: options?.esModuleInterop ?? true,
|
|
348
349
|
allowSyntheticDefaultImports: options?.esModuleInterop ?? true,
|
|
349
350
|
skipLibCheck: options?.skipLibCheck ?? true,
|
|
351
|
+
target: options?.target,
|
|
352
|
+
module: options?.module,
|
|
353
|
+
moduleResolution: options?.ModuleResolutionKind !== undefined
|
|
354
|
+
? ModuleResolutionKind[options.ModuleResolutionKind]
|
|
355
|
+
: undefined,
|
|
356
|
+
declarationMap: options?.declarationMap,
|
|
350
357
|
});
|
|
351
358
|
const config = stripUndefined({
|
|
352
359
|
extends: extendsPath,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModuleResolutionKind } from 'typescript';
|
|
1
2
|
import { BASE_LINT_DEV_DEPENDENCIES, basePackageFiles, basePackageJson, baseScripts, buildReadme, isWorkspaceRoot, packageTsConfig, writeFileIfMissing, } from '../../shared.js';
|
|
2
3
|
const EXPO_CLIENT_SCRIPTS = [
|
|
3
4
|
'dev',
|
|
@@ -480,6 +481,9 @@ export async function scaffoldExpoReactNativeClient(ctx) {
|
|
|
480
481
|
include: ['App.tsx', 'src/**/*.ts', 'src/**/*.tsx'],
|
|
481
482
|
jsx: 'react-native',
|
|
482
483
|
types: ['react', 'react-native'],
|
|
484
|
+
target: 'ES2022',
|
|
485
|
+
module: 'ESNext',
|
|
486
|
+
ModuleResolutionKind: ModuleResolutionKind.Bundler,
|
|
483
487
|
rootDir: '.',
|
|
484
488
|
});
|
|
485
489
|
const files = {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModuleResolutionKind } from 'typescript';
|
|
1
2
|
import { BASE_LINT_DEV_DEPENDENCIES, basePackageFiles, basePackageJson, baseScripts, buildReadme, isWorkspaceRoot, packageTsConfig, writeFileIfMissing, } from '../../shared.js';
|
|
2
3
|
const VITE_CLIENT_SCRIPTS = [
|
|
3
4
|
'dev',
|
|
@@ -525,10 +526,15 @@ function indexHtml() {
|
|
|
525
526
|
export async function scaffoldViteReactClient(ctx) {
|
|
526
527
|
const includePrepare = isWorkspaceRoot(ctx.targetDir);
|
|
527
528
|
const tsconfig = await packageTsConfig(ctx.targetDir, {
|
|
528
|
-
include: ['src
|
|
529
|
+
include: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
529
530
|
lib: ['ES2022', 'DOM'],
|
|
530
531
|
types: ['vite/client'],
|
|
531
532
|
jsx: 'react-jsx',
|
|
533
|
+
target: 'ES2022',
|
|
534
|
+
module: 'ESNext',
|
|
535
|
+
ModuleResolutionKind: ModuleResolutionKind.Bundler,
|
|
536
|
+
esModuleInterop: true,
|
|
537
|
+
skipLibCheck: true,
|
|
532
538
|
});
|
|
533
539
|
const files = {
|
|
534
540
|
'package.json': vitePackageJson(ctx.pkgName, ctx.contractName, includePrepare),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModuleResolutionKind } from 'typescript';
|
|
1
2
|
import { BASE_LINT_DEV_DEPENDENCIES, basePackageFiles, basePackageJson, buildReadme, baseScripts, packageTsConfig, isWorkspaceRoot, writeFileIfMissing, } from '../shared.js';
|
|
2
3
|
const CONTRACT_SCRIPTS = [
|
|
3
4
|
'dev',
|
|
@@ -16,16 +17,9 @@ const CONTRACT_SCRIPTS = [
|
|
|
16
17
|
* in some module shapes (CJS export= or default export). To make scaffolds compile reliably,
|
|
17
18
|
* we import as a namespace and then grab from either `default` or the namespace object.
|
|
18
19
|
*/
|
|
19
|
-
export const CONTRACT_TS = `import
|
|
20
|
+
export const CONTRACT_TS = `import { defineSocketEvents, finalize, resource } from '@emeryld/rrroutes-contract'
|
|
20
21
|
import { z } from 'zod'
|
|
21
22
|
|
|
22
|
-
const api = (rrroutesContract as any).default ?? rrroutesContract
|
|
23
|
-
const { defineSocketEvents, finalize, resource } = api as {
|
|
24
|
-
defineSocketEvents: (...args: any[]) => any
|
|
25
|
-
finalize: (...args: any[]) => any
|
|
26
|
-
resource: (...args: any[]) => any
|
|
27
|
-
}
|
|
28
|
-
|
|
29
23
|
const routes = resource('/api')
|
|
30
24
|
.sub(
|
|
31
25
|
resource('health')
|
|
@@ -121,6 +115,10 @@ async function contractFiles(pkgName, targetDir) {
|
|
|
121
115
|
const tsconfig = await packageTsConfig(targetDir, {
|
|
122
116
|
include: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
123
117
|
skipLibCheck: true,
|
|
118
|
+
"target": "ES2022",
|
|
119
|
+
"module": "ESNext",
|
|
120
|
+
"declarationMap": true,
|
|
121
|
+
ModuleResolutionKind: ModuleResolutionKind.Bundler,
|
|
124
122
|
});
|
|
125
123
|
return {
|
|
126
124
|
'package.json': contractPackageJson(pkgName, { includePrepare }),
|