-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹 CLI: Add type exports to CLI package [2/N] (#704)
- Loading branch information
1 parent
776f9cd
commit 059fbc8
Showing
12 changed files
with
121 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@layerzerolabs/devtools-cli": patch | ||
--- | ||
|
||
Add exports to CLI package to expose types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
import('./dist/index.js'); | ||
import('./dist/cli.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Command } from 'commander' | ||
import { version, name } from '../package.json' | ||
import { oapp } from './commands/oapp' | ||
|
||
new Command(name).description('CLI for configuring LayerZero OApps').version(version).addCommand(oapp).parseAsync() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
import { Command } from 'commander' | ||
import { version, name } from '../package.json' | ||
import { oapp } from './commands/oapp' | ||
|
||
new Command(name).description('CLI for configuring LayerZero OApps').version(version).addCommand(oapp).parseAsync() | ||
export * from './types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './loading' | ||
export * from './schema' | ||
export * from './types' | ||
export * from './typescript' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { z } from 'zod' | ||
import type { CLISetup } from './types' | ||
import type { CLISetup } from '@/types' | ||
import { EndpointIdSchema, OmniPointSchema } from '@layerzerolabs/devtools' | ||
|
||
export const CLISetupSchema: z.ZodSchema<CLISetup, z.ZodTypeDef, unknown> = z.object({ | ||
createSdk: z.function().args(OmniPointSchema).returns(z.any()), | ||
createSigner: z.function().args(EndpointIdSchema).returns(z.any()), | ||
configure: z.function().args(z.any(), z.any()).returns(z.any()).optional(), | ||
loadConfig: z.function().args(z.string()).returns(z.any()).optional(), | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { | ||
Configurator, | ||
Factory, | ||
IOmniSDK, | ||
OmniGraph, | ||
OmniSDKFactory, | ||
OmniSignerFactory, | ||
} from '@layerzerolabs/devtools' | ||
|
||
export interface CLISetup<TOmniGraph extends OmniGraph = OmniGraph<unknown, unknown>, TOmniSDK = IOmniSDK> { | ||
createSdk: OmniSDKFactory<TOmniSDK> | ||
createSigner: OmniSignerFactory | ||
configure?: Configurator<TOmniGraph, TOmniSDK> | ||
loadConfig?: Factory<[configPath: string], TOmniGraph> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
import { defineConfig } from 'tsup' | ||
|
||
export default defineConfig({ | ||
entry: ['src/index.ts'], | ||
outDir: './dist', | ||
clean: true, | ||
dts: false, | ||
minify: true, | ||
sourcemap: false, | ||
splitting: false, | ||
treeshake: true, | ||
format: ['cjs'], | ||
env: { | ||
NODE_ENV: 'production', | ||
export default defineConfig([ | ||
{ | ||
entry: ['src/cli.ts'], | ||
outDir: './dist', | ||
dts: false, | ||
minify: false, | ||
sourcemap: false, | ||
splitting: false, | ||
treeshake: true, | ||
format: ['cjs'], | ||
env: { | ||
NODE_ENV: 'production', | ||
}, | ||
external: ['yoga-layout-prebuilt'], | ||
}, | ||
external: ['yoga-layout-prebuilt'], | ||
}) | ||
{ | ||
entry: ['src/index.ts'], | ||
outDir: './dist', | ||
dts: true, | ||
sourcemap: true, | ||
splitting: false, | ||
treeshake: true, | ||
format: ['cjs', 'esm'], | ||
}, | ||
]) |