Skip to content

Commit d14bc62

Browse files
authored
Initial commit
0 parents  commit d14bc62

Some content is hidden

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

71 files changed

+5231
-0
lines changed

.github/CODEOWNERS

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This is a comment.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in
5+
# the repo. Unless a later match takes precedence,
6+
# @vanHeemstraSystems/global-owners will be requested for
7+
# review when someone opens a pull request.
8+
* @vanHeemstraSystems/global-owners
9+
10+
# Order is important; the last matching pattern takes the most
11+
# precedence. When someone opens a pull request that only
12+
# modifies JS files, only @vanHeemstraSystems/js-owners and not the global
13+
# owner(s) will be requested for a review.
14+
*.js @vanHeemstraSystems/js-owners #This is an inline comment.
15+
16+
# You can also use email addresses if you prefer. They'll be
17+
# used to look up users just like we do for commit author
18+
# emails.
19+
*.go docs@example.com
20+
21+
# Teams can be specified as code owners as well. Teams should
22+
# be identified in the format @org/team-name. Teams must have
23+
# explicit write access to the repository. In this example,
24+
# the vanHeemstraSystems team in the vanHeemstraSystems organization owns all .txt files.
25+
*.txt @vanHeemstraSystems/vanHeemstraSystems
26+
27+
# In this example, @vanHeemstraSystems/log-owners own any files in the build/logs
28+
# directory at the root of the repository and any of its
29+
# subdirectories.
30+
/build/logs/ @vanHeemstraSystems/log-owners
31+
32+
# The `docs/*` pattern will match files like
33+
# `docs/getting-started.md` but not further nested files like
34+
# `docs/build-app/troubleshooting.md`.
35+
docs/* docs@vanheemstrasystems.com
36+
37+
# In this example, @vanHeemstraSystems owns any file in an apps directory
38+
# anywhere in your repository.
39+
apps/ @vanHeemstraSystems
40+
41+
# In this example, @vanHeemstraSystems/docs-owners owns any file in the `/docs`
42+
# directory in the root of your repository and any of its
43+
# subdirectories.
44+
/docs/ @vanHeemstraSystems/docs-owners
45+
46+
# In this example, any change inside the `/scripts` directory
47+
# will require approval from @vanHeemstraSystems/docs-owners or @vanHeemstraSystems.
48+
/scripts/ @vanHeemstraSystems/docs-owners @vanHeemstraSystems
49+
50+
# In this example, @vanHeemstraSystems owns any file in a `/logs` directory such as
51+
# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes
52+
# in a `/logs` directory will require approval from @vanHeemstraSystems.
53+
**/logs @vanHeemstraSystems
54+
55+
# In this example, @vanHeemstraSystems owns any file in the `/apps`
56+
# directory in the root of your repository except for the `/apps/github`
57+
# subdirectory, as its owners are left empty. Without an owner, changes
58+
# to `apps/github` can be made with the approval of any user who has
59+
# write access to the repository.
60+
/apps/ @vanHeemstraSystems
61+
/apps/github
62+
63+
# In this example, @vanHeemstraSystems owns any file in the `/apps`
64+
# directory in the root of your repository except for the `/apps/github`
65+
# subdirectory, as this subdirectory has its own owner @vanHeemstraSystems/docs-owners
66+
/apps/ @vanHeemstraSystems
67+
/apps/github @vanHeemstraSystems/docs-owners

.github/CODE_OF_CONDUCT.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [safety@vanheemstrasystems.com][email]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available [here][version].
72+
73+
## Adoption
74+
75+
This Code of Conduct was first adopted December 15th, 2021.
76+
77+
[homepage]: http://contributor-covenant.org
78+
[version]: http://contributor-covenant.org/version/1/4/
79+
[email]: mailto:wvanheemstra@icloud.com

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
all commit messages must follow [Semantic Commit Messages](https://gist.github.com/wvanheemstra/376206ed6fcadadbd451a1e277151cb9) or they will not trigger a release.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'Bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Additional context**
27+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
main:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 20
16+
cache: 'npm'
17+
- run: npm cache clean --force
18+
- run: npm ci
19+
- run: npm install -g @nrwl/cli
20+
- run: |
21+
npm install --save-dev @swc-node/register @swc/core \
22+
@nx/webpack webpack-cli \
23+
@nx/eslint-plugin eslint-plugin-playwright \
24+
@playwright/test jest \
25+
@nx/jest @nx/react @nx/eslint @nx/playwright
26+
- run: npx nx run-many -t build --verbose
27+
- run: npx nx run-many -t test

.github/workflows/deploy.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch: # Allows manual triggering
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 20
16+
17+
# Clean up existing workspace
18+
- run: |
19+
echo "Cleaning up workspace..."
20+
rm -rf hatch-project
21+
rm -rf apps
22+
rm -f nx.json
23+
rm -f package.json
24+
rm -f package-lock.json
25+
26+
# Create temporary directory for the new workspace
27+
- run: |
28+
echo "Creating temporary directory..."
29+
mkdir -p /tmp/nx-workspace
30+
cd /tmp/nx-workspace
31+
32+
echo "Creating new Nx workspace..."
33+
npx create-nx-workspace@latest . \
34+
--preset=react-monorepo \
35+
--appName=hatch_project \
36+
--style=css \
37+
--nxCloud=skip \
38+
--packageManager=npm \
39+
--no-interactive \
40+
--defaultBase=main
41+
42+
echo "Workspace contents:"
43+
ls -la
44+
45+
echo "Copying workspace files back..."
46+
cd $GITHUB_WORKSPACE
47+
cp -r /tmp/nx-workspace/* .
48+
cp -r /tmp/nx-workspace/.* . 2>/dev/null || true
49+
50+
# Configure base URL for GitHub Pages
51+
- run: |
52+
echo "Configuring base URL..."
53+
REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2)
54+
echo "Base URL will be: /$REPO_NAME/"
55+
56+
# Update vite.config.ts
57+
cat > apps/hatch_project/vite.config.ts << EOF
58+
/// <reference types='vitest' />
59+
import { defineConfig } from 'vite';
60+
import react from '@vitejs/plugin-react';
61+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
62+
63+
export default defineConfig({
64+
root: __dirname,
65+
base: '/$REPO_NAME/',
66+
cacheDir: '../../node_modules/.vite/hatch_project',
67+
68+
plugins: [react(), nxViteTsPaths()],
69+
70+
build: {
71+
outDir: '../../dist/apps/hatch_project',
72+
emptyOutDir: true,
73+
reportCompressedSize: true,
74+
commonjsOptions: { transformMixedEsModules: true },
75+
},
76+
77+
test: {
78+
globals: true,
79+
cache: {
80+
dir: '../../node_modules/.vitest',
81+
},
82+
environment: 'jsdom',
83+
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
84+
},
85+
});
86+
EOF
87+
88+
# Build for production
89+
- run: |
90+
echo "Running build command..."
91+
npx nx build hatch_project --configuration=production --verbose
92+
93+
# Update HTML file with correct base URL
94+
- run: |
95+
echo "Updating base URL in index.html..."
96+
REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2)
97+
98+
# Use sed to update the base href and asset paths
99+
sed -i "s|<base href=\"/\"|<base href=\"/$REPO_NAME/\"|g" dist/apps/hatch_project/index.html
100+
sed -i "s|src=\"/assets|src=\"/$REPO_NAME/assets|g" dist/apps/hatch_project/index.html
101+
sed -i "s|href=\"/assets|href=\"/$REPO_NAME/assets|g" dist/apps/hatch_project/index.html
102+
sed -i "s|href=\"/favicon.ico|href=\"/$REPO_NAME/favicon.ico|g" dist/apps/hatch_project/index.html
103+
104+
echo "Updated index.html contents:"
105+
cat dist/apps/hatch_project/index.html
106+
107+
# Debug: Show build output
108+
- run: |
109+
echo "Build output structure:"
110+
ls -R dist/ || true
111+
112+
echo "Looking for build files:"
113+
find . -type f \( \
114+
-name "*.js" -o \
115+
-name "*.html" -o \
116+
-name "*.css" -o \
117+
-name "*.json" -o \
118+
-name "*.ico" -o \
119+
-name "*.png" -o \
120+
-name "*.svg" \
121+
\) -not -path "./node_modules/*" -not -path "./.git/*" -not -path "./dist/*"
122+
123+
echo "Contents of apps/hatch_project:"
124+
ls -la apps/hatch_project/
125+
126+
echo "Contents of dist directory (if exists):"
127+
ls -la dist/ || true
128+
129+
# Verify build output
130+
- run: |
131+
echo "Verifying build output..."
132+
if [ ! -f "dist/apps/hatch_project/index.html" ]; then
133+
echo "Error: index.html not found in build output!"
134+
exit 1
135+
fi
136+
137+
# Deploy to GitHub Pages
138+
- name: Deploy to GitHub Pages
139+
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3
140+
with:
141+
github_token: ${{ secrets.GITHUB_TOKEN }}
142+
publish_dir: ./dist/apps/hatch_project
143+
enable_jekyll: false
144+
keep_files: false
145+
force_orphan: true

0 commit comments

Comments
 (0)