Skip to content

Commit

Permalink
fix: main file to dist/bin.js
Browse files Browse the repository at this point in the history
  • Loading branch information
YassinEldeeb committed Jan 9, 2022
1 parent 38ab128 commit d21f92d
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 129 deletions.
232 changes: 108 additions & 124 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,165 +7,149 @@ on:
branches: ['*']

jobs:
debugging-issue:
runs-on: macos-latest
unit-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 15.x, 16.x, 17.x]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
fetch-depth: 100
- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- uses: YassinEldeeb/has-changed-path@v2.1
id: changed-packages
with:
paths: packages

- name: Setup PNPM
if: steps.changed-packages.outputs.changed == 'true'
uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6

- name: Simulate CLI build
if: steps.changed-packages.outputs.changed == 'true'
run: pnpm simulate-dist

- name: Install dependencies
if: steps.changed-packages.outputs.changed == 'true'
run: pnpm i --frozen-lockfile

- name: Build CLI
run: |
cd packages/create-prisma-generator
pnpm build
- name: Run Tests 🧪
if: steps.changed-packages.outputs.changed == 'true'
working-directory: ./packages/create-prisma-generator
run: pnpm test -- --testPathIgnorePatterns e2e

- name: Debugging
run: |
cd packages/cli-usage
npx create-prisma-generator
e2e-tests:
runs-on: ${{ matrix.os }}
needs: [unit-tests]
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest, macos-latest]

# unit-tests:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# node-version: [14.x, 15.x, 16.x, 17.x]
# os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 100
# - name: Use Node.js ${{matrix.node-version}}
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node-version }}
- uses: YassinEldeeb/has-changed-path@v2.1
id: changed-packages
with:
paths: packages

# - uses: YassinEldeeb/has-changed-path@v2.1
# id: changed-packages
# with:
# paths: packages
- name: Tell git who am I
if: steps.changed-packages.outputs.changed == 'true'
run: |
git config --global user.name "me"
git config --global user.email "me@example.com"
# - name: Setup PNPM
# if: steps.changed-packages.outputs.changed == 'true'
# uses: pnpm/action-setup@v2.0.1
# with:
# version: 6.23.6
- name: Setup PNPM
if: steps.changed-packages.outputs.changed == 'true'
uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6

# - name: Simulate CLI build
# if: steps.changed-packages.outputs.changed == 'true'
# run: pnpm simulate-dist
- name: Simulate CLI build
if: steps.changed-packages.outputs.changed == 'true'
run: pnpm simulate-dist

# - name: Install dependencies
# if: steps.changed-packages.outputs.changed == 'true'
# run: pnpm i --frozen-lockfile
- name: Install dependencies
if: steps.changed-packages.outputs.changed == 'true'
run: pnpm i --frozen-lockfile

# - name: Run Tests 🧪
# if: steps.changed-packages.outputs.changed == 'true'
# working-directory: ./packages/create-prisma-generator
# run: pnpm test -- --testPathIgnorePatterns e2e
- name: Run E2E Tests 🧪
if: steps.changed-packages.outputs.changed == 'true'
working-directory: ./packages/create-prisma-generator
run: pnpm test -- --testPathPattern e2e

# e2e-tests:
# runs-on: ${{ matrix.os }}
# needs: [unit-tests]
# strategy:
# matrix:
# node-version: [16.x]
# os: [ubuntu-latest, windows-latest, macos-latest]
Publish:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [unit-tests, e2e-tests]

# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 100
# - name: Use Node.js ${{matrix.node-version}}
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node-version }}

# - uses: YassinEldeeb/has-changed-path@v2.1
# id: changed-packages
# with:
# paths: packages
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
registry-url: https://registry.npmjs.org

# - name: Tell git who am I
# if: steps.changed-packages.outputs.changed == 'true'
# run: |
# git config --global user.name "me"
# git config --global user.email "me@example.com"
- uses: YassinEldeeb/has-changed-path@v2.1
id: changed-packages
with:
paths: packages

# - name: Setup PNPM
# if: steps.changed-packages.outputs.changed == 'true'
# uses: pnpm/action-setup@v2.0.1
# with:
# version: 6.23.6
- name: Setup PNPM
uses: pnpm/action-setup@v2.0.1
if: steps.changed-packages.outputs.changed == 'true'
with:
version: 6.23.6

# - name: Simulate CLI build
# if: steps.changed-packages.outputs.changed == 'true'
# run: pnpm simulate-dist
- uses: actions/cache@v2
if: steps.changed-packages.outputs.changed == 'true'
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}

# - name: Install dependencies
# if: steps.changed-packages.outputs.changed == 'true'
# run: pnpm i --frozen-lockfile
- name: Simulate CLI build
if: steps.changed-packages.outputs.changed == 'true'
run: pnpm simulate-dist

# - name: Run E2E Tests 🧪
# if: steps.changed-packages.outputs.changed == 'true'
# working-directory: ./packages/create-prisma-generator
# run: pnpm test -- --testPathPattern e2e
- name: Install deps
if: steps.changed-packages.outputs.changed == 'true'
run: pnpm i --frozen-lockfile

# Publish:
# runs-on: ubuntu-latest
# if: ${{ github.ref == 'refs/heads/main' }}
# needs: [unit-tests, e2e-tests]
- name: Publish 🚀
if: steps.changed-packages.outputs.changed == 'true'
run: |
GITHUB_TOKEN="${{secrets.GITHUB_TOKEN}}" GIT_COMMITTER_EMAIL="${{secrets.GIT_COMMITTER_EMAIL}}" GIT_COMMITTER_NAME="${{secrets.GIT_COMMITTER_NAME}}" npx ts-node ./scripts/ci/publish.ts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# debugging-issue:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 100
# - name: Use Node.js
# uses: actions/setup-node@v2
# - uses: actions/setup-node@v1
# with:
# node-version: 16.x
# registry-url: https://registry.npmjs.org

# - uses: YassinEldeeb/has-changed-path@v2.1
# id: changed-packages
# with:
# paths: packages

# - name: Setup PNPM
# uses: pnpm/action-setup@v2.0.1
# if: steps.changed-packages.outputs.changed == 'true'
# with:
# version: 6.23.6

# - uses: actions/cache@v2
# if: steps.changed-packages.outputs.changed == 'true'
# with:
# path: '**/node_modules'
# key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}

# - name: Simulate CLI build
# if: steps.changed-packages.outputs.changed == 'true'
# run: pnpm simulate-dist

# - name: Install deps
# if: steps.changed-packages.outputs.changed == 'true'
# run: pnpm i --frozen-lockfile

# - name: Publish 🚀
# if: steps.changed-packages.outputs.changed == 'true'
# - name: Debugging
# run: |
# GITHUB_TOKEN="${{secrets.GITHUB_TOKEN}}" GIT_COMMITTER_EMAIL="${{secrets.GIT_COMMITTER_EMAIL}}" GIT_COMMITTER_NAME="${{secrets.GIT_COMMITTER_NAME}}" npx ts-node ./scripts/ci/publish.ts
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# cd packages/cli-usage
# npx create-prisma-generator
2 changes: 1 addition & 1 deletion packages/create-prisma-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-prisma-generator",
"version": "1.9.3",
"main": "dist/index.js",
"main": "dist/bin.js",
"license": "MIT",
"bin": {
"create-prisma-generator": "dist/bin.js"
Expand Down
4 changes: 0 additions & 4 deletions packages/create-prisma-generator/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import { CLIs } from './tinyClis'
import { getInstallCommand } from './utils/getInstallCommands'

export const main = async () => {
console.log('--------------------It gone down here--------------------')
const answers = await promptQuestions()
console.log(
'--------------------It crashed after the questions--------------------',
)

const pkgName = answers.generatorName.toLowerCase()

Expand Down

0 comments on commit d21f92d

Please sign in to comment.