Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanheemstra authored Feb 24, 2025
0 parents commit 52a97b2
Show file tree
Hide file tree
Showing 62 changed files with 4,360 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @vanHeemstraSystems/global-owners will be requested for
# review when someone opens a pull request.
* @vanHeemstraSystems/global-owners

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @vanHeemstraSystems/js-owners and not the global
# owner(s) will be requested for a review.
*.js @vanHeemstraSystems/js-owners #This is an inline comment.

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
*.go [email protected]

# Teams can be specified as code owners as well. Teams should
# be identified in the format @org/team-name. Teams must have
# explicit write access to the repository. In this example,
# the vanHeemstraSystems team in the vanHeemstraSystems organization owns all .txt files.
*.txt @vanHeemstraSystems/vanHeemstraSystems

# In this example, @vanHeemstraSystems/log-owners own any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
/build/logs/ @vanHeemstraSystems/log-owners

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
docs/* [email protected]

# In this example, @vanHeemstraSystems owns any file in an apps directory
# anywhere in your repository.
apps/ @vanHeemstraSystems

# In this example, @vanHeemstraSystems/docs-owners owns any file in the `/docs`
# directory in the root of your repository and any of its
# subdirectories.
/docs/ @vanHeemstraSystems/docs-owners

# In this example, any change inside the `/scripts` directory
# will require approval from @vanHeemstraSystems/docs-owners or @vanHeemstraSystems.
/scripts/ @vanHeemstraSystems/docs-owners @vanHeemstraSystems

# In this example, @vanHeemstraSystems owns any file in a `/logs` directory such as
# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes
# in a `/logs` directory will require approval from @vanHeemstraSystems.
**/logs @vanHeemstraSystems

# In this example, @vanHeemstraSystems owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as its owners are left empty. Without an owner, changes
# to `apps/github` can be made with the approval of any user who has
# write access to the repository.
/apps/ @vanHeemstraSystems
/apps/github

# In this example, @vanHeemstraSystems owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as this subdirectory has its own owner @vanHeemstraSystems/docs-owners
/apps/ @vanHeemstraSystems
/apps/github @vanHeemstraSystems/docs-owners
79 changes: 79 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [[email protected]][email]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available [here][version].

## Adoption

This Code of Conduct was first adopted December 15th, 2021.

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[email]: mailto:[email protected]
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all commit messages must follow [Semantic Commit Messages](https://gist.github.com/wvanheemstra/376206ed6fcadadbd451a1e277151cb9) or they will not trigger a release.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'Bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI
on:
push:
branches:
- main
pull_request:

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm cache clean --force
- run: npm ci
- run: npm install -g @nrwl/cli
- run: |
npm install --save-dev @swc-node/register @swc/core \
@nx/webpack webpack-cli \
@nx/eslint-plugin eslint-plugin-playwright \
@playwright/test jest \
@nx/jest @nx/react @nx/eslint @nx/playwright
- run: npx nx run-many -t build --verbose
- run: npx nx run-many -t test
145 changes: 145 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Deploy
on:
push:
branches:
- main
workflow_dispatch: # Allows manual triggering

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20

# Clean up existing workspace
- run: |
echo "Cleaning up workspace..."
rm -rf hatch-project
rm -rf apps
rm -f nx.json
rm -f package.json
rm -f package-lock.json
# Create temporary directory for the new workspace
- run: |
echo "Creating temporary directory..."
mkdir -p /tmp/nx-workspace
cd /tmp/nx-workspace
echo "Creating new Nx workspace..."
npx create-nx-workspace@latest . \
--preset=react-monorepo \
--appName=hatch_project \
--style=css \
--nxCloud=skip \
--packageManager=npm \
--no-interactive \
--defaultBase=main
echo "Workspace contents:"
ls -la
echo "Copying workspace files back..."
cd $GITHUB_WORKSPACE
cp -r /tmp/nx-workspace/* .
cp -r /tmp/nx-workspace/.* . 2>/dev/null || true
# Configure base URL for GitHub Pages
- run: |
echo "Configuring base URL..."
REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2)
echo "Base URL will be: /$REPO_NAME/"
# Update vite.config.ts
cat > apps/hatch_project/vite.config.ts << EOF
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
export default defineConfig({
root: __dirname,
base: '/$REPO_NAME/',
cacheDir: '../../node_modules/.vite/hatch_project',
plugins: [react(), nxViteTsPaths()],
build: {
outDir: '../../dist/apps/hatch_project',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: { transformMixedEsModules: true },
},
test: {
globals: true,
cache: {
dir: '../../node_modules/.vitest',
},
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
});
EOF
# Build for production
- run: |
echo "Running build command..."
npx nx build hatch_project --configuration=production --verbose
# Update HTML file with correct base URL
- run: |
echo "Updating base URL in index.html..."
REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2)
# Use sed to update the base href and asset paths
sed -i "s|<base href=\"/\"|<base href=\"/$REPO_NAME/\"|g" dist/apps/hatch_project/index.html
sed -i "s|src=\"/assets|src=\"/$REPO_NAME/assets|g" dist/apps/hatch_project/index.html
sed -i "s|href=\"/assets|href=\"/$REPO_NAME/assets|g" dist/apps/hatch_project/index.html
sed -i "s|href=\"/favicon.ico|href=\"/$REPO_NAME/favicon.ico|g" dist/apps/hatch_project/index.html
echo "Updated index.html contents:"
cat dist/apps/hatch_project/index.html
# Debug: Show build output
- run: |
echo "Build output structure:"
ls -R dist/ || true
echo "Looking for build files:"
find . -type f \( \
-name "*.js" -o \
-name "*.html" -o \
-name "*.css" -o \
-name "*.json" -o \
-name "*.ico" -o \
-name "*.png" -o \
-name "*.svg" \
\) -not -path "./node_modules/*" -not -path "./.git/*" -not -path "./dist/*"
echo "Contents of apps/hatch_project:"
ls -la apps/hatch_project/
echo "Contents of dist directory (if exists):"
ls -la dist/ || true
# Verify build output
- run: |
echo "Verifying build output..."
if [ ! -f "dist/apps/hatch_project/index.html" ]; then
echo "Error: index.html not found in build output!"
exit 1
fi
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/apps/hatch_project
enable_jekyll: false
keep_files: false
force_orphan: true
Loading

0 comments on commit 52a97b2

Please sign in to comment.