Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center">create-paraspell ✨</h1>
<h1 align="center">paraspell-cli ✨</h1>

<p align="center">
<img width="400" alt="ParaSpell logo" src="https://github.com/paraspell/xcm-tools/assets/55763425/a65e3626-84cf-444b-ab77-9375508e5895">
Expand All @@ -23,7 +23,7 @@
## Get started

```bash
pnpm create-paraspell
pnpm dlx paraspell-cli@latest
```

The wizard helps you choose what to build, shows you the final setup, creates
Expand All @@ -37,9 +37,9 @@ pnpm dev
Use npm, Yarn, or Bun instead if that is what your project uses:

```bash
npm create paraspell@latest
yarn create paraspell
bun create paraspell
npx paraspell-cli@latest
yarn dlx paraspell-cli@latest
bunx paraspell-cli@latest
```

Requires Node.js 24 or newer.
Expand Down Expand Up @@ -85,19 +85,19 @@ Prefer explicit commands in CI or when you already know the setup you want:

```bash
# React app using the XCM SDK and PAPI
npx create-paraspell@latest sdk react \
npx paraspell-cli@latest sdk react \
--name my-xcm-app \
--client papi \
--package-manager pnpm

# Vue app using the XCM API with EVM origins and swaps
npx create-paraspell@latest api vue \
npx paraspell-cli@latest api vue \
--name my-xcm-api \
--extensions evm,swap \
--package-manager npm

# Headless SDK server with swaps
npx create-paraspell@latest sdk node \
npx paraspell-cli@latest sdk node \
--name my-xcm-server \
--client dedot \
--extensions swap
Expand All @@ -107,9 +107,9 @@ Non-interactive environments use sensible defaults and leave dependency
installation as an explicit CI step.

```bash
create-paraspell --help
create-paraspell sdk --help
create-paraspell api --help
paraspell-cli --help
paraspell-cli sdk --help
paraspell-cli api --help
```

## A note about wallet secrets
Expand Down
52 changes: 29 additions & 23 deletions e2e/generated-projects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const PACKAGE_MANAGER_COMMANDS: Record<
const GENERATION_CASES = BUILD_CASES.map(
(testCase) => [caseId(testCase), testCase] as const,
);
const MATRIX_BUILD_TIMEOUT_MS = 10 * 60 * 1000;

let root: string;
let projectsRoot: string;
Expand All @@ -59,35 +60,40 @@ describe('generated projects', () => {
await generateProject(testCase, projectPath(testCase));
});

it('builds every supported project combination', async () => {
const firstWorkspace = projectPath(BUILD_CASES[0]);
const allowBuilds = fs.readFileSync(
path.join(firstWorkspace, 'pnpm-workspace.yaml'),
'utf8',
);
it(
'builds and lints every supported project combination',
async () => {
const firstWorkspace = projectPath(BUILD_CASES[0]);
const allowBuilds = fs.readFileSync(
path.join(firstWorkspace, 'pnpm-workspace.yaml'),
'utf8',
);

fs.writeFileSync(
path.join(root, 'package.json'),
JSON.stringify({ name: 'generated-projects', private: true }),
);
fs.writeFileSync(
path.join(root, 'pnpm-workspace.yaml'),
`packages:
fs.writeFileSync(
path.join(root, 'package.json'),
JSON.stringify({ name: 'generated-projects', private: true }),
);
fs.writeFileSync(
path.join(root, 'pnpm-workspace.yaml'),
`packages:
- projects/*-pnpm
overrides:
"@polkadot-api/json-rpc-provider": ^0.2.0
${allowBuilds}`,
);
);

await runCommand('pnpm', ['install'], {
cwd: root,
});
await runCommand(
'pnpm',
['--recursive', '--workspace-concurrency=4', 'run', 'build'],
{ cwd: root },
);
});
await runCommand('pnpm', ['install'], {
cwd: root,
});
await runCommand('pnpm', ['-r', '--no-bail', 'run', 'build'], {
cwd: root,
});
await runCommand('pnpm', ['-r', '--no-bail', 'run', 'lint'], {
cwd: root,
});
},
MATRIX_BUILD_TIMEOUT_MS,
);

const installAndBuild = async (
testCase: TGenerationCase,
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import eslintConfigPrettier from 'eslint-config-prettier/flat';
import tseslint from 'typescript-eslint';

export default defineConfig({
name: 'create-paraspell/typescript',
name: 'paraspell-cli/typescript',
files: ['src/**/*.ts', 'e2e/**/*.ts'],
extends: [
js.configs.recommended,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "create-paraspell",
"name": "paraspell-cli",
"version": "1.0.0",
"description": "Scaffold ParaSpell XCM SDK and XCM API starter apps",
"type": "module",
"license": "MIT",
"author": "ParaSpell",
"bin": {
"create-paraspell": "dist/index.js"
"paraspell-cli": "dist/index.js"
},
"files": [
"dist",
Expand Down
9 changes: 2 additions & 7 deletions src/generator/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ describe('createTemplateContext', () => {
},
);

it.each([
[{ evm: false, swap: false, snowbridge: false }, 'Astar'],
[{ evm: true, swap: false, snowbridge: false }, 'Moonbeam'],
[{ evm: true, swap: false, snowbridge: true }, 'Ethereum'],
])('selects the default origin for %o', (extensions, expected) => {
it('selects the Node start command', () => {
const context = createTemplateContext({
kind: 'sdk',
opts: {
Expand All @@ -60,11 +56,10 @@ describe('createTemplateContext', () => {
client: 'papi',
packageManager: 'pnpm',
out: '/tmp/example',
extensions,
extensions: { evm: false, swap: false, snowbridge: false },
},
});

expect(context.defaultOriginChain).toBe(expected);
expect(context.startCmd).toBe('pnpm start');
});
});
5 changes: 0 additions & 5 deletions src/generator/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,5 @@ export const createTemplateContext = ({
projectKind: kind,
extensions: opts.extensions,
evmWallet: requiresEvmWallet(opts.extensions),
defaultOriginChain: opts.extensions.snowbridge
? 'Ethereum'
: opts.extensions.evm
? 'Moonbeam'
: 'Astar',
};
};
5 changes: 3 additions & 2 deletions src/generator/template-dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@paraspell/cli-template-dependencies",
"version": "0.0.0",
"private": true,
"description": "Canonical dependency versions emitted by create-paraspell",
"description": "Canonical dependency versions emitted by paraspell-cli",
"dependencies": {
"@eslint/js": "^10.0.1",
"@paraspell/descriptors": "14.1.0",
Expand All @@ -23,6 +23,7 @@
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.4",
"@vitejs/plugin-vue": "^6.0.8",
"@vue/tsconfig": "^0.9.1",
"axios": "^1.18.1",
"dedot": "^1.3.0",
"dotenv": "^17.4.2",
Expand All @@ -41,7 +42,7 @@
"tsx": "^4.23.1",
"typescript": "^6.0.3",
"typescript-eslint": "^8.65.0",
"viem": "2.55.5",
"viem": "2.55.11",
"vite": "^8.1.5",
"vite-plugin-wasm": "^3.6.0",
"vue": "^3.5.40",
Expand Down
Loading