Skip to content

Commit b33a509

Browse files
authored
feat: add reactpresss config for toolkit
feat: add reactpresss config for toolkit
2 parents c5bf0b5 + 7dd892a commit b33a509

Some content is hidden

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

51 files changed

+630
-829
lines changed

.github/workflows/npm-publish.yml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,73 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
1+
# This workflow will run tests and publish packages to npm when a release is created
22
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
33

44
name: Node.js Package
55

66
on:
77
release:
88
types: [created]
9+
workflow_dispatch:
10+
inputs:
11+
publish_type:
12+
description: 'Publish type'
13+
required: true
14+
default: 'beta'
15+
type: choice
16+
options:
17+
- beta
18+
- patch
19+
- minor
20+
- major
921

1022
jobs:
11-
build:
23+
build-and-test:
1224
runs-on: ubuntu-latest
1325
steps:
1426
- uses: actions/checkout@v4
1527
- uses: actions/setup-node@v4
1628
with:
1729
node-version: 20
18-
- run: npm ci
19-
- run: npm test
30+
registry-url: https://registry.npmjs.org/
31+
- uses: pnpm/action-setup@v4
32+
with:
33+
version: 9
34+
- run: pnpm install
35+
- run: pnpm run build
36+
- run: pnpm test
37+
if: false # Skip tests for now as there are no test scripts defined
2038

2139
publish-npm:
22-
needs: build
40+
needs: build-and-test
2341
runs-on: ubuntu-latest
2442
steps:
2543
- uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0 # Fetch all history for changelog generation
2646
- uses: actions/setup-node@v4
2747
with:
2848
node-version: 20
2949
registry-url: https://registry.npmjs.org/
30-
- run: npm ci
31-
- run: npm publish
50+
- uses: pnpm/action-setup@v4
51+
with:
52+
version: 9
53+
- run: pnpm install
54+
- run: pnpm run build
55+
- name: Publish packages
56+
run: |
57+
# Set npm token for authentication
58+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
59+
60+
# Determine publish type
61+
if [ "${{ github.event_name }}" = "release" ]; then
62+
# For releases, publish as latest
63+
pnpm run release
64+
elif [ "${{ github.event.inputs.publish_type }}" = "beta" ]; then
65+
# For workflow dispatch with beta, publish as beta
66+
pnpm run release --tag beta
67+
else
68+
# For workflow dispatch with other types, increment version and publish
69+
pnpm run release --increment ${{ github.event.inputs.publish_type }}
70+
fi
3271
env:
33-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
72+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Contributing to ReactPress
2+
3+
Thank you for your interest in contributing to ReactPress! We welcome contributions from the community to help improve the project.
4+
5+
## Code of Conduct
6+
7+
Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md) to ensure a welcoming and inclusive environment for all contributors.
8+
9+
## Getting Started
10+
11+
1. Fork the repository
12+
2. Clone your fork: `git clone https://github.com/your-username/reactpress.git`
13+
3. Create a new branch: `git checkout -b feature/your-feature-name`
14+
4. Make your changes
15+
5. Commit your changes: `git commit -m "Add your feature description"`
16+
6. Push to your fork: `git push origin feature/your-feature-name`
17+
7. Create a pull request
18+
19+
## Development Setup
20+
21+
### Prerequisites
22+
23+
- Node.js >= 16.5.0
24+
- pnpm >= 7.0.0
25+
- MySQL 5.7 or higher
26+
27+
### Installation
28+
29+
```bash
30+
# Clone the repository
31+
git clone https://github.com/fecommunity/reactpress.git
32+
cd reactpress
33+
34+
# Install dependencies
35+
pnpm install
36+
37+
# Start development servers
38+
pnpm run dev
39+
```
40+
41+
## Project Structure
42+
43+
ReactPress follows a monorepo structure:
44+
45+
```
46+
reactpress/
47+
├── client/ # Next.js frontend application
48+
├── server/ # NestJS backend API
49+
├── toolkit/ # Auto-generated API client SDK
50+
├── templates/ # Project templates
51+
├── scripts/ # Build and deployment scripts
52+
└── docs/ # Documentation
53+
```
54+
55+
## Development Workflow
56+
57+
### Running Services
58+
59+
```bash
60+
# Start both client and server in development mode
61+
pnpm run dev
62+
63+
# Start only the server
64+
pnpm run dev:server
65+
66+
# Start only the client
67+
pnpm run dev:client
68+
```
69+
70+
### Building Packages
71+
72+
```bash
73+
# Build all packages
74+
pnpm run build
75+
76+
# Build specific packages
77+
pnpm run build:client
78+
pnpm run build:server
79+
pnpm run build:toolkit
80+
```
81+
82+
### Testing
83+
84+
```bash
85+
# Run all tests
86+
pnpm test
87+
88+
# Run tests for specific package
89+
pnpm test --dir client
90+
pnpm test --dir server
91+
```
92+
93+
## Code Style
94+
95+
- Follow the existing code style in the project
96+
- Use TypeScript for type safety
97+
- Write clear, concise commit messages
98+
- Update documentation as needed
99+
100+
## Pull Request Process
101+
102+
1. Ensure your changes are well-tested
103+
2. Update the README.md if you've changed functionality
104+
3. Create a pull request with a clear title and description
105+
4. Link any related issues in your pull request description
106+
5. Be responsive to feedback during the review process
107+
108+
## Reporting Issues
109+
110+
If you find a bug or have a feature request, please [create an issue](https://github.com/fecommunity/reactpress/issues/new) on GitHub. Include as much detail as possible to help us understand and reproduce the problem.
111+
112+
## Publishing Packages
113+
114+
To publish packages to npm:
115+
116+
1. Ensure you're logged into npm: `pnpm login`
117+
2. Run the publish script: `pnpm run publish`
118+
3. Follow the interactive prompts to select packages and version increments
119+
120+
## License
121+
122+
By contributing to ReactPress, you agree that your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)