Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use yarn workspaces (#32)
* Migrate to yarn workspaces

* Rename real-world-example to demo
  • Loading branch information
zhouzi committed Apr 5, 2022
1 parent 0f7e0db commit 30ee388
Show file tree
Hide file tree
Showing 36 changed files with 5,788 additions and 16,440 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
@@ -1,7 +1,7 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
directory: "/packages/graphql-codegen-factories"
schedule:
interval: "daily"
# We are only interested in security updates,
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -16,9 +16,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run format:check
- run: npm run lint
- run: npm test
- run: npm run build
- run: npm run build:examples
- run: yarn install --frozen-lockfile
- run: yarn format
- run: yarn lint
- run: yarn workspaces run test
- run: yarn workspaces run build
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Expand Up @@ -11,7 +11,8 @@ jobs:
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish
- run: yarn
- run: yarn publish
working-directory: packages/graphql-codegen-factories
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
168 changes: 164 additions & 4 deletions .gitignore
@@ -1,4 +1,164 @@
node_modules
build
examples/**/package-lock.json
examples/**/generated
# Created by https://www.toptal.com/developers/gitignore/api/node,yarn
# Edit at https://www.toptal.com/developers/gitignore?templates=node,yarn

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# SvelteKit build / generate output
.svelte-kit

### yarn ###
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

.yarn/*
!.yarn/releases
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# if you are NOT using Zero-installs, then:
# comment the following lines
!.yarn/cache

# and uncomment the following lines
# .pnp.*

# End of https://www.toptal.com/developers/gitignore/api/node,yarn

build/
packages/demo/generated
3 changes: 2 additions & 1 deletion .prettierignore
@@ -1 +1,2 @@
build
build
packages/demo/generated
7 changes: 2 additions & 5 deletions contributing.md
Expand Up @@ -8,9 +8,6 @@ Here is how you can get a copy of this project running on your computer:

1. Fork the repository.
2. Clone the repository.
3. Install the dependencies by running `npm install`.
3. Install the dependencies by running `yarn`.

## Available scripts

- `npm test` runs the tests.
- `npm run build:examples` build the examples, also a good way to test the plugin in real conditions.
This project uses yarn's workspaces so the code for the package is in `packages/graphql-codegen-factories`.
7 changes: 0 additions & 7 deletions examples/basic/codegen.yml

This file was deleted.

24 changes: 0 additions & 24 deletions examples/basic/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions examples/basic/readme.md

This file was deleted.

39 changes: 0 additions & 39 deletions examples/basic/src/schema.graphql

This file was deleted.

6 changes: 0 additions & 6 deletions examples/basic/tsconfig.json

This file was deleted.

0 comments on commit 30ee388

Please sign in to comment.