diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc6c08e..2cb0154 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: - run: npm config set "//registry.npmjs.org/:_authToken" "\${NPM_AUTH_TOKEN}" --location=global - - run: pnpm -r exec "if [ \"$(node -p \"require('./package.json').private\")\" = \"false\" ]; then npm publish --access public --tag latest --no-git-checks; fi" + - run: pnpm -r publish --access public --tag latest --no-git-checks env: NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/packages/create-levain-app/src/ProjectProgram.ts b/packages/create-levain-app/src/ProjectProgram.ts index 4575767..5657768 100644 --- a/packages/create-levain-app/src/ProjectProgram.ts +++ b/packages/create-levain-app/src/ProjectProgram.ts @@ -5,11 +5,13 @@ import ExampleIndex from '@levain-examples/examples/dist/Example/index.json'; import { green } from 'picocolors'; import prompts from 'prompts'; +import { version } from '../package.json'; import { isFolderEmpty } from './utils/FolderEmpty'; import { isNpmNameValid } from './utils/NpmNameValid'; export interface ProjectConfig { path: string; + version: string; template: { packageName: string; projectName: string; @@ -65,6 +67,7 @@ export class ProjectProgram { return { path: res.path, + version, template: ExampleIndex.find((example) => example.fields.template?.packageName === res.packageName)?.fields .template!, }; diff --git a/packages/create-levain-app/src/TemplateProgram.ts b/packages/create-levain-app/src/TemplateProgram.ts index da46e09..2b4a017 100644 --- a/packages/create-levain-app/src/TemplateProgram.ts +++ b/packages/create-levain-app/src/TemplateProgram.ts @@ -11,7 +11,7 @@ export class TemplateProgram { static async run(projectConfig: ProjectConfig): Promise { console.log(` Downloading ${blue(projectConfig.template.packageName)} into ${blue(`./${projectConfig.path}`)}`); const installDir = join(process.cwd(), projectConfig.path); - const packageSpec = `${projectConfig.template.packageName}@latest`; + const packageSpec = `${projectConfig.template.packageName}@${projectConfig.version}`; await pacote.extract(packageSpec, installDir); await overridePackageJson(installDir, projectConfig);