Skip to content

Commit 255906c

Browse files
radenkovicAaronDDM
andauthored
Dan/migrate nylas connect (#3)
Co-authored-by: Aaron de Mello <[email protected]>
1 parent 675c7e9 commit 255906c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+8410
-11
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/add-husky.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nylas/connect": patch
3+
---
4+
5+
Add Husky git hooks: pre-commit and pre-push run ggshield secret scans.

.changeset/add-oxlint-linter.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@nylas/connect": none
3+
---
4+
5+
Add Oxlint as the linter across the workspace and standardize scripts/CI.
6+
7+
- Add `oxlint` as a workspace devDependency
8+
- Use `lint` (auto-fix) and `lint:check` (no fix) across packages
9+
- Configure Nx to cache `lint:check` and skip caching for `lint`
10+
- Update PR workflow to run `pnpm lint:check`
11+
12+
This is a tooling-only change; no runtime impact.
13+
14+

.changeset/config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [],
11+
"snapshot": {
12+
"useCalculatedVersion": true,
13+
"prereleaseTemplate": "{tag}-{datetime}"
14+
}
15+
}

.changeset/silent-eggs-dream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nylas/connect": patch
3+
---
4+
5+
Validating the github actions workflow

.github/RELEASE.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Release Process
2+
3+
This repository uses [Changesets](https://github.com/changesets/changesets) for automated package versioning and publishing.
4+
5+
## How It Works
6+
7+
### 1. Creating Changes
8+
When you make changes that should trigger a release:
9+
10+
```bash
11+
# Add a changeset describing your changes
12+
pnpm changeset
13+
14+
# Follow the prompts to:
15+
# - Select which packages are affected
16+
# - Choose the type of change (patch, minor, major)
17+
# - Write a description of the change
18+
```
19+
20+
This creates a markdown file in `.changeset/` describing the change.
21+
22+
### 2. Automated Release Process
23+
24+
When changesets are pushed to `main`:
25+
26+
1. **Release PR Creation**: The GitHub Action automatically creates a "Version Packages" PR
27+
2. **Review Process**: The PR shows exactly what will be released and requires review
28+
3. **Publishing**: When the PR is merged, packages are automatically published to NPM
29+
4. **GitHub Releases**: Release notes are automatically created with changelogs
30+
31+
### 3. Manual Testing
32+
33+
You can test releases locally:
34+
35+
```bash
36+
# See what would be published (dry run)
37+
pnpm publish:dry-run
38+
39+
# Build and publish locally (requires NPM_TOKEN)
40+
pnpm publish
41+
```
42+
43+
## Setup Requirements
44+
45+
46+
## Changeset Types
47+
48+
- **patch**: Bug fixes, documentation updates, internal changes
49+
- **minor**: New features, non-breaking changes
50+
- **major**: Breaking changes, API changes
51+
52+
## Example Workflow
53+
54+
```bash
55+
# 1. Make your changes
56+
git checkout -b feature/new-auth-method
57+
# ... make changes ...
58+
59+
# 2. Add changeset
60+
pnpm changeset
61+
# Select: @nylas/connect → minor → "Add new OAuth flow support"
62+
63+
# 3. Commit and push
64+
git add .changeset/
65+
git commit -m "feat: add new OAuth flow support"
66+
git push origin feature/new-auth-method
67+
68+
# 4. Create PR and merge to main
69+
# 5. Release PR is automatically created
70+
# 6. Review and merge release PR
71+
# 7. Packages are published automatically!
72+
```
73+
74+
## Troubleshooting
75+
76+
### Release PR Not Created
77+
- Check that changesets exist in `.changeset/` (not just config files)
78+
- Verify the GitHub Action ran successfully
79+
- Ensure you have the required permissions
80+
81+
### Publishing Fails
82+
- Verify `NPM_TOKEN` secret is set correctly
83+
- Check NPM token has publish permissions for `@nylas` scope
84+
- Ensure package versions don't already exist on NPM
85+
86+
### Manual Recovery
87+
If automation fails, you can manually release:
88+
89+
```bash
90+
# Update versions
91+
pnpm version
92+
93+
# Build and publish
94+
pnpm publish
95+
96+
# Create git tags
97+
git push --follow-tags
98+
```

.github/workflows/pr-tests.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: PR Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, reopened]
7+
# Also run on pushes to main for consistency
8+
push:
9+
branches: [main]
10+
11+
# Cancel in-progress runs for the same PR
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
name: Test Suite
19+
runs-on: blacksmith-2vcpu-ubuntu-2404
20+
timeout-minutes: 15
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
# Fetch full history for Nx affected commands (optional optimization)
27+
fetch-depth: 0
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ vars.NODE_VERSION }}
33+
registry-url: "https://registry.npmjs.org"
34+
35+
- name: Setup pnpm
36+
uses: pnpm/action-setup@v4
37+
with:
38+
version: "10.6.3"
39+
run_install: false
40+
41+
- name: Get pnpm store directory
42+
shell: bash
43+
run: |
44+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
45+
46+
- name: Setup pnpm cache
47+
uses: actions/cache@v4
48+
with:
49+
path: ${{ env.STORE_PATH }}
50+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
51+
restore-keys: |
52+
${{ runner.os }}-pnpm-store-
53+
54+
- name: Install dependencies
55+
run: pnpm install --frozen-lockfile
56+
57+
- name: Type check
58+
run: pnpm typecheck
59+
60+
- name: Lint (check only)
61+
run: pnpm lint:check
62+
63+
- name: Check formatting
64+
run: pnpm format:check
65+
66+
- name: Build packages
67+
run: pnpm build
68+
69+
- name: Run tests
70+
run: pnpm test
71+
72+
- name: Run tests with coverage
73+
run: pnpm --filter @nylas/connect coverage

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# Prevent multiple releases from running at the same time
10+
concurrency: ${{ github.workflow }}-${{ github.ref }}
11+
12+
jobs:
13+
release:
14+
name: Release
15+
runs-on: blacksmith-2vcpu-ubuntu-2404
16+
permissions:
17+
contents: write # to create release commits and tags
18+
pull-requests: write # to create release PRs
19+
id-token: write # for NPM provenance
20+
timeout-minutes: 15
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
# Need full history for changesets
27+
fetch-depth: 0
28+
# Use a token that can trigger workflows (for release PR creation)
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ vars.NODE_VERSION }}
35+
registry-url: "https://registry.npmjs.org"
36+
37+
- name: Setup pnpm
38+
uses: pnpm/action-setup@v4
39+
with:
40+
version: "10.6.3"
41+
run_install: false
42+
43+
- name: Get pnpm store directory
44+
shell: bash
45+
run: |
46+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
47+
48+
- name: Setup pnpm cache
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ env.STORE_PATH }}
52+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
restore-keys: |
54+
${{ runner.os }}-pnpm-store-
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Type check
60+
run: pnpm typecheck
61+
62+
- name: Check formatting
63+
run: pnpm format:check
64+
65+
- name: Build packages
66+
run: pnpm build
67+
68+
- name: Run tests
69+
run: pnpm test
70+
71+
- name: Run tests with coverage
72+
run: pnpm --filter @nylas/connect coverage
73+
74+
- name: Create Release Pull Request or Publish to NPM
75+
id: changesets
76+
uses: changesets/action@v1
77+
with:
78+
# This expects a script called "version" and "publish"
79+
version: pnpm version
80+
publish: pnpm publish:dry-run
81+
title: "chore: version packages"
82+
commit: "chore: version packages"
83+
createGithubReleases: true
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
87+
NPM_CONFIG_PROVENANCE: true

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,14 @@ area51
129129

130130
###### Docker ######
131131
!.docker/**
132+
133+
134+
135+
.nx/cache
136+
.nx/workspace-data
137+
.cursor/rules/nx-rules.mdc
138+
.github/instructions/nx.instructions.md
139+
140+
# Nx Project Graph export assets
141+
static/
142+
project-graph.html

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm format
5+
pnpm lint
6+
pnpm typecheck

0 commit comments

Comments
 (0)