Skip to content

Commit

Permalink
cleanup, use pnpm and added changesets (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Feb 5, 2023
1 parent 3711b12 commit 2618ddf
Show file tree
Hide file tree
Showing 78 changed files with 2,791 additions and 24,540 deletions.
18 changes: 18 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "dotansimha/graphql-typed-document-node" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": [],
"snapshot": {
"useCalculatedVersion": true,
"prereleaseTemplate": "{tag}-{datetime}-{commit}"
}
}
7 changes: 7 additions & 0 deletions .changeset/pretty-rice-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@graphql-typed-document-node/core": patch
---

- Cleanup repo structure, ship lightweight type-only package.
- Use `import type` instead of `import` for `DocumentNode`.
- Compile and test with latest TS and latest NodeJS LTS.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

48 changes: 0 additions & 48 deletions .eslintrc.json

This file was deleted.

54 changes: 9 additions & 45 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,16 @@
name: CI

name: ci
on:
push:
pull_request:
branches:
- master
pull_request:
push:
branches:
- master

jobs:
test:
name: Testing on ${{matrix.os}} and Node ${{matrix.node_version}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [14]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node ${{matrix.node_version}}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node_version }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-${{matrix.node_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-yarn-
- name: Cache Jest
uses: actions/cache@v2
with:
path: .cache/jest
key: ${{ runner.os }}-${{matrix.node_version}}-jest-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node_version}}-jest-
- name: Install Dependencies using Yarn
run: yarn install
- name: Lint
run: yarn lint
- name: Build
run: yarn build
- name: Test
run: yarn test --logHeapUsage
env:
CI: true
build:
uses: the-guild-org/shared-config/.github/workflows/ci-node-matrix.yml@main
with:
script: pnpm build
nodeVersions: '[14,16,18]'
packageManager: pnpm
17 changes: 17 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pr
on:
pull_request:
branches:
- master

jobs:
release:
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@main
with:
npmTag: alpha
buildScript: build
nodeVersion: 18
packageManager: pnpm
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
npmToken: ${{ secrets.NPM_TOKEN }}
68 changes: 14 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,16 @@
name: NPM Release
name: release
on:
release:
types: [published]
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v2
- name: Configure Git Credentials
run: |
git config --global user.email "theguild-bot@users.noreply.github.com"
git config --global user.name "theguild-bot"
echo "machine github.com login theguild-bot password ${{secrets.GH_API_TOKEN}}" > ~/.netrc
- name: Add origin remote and refetch master
run: |
git remote rm origin
git remote add origin "https://github.com/${{github.repository}}"
git fetch
git checkout master
git reset --hard
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Setup NPM credentials
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-14-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-14-15-yarn-
- name: Install Dependencies using Yarn
run: yarn install && git checkout yarn.lock
- name: Build
run: yarn build
- name: Publish to NPM
run: npm run release
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
- name: Commit updated package.json files
run: |
git add .
git commit -m "${{ github.event.release.tag_name }}"
- name: Push all the changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
stable:
uses: the-guild-org/shared-config/.github/workflows/release-stable.yml@main
with:
releaseScript: release
nodeVersion: 18
packageManager: pnpm
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
npmToken: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Dotan Simha
Copyright (c) 2020-2023 Dotan Simha

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down

0 comments on commit 2618ddf

Please sign in to comment.