Skip to content

Repo organization: doc fixes, scripting, scaffolding for testing, linting, etc. - #45

Merged
p1an0guy merged 12 commits into
mainfrom
RepoOrganization
Jan 29, 2026
Merged

p1an0guy merged 12 commits into
mainfrom
RepoOrganization

Conversation

@parker-boom

Copy link
Copy Markdown
Collaborator

Non-breaking changes. No code changes. Organizational, mostly scripting.
See full information at a high level: https://docs.google.com/document/d/1Z5ZuogPJgsPOnrmahv1TS2FNECc6qmROCm9K2Lgus6Q/edit?usp=sharing

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR sets up repository organization, tooling, and documentation without changing application logic. It introduces development workflow scripts, testing infrastructure, code formatting configuration, CI/CD, and comprehensive project documentation.

Changes:

  • Added setup script (setup.mjs) to automate environment checks, dependency installation, and dev server startup
  • Configured Jest for testing, Prettier for formatting, and added CI workflow for automated checks
  • Created extensive documentation including PRD, tech stack guide, and project charter

Reviewed changes

Copilot reviewed 17 out of 23 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
setup.mjs New setup automation script for local development environment
package.json Root package with npm scripts for setup, start, lint, test, format, and gitcheck
package-lock.json Updated package name from "NoteSharer" to "note-sharer"
frontend/package.json Added test, format scripts and dependencies (jest, prettier, @types/jest)
frontend/jest.config.cjs Jest configuration for Next.js with module path mapping
frontend/eslint.config.mjs Added rule override to allow require imports in .cjs files
frontend/__tests__/nicknames.test.ts Initial test file for nickname generation functions
frontend/app/upload/page.tsx Added eslint-disable comments for unused error variables in catch blocks
frontend/app/test-upload/page.tsx Added eslint-disable comments for unused imports and variables
frontend/app/onboarding/page.tsx Removed no-console eslint-disable comments (now allowed by config)
frontend/app/dashboard/page.tsx Added eslint-disable comments for unused error variables
frontend/app/auth/page.tsx Removed no-console eslint-disable comment
frontend/app/api/course-submissions/route.ts Added eslint-disable comment for unused error variable
frontend/lib/nicknames.ts Removed no-console eslint-disable comment
docs/PRD.md Comprehensive product requirements document (338 lines)
docs/project-charter.md Project charter with team info, goals, timeline, and budget (81 lines)
docs/Note_Sharer_Tech_Stack.md Technical architecture and stack documentation (191 lines)
README.md Added setup instructions, CLI install guides, and documentation references
.prettierrc.json Prettier configuration for code formatting
.prettierignore Ignore patterns for Prettier
.gitignore Added coverage and .vercel directories
.github/workflows/ci.yml CI workflow to run checks on pull requests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .prettierrc.json
@@ -0,0 +1,5 @@
{
"printWidth": 100,
"singleQuote": false,

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Prettier configuration sets "singleQuote": false, which means double quotes will be used. However, the existing codebase may have a mix of quote styles. Consider running Prettier on the entire codebase to ensure consistency, or verify that this configuration matches the project's existing style preferences.

Copilot uses AI. Check for mistakes.
Comment thread frontend/jest.config.cjs
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
},
testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"],

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Jest configuration uses CommonJS format (.cjs) but the test file uses ES modules syntax (import). Jest 29 requires additional configuration to handle ES modules. Consider adding "testEnvironment": "node" is correct, but you may need to add "transform": {} and "extensionsToTreatAsEsm": [".ts"] or use a transformer like ts-jest to properly handle TypeScript with ES modules in Jest.

Suggested change
testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"],
testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"],
extensionsToTreatAsEsm: [".ts", ".tsx"],

Copilot uses AI. Check for mistakes.
Comment thread README.md

## Contributing

Visit [contributing.md](docs/contributing.md) on info for how to contribute to this repo.

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar error: "on info for" should be "for info on" or "for information on".

Suggested change
Visit [contributing.md](docs/contributing.md) on info for how to contribute to this repo.
Visit [contributing.md](docs/contributing.md) for info on how to contribute to this repo.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI workflow runs npm run gitcheck which executes the setup script with --skip-supabase --skip-env --no-start flags, followed by linting and testing. However, the setup script will still run npm install in the frontend directory at line 131. Since the workflow already has Node.js set up with caching, consider adding an explicit npm ci step in the workflow before running checks to ensure dependencies are installed, or document that the gitcheck script handles this.

Suggested change
cache-dependency-path: frontend/package-lock.json
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: frontend

Copilot uses AI. Check for mistakes.
Comment thread package.json
"lint": "npm --prefix frontend run lint",
"test": "npm --prefix frontend run test",
"format": "npm --prefix frontend run format",
"gitcheck": "node setup.mjs --skip-supabase --skip-env --no-start && npm --prefix frontend run lint && npm --prefix frontend run test"

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gitcheck script chains multiple commands with &&, which means if any command fails, the subsequent commands won't run. This is good for CI but consider whether you want to see all failures at once (linting AND test failures) rather than stopping at the first failure. If you want to see all failures, consider using a script that runs all commands and aggregates results.

Suggested change
"gitcheck": "node setup.mjs --skip-supabase --skip-env --no-start && npm --prefix frontend run lint && npm --prefix frontend run test"
"gitcheck:setup": "node setup.mjs --skip-supabase --skip-env --no-start",
"gitcheck": "npm-run-all --continue-on-error gitcheck:setup lint test"
},
"devDependencies": {
"npm-run-all": "^4.1.5"

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +76 to 81
- Contributing: `docs/contributing.md`
- PR review guide: `docs/PR_REVIEW_GUIDE.md`

## Contributing

Visit [contributing.md](docs/contributing.md) on info for how to contribute to this repo.

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references "docs/contributing.md" and "docs/PR_REVIEW_GUIDE.md" but these files are not included in this PR. Ensure these files exist in the repository or will be added in a follow-up PR to avoid broken documentation links.

Suggested change
- Contributing: `docs/contributing.md`
- PR review guide: `docs/PR_REVIEW_GUIDE.md`
## Contributing
Visit [contributing.md](docs/contributing.md) on info for how to contribute to this repo.
- Contributing guidelines: (to be added in `docs/contributing.md`)
- PR review guide: (to be added in `docs/PR_REVIEW_GUIDE.md`)
## Contributing
Contributions are welcome. Please open an issue or pull request with your proposed changes; formal contributing guidelines will be added to `docs/contributing.md` in a future update.

Copilot uses AI. Check for mistakes.
Comment thread setup.mjs
const noStart = args.has("--no-start");
const debug = args.has("--debug");

const scriptRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scriptRoot calculation at line 12 goes up one directory from where setup.mjs is located (using ".."). Since setup.mjs is in the repository root, this would resolve to the parent of the repository, which seems incorrect. The fallback logic at line 14 checks if frontend exists in cwdRoot (the current working directory) and uses that if found, otherwise falls back to scriptRoot. Consider removing the ".." from line 12 to make scriptRoot point to the repository root directly, which would be: path.dirname(fileURLToPath(import.meta.url))

Suggested change
const scriptRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const scriptRoot = path.dirname(fileURLToPath(import.meta.url));

Copilot uses AI. Check for mistakes.
Comment thread setup.mjs
Comment on lines +140 to +142
setTimeout(() => {
openBrowser("http://localhost:3000");
}, 1500);

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setTimeout delay of 1500ms before opening the browser is arbitrary and may not be sufficient for slower systems. The dev server might not be ready yet, leading to a "connection refused" error in the browser. Consider checking for server readiness by polling localhost:3000 or using a longer/configurable delay.

Copilot uses AI. Check for mistakes.
describe("nicknames", () => {
it("generates a nickname with letters and digits", () => {
const nickname = generateRandomNickname();
expect(nickname).toMatch(/^[A-Za-z]+[A-Za-z]+[0-9]{1,2}$/);

Copilot AI Jan 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern /^[A-Za-z]+[A-Za-z]+[0-9]{1,2}$/ expects at least two letter groups followed by digits, but it would be clearer to express this as /^[A-Za-z]{2,}[0-9]{1,2}$/ if the intent is to match 2 or more letters followed by 1-2 digits. The current pattern /^[A-Za-z]+[A-Za-z]+[0-9]{1,2}$/ is redundant with two consecutive [A-Za-z]+ groups.

Suggested change
expect(nickname).toMatch(/^[A-Za-z]+[A-Za-z]+[0-9]{1,2}$/);
expect(nickname).toMatch(/^[A-Za-z]{2,}[0-9]{1,2}$/);

Copilot uses AI. Check for mistakes.
@codebox-calpoly codebox-calpoly deleted a comment from Copilot AI Jan 22, 2026
@p1an0guy
p1an0guy merged commit a40b079 into main Jan 29, 2026
7 checks passed
@p1an0guy
p1an0guy deleted the RepoOrganization branch January 29, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants