diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 4b82f25b8..9629419b5 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -20,6 +20,4 @@ jobs: with: node-version: 20 - uses: pnpm/action-setup@v4 - with: - version: 9.4 - run: pnpm audit diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 57121b918..4a3e9839d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,8 +25,6 @@ jobs: node-version: 20 - uses: pnpm/action-setup@v4 - with: - version: 9.4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml index e95083bc1..a110cb6ff 100644 --- a/.github/workflows/openapi.yml +++ b/.github/workflows/openapi.yml @@ -16,8 +16,6 @@ jobs: with: node-version: 20 - uses: pnpm/action-setup@v4 - with: - version: 9.4 - run: cd packages/web3 && pnpm i # Wait for this issue to be resolved: https://github.com/acacode/swagger-typescript-api/issues/370 - run: npm run update-schemas && test -z "$(git status --porcelain)" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 57d926b37..7d75c80ed 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,8 +46,6 @@ jobs: node-version: 20 registry-url: 'https://registry.npmjs.org' - uses: pnpm/action-setup@v4 - with: - version: 9.4 - run: pnpm install - run: git status - name: Publish to npm diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eaaa786c3..0b3a31eac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,8 +20,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - uses: pnpm/action-setup@v4 - with: - version: 9.4 - run: | pushd docker docker compose up -d diff --git a/package.json b/package.json index 13ed945d2..e7cf1e6c2 100644 --- a/package.json +++ b/package.json @@ -59,5 +59,6 @@ "elliptic@>=5.2.1 <=6.5.6": ">=6.5.7", "micromatch@<4.0.8": ">=4.0.8" } - } + }, + "packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca" } diff --git a/packages/cli/cli_internal.ts b/packages/cli/cli_internal.ts index c7d1ff8ae..b178b929b 100644 --- a/packages/cli/cli_internal.ts +++ b/packages/cli/cli_internal.ts @@ -22,7 +22,7 @@ import { run as runJestTests } from 'jest' import path from 'path' import { deployAndSaveProgress } from './scripts/deploy' import { Configuration, DEFAULT_CONFIGURATION_VALUES } from './src/types' -import { createProject } from './scripts/create-project' +import { createProject, genRalph } from './scripts/create-project' import { checkFullNodeVersion, codegen, @@ -81,6 +81,13 @@ program createProject(templateType, __dirname, projectRoot) }) +program + .command('gen-ralph') + .description('generate ralph contract template for an existing project') + .action(() => { + genRalph(__dirname, process.cwd()) + }) + program .command('compile') .description('compile the project') diff --git a/packages/cli/scripts/create-project.ts b/packages/cli/scripts/create-project.ts index 70f413026..585ca3a0c 100755 --- a/packages/cli/scripts/create-project.ts +++ b/packages/cli/scripts/create-project.ts @@ -104,3 +104,23 @@ export function createProject(templateType: string, packageRoot: string, project console.log(`Next step: checkout the readme under <${projectRoot}>`) console.log() } + +export function genRalph(packageRoot: string, projectRoot: string) { + console.log('Creating the Ralph Template for the existing project') + for (const dir of ['contracts', 'scripts', 'test', 'alephium.config.ts']) { + fsExtra.copySync(path.join(packageRoot, 'templates/base', dir), path.join(projectRoot, dir)) + } + console.log('✅ Done.') + console.log(` +Please install the dependencies: + @alephium/web3 + @alephium/web3-wallet + +Dev dependencies: + @alephium/web3-test + +And add the following to your package.json scripts: + "compile": "npx cli compile", + "deploy": "npx cli deploy", +`) +}