Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to production #342

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5a0b19b
Bump the mui group with 2 updates
dependabot[bot] Aug 5, 2024
ce4129a
Bump core-js from 3.37.1 to 3.38.0
dependabot[bot] Aug 5, 2024
0f2e3d6
Bump @typescript-eslint/parser from 7.17.0 to 7.18.0
dependabot[bot] Aug 12, 2024
a0078ee
Bump autoprefixer from 10.4.19 to 10.4.20
dependabot[bot] Aug 12, 2024
c6dbd54
Bump ts-jest from 29.2.3 to 29.2.4
dependabot[bot] Aug 12, 2024
2ac19cd
Bump the mui group with 2 updates
dependabot[bot] Aug 12, 2024
ff04563
Bump tailwindcss from 3.4.7 to 3.4.9
dependabot[bot] Aug 12, 2024
fb085e6
Bump @types/node from 22.0.0 to 22.2.0
dependabot[bot] Aug 12, 2024
1bc2f31
Bump postcss from 8.4.40 to 8.4.41
dependabot[bot] Aug 12, 2024
82553bd
Bump @typescript-eslint/eslint-plugin from 7.17.0 to 8.0.1
dependabot[bot] Aug 12, 2024
f14e876
Upgrades typescript-eslint/parser
simonbs Aug 12, 2024
096a270
Fixes linting errors
simonbs Aug 12, 2024
077cb90
Update dependabot.yml
simonbs Aug 12, 2024
0ee072e
Updates dependencies
simonbs Aug 13, 2024
767c530
Update test-sql-queries.yml
simonbs Aug 13, 2024
1fd95ac
Update drop-tables.sql
simonbs Aug 13, 2024
bf2d38a
Update test-sql-queries.yml
simonbs Aug 13, 2024
a7460b4
Update test-sql-queries.yml
simonbs Aug 13, 2024
1619962
Update test-sql-queries.yml
simonbs Aug 13, 2024
82a988f
Update test-sql-queries.yml
simonbs Aug 13, 2024
2ac19cf
Add .nvmrc file
mpabarca Jul 30, 2024
4727da4
Create page & feature New Project
mpabarca Aug 1, 2024
061f29f
Move to theme file BASE_COLORS array
mpabarca Aug 1, 2024
9908419
Move functions to its own files on utils folder
mpabarca Aug 1, 2024
1d194b7
Create AnimatedHighlight component
mpabarca Aug 1, 2024
829a4e3
Add style and props to HighlightText
mpabarca Aug 5, 2024
c2fe00b
Add validation to project-name input on new project page
mpabarca Aug 5, 2024
b79f9c4
Add responsiveness to new project page
mpabarca Aug 5, 2024
2ecf044
Fix missing key on list map on NewProjectSteps
mpabarca Aug 7, 2024
774ec1b
Add tiny changes on new project page & tests
mpabarca Aug 13, 2024
9a503ca
Add custom font sizes on typography to project theme
mpabarca Aug 13, 2024
eebbfc3
Update src/features/new-project/view/NewProjectForm.tsx
simonbs Aug 14, 2024
355cecb
Ensures project placeholders align with projects (#321)
simonbs Aug 14, 2024
df9cc72
Bump @stoplight/elements from 8.3.4 to 8.4.0 (#323)
dependabot[bot] Aug 19, 2024
31d1f33
Bump @types/node from 22.2.0 to 22.4.1 (#324)
dependabot[bot] Aug 19, 2024
613ceb6
Bump sharp from 0.33.4 to 0.33.5 (#325)
dependabot[bot] Aug 19, 2024
6222195
Bump tailwindcss from 3.4.9 to 3.4.10 (#326)
dependabot[bot] Aug 19, 2024
d73f0e7
Bump axios from 1.7.3 to 1.7.4 (#327)
dependabot[bot] Aug 19, 2024
34b9f5e
feat: Welcome & Not Found page (#311)
mpabarca Aug 20, 2024
e61cca2
Uses Suspense when loading projects (#322)
simonbs Aug 20, 2024
a122b03
Bump eslint-config-next from 14.2.5 to 14.2.6 (#332)
dependabot[bot] Aug 26, 2024
0c66112
Bump @emotion/react from 11.13.0 to 11.13.3 (#335)
dependabot[bot] Aug 26, 2024
30df9e3
Bump core-js from 3.38.0 to 3.38.1 (#334)
dependabot[bot] Aug 26, 2024
ae5df53
Bump the typescript-eslint group with 2 updates (#331)
dependabot[bot] Aug 26, 2024
811b2fc
Bump @stoplight/elements from 8.4.0 to 8.4.1 (#333)
dependabot[bot] Aug 26, 2024
90f4329
Bump micromatch from 4.0.7 to 4.0.8 (#336)
dependabot[bot] Aug 26, 2024
c686104
Bump the mui group with 2 updates (#337)
dependabot[bot] Sep 2, 2024
7cf232b
Bump ts-jest from 29.2.4 to 29.2.5 (#340)
dependabot[bot] Sep 2, 2024
f4f3736
Bump npm from 10.8.2 to 10.8.3 (#339)
dependabot[bot] Sep 2, 2024
23fe187
Bump @types/react from 18.3.3 to 18.3.5 (#341)
dependabot[bot] Sep 2, 2024
3731b21
Bump the typescript-eslint group with 2 updates (#338)
dependabot[bot] Sep 2, 2024
dac5b91
Refreshes design (#329)
simonbs Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ updates:
mui:
patterns:
- "@mui/*"
typescript-eslint:
patterns:
- "@typescript-eslint/*"
29 changes: 21 additions & 8 deletions .github/workflows/test-sql-queries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test SQL Queries
on:
workflow_dispatch:
pull_request:
env:
PGPASSWORD: postgres
DATABASE_NAME: testdb
jobs:
test:
name: Test SQL Queries
Expand All @@ -18,8 +21,8 @@ jobs:
--health-retries=5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
POSTGRES_PASSWORD: ${{ env.PGPASSWORD }}
POSTGRES_DB: ${{ env.DATABASE_NAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -29,10 +32,20 @@ jobs:
sleep 1
done
- name: Run create-tables.sql
env:
PGPASSWORD: postgres
run: psql -h localhost -U postgres -d testdb -f create-tables.sql
run: psql -v ON_ERROR_STOP=1 -h localhost -U postgres -d ${{ env.DATABASE_NAME }} -f create-tables.sql
- name: Ensure tables were created
run: |
COUNT=$(psql -v ON_ERROR_STOP=1 -h localhost -U postgres -d ${{ env.DATABASE_NAME }} -t -A -c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public';")
if [ "$COUNT" -eq 0 ]; then
echo "No tables found. Exiting with error."
exit 1
fi
- name: Run drop-tables.sql
env:
PGPASSWORD: postgres
run: psql -h localhost -U postgres -d testdb -f drop-tables.sql
run: psql -v ON_ERROR_STOP=1 -h localhost -U postgres -d ${{ env.DATABASE_NAME }} -f drop-tables.sql
- name: Ensure all tables were dropped
run: |
COUNT=$(psql -v ON_ERROR_STOP=1 -h localhost -U postgres -d ${{ env.DATABASE_NAME }} -t -A -c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public';")
if [ "$COUNT" -gt 0 ]; then
echo "Tables found: $count. Exiting with error."
exit 1
fi
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.13.1
51 changes: 51 additions & 0 deletions __test__/common/utils/makeFullRepositoryName.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { makeFullRepositoryName } from "@/common/utils/makeFullRepositoryName";

test("It returns a sanitized repository name with a suffix", async () => {
const result = makeFullRepositoryName({ name: "My Project", suffix: "-repo" });
expect(result).toEqual("myproject-repo");
});

test("It returns a lowercase repository name", async () => {
const result = makeFullRepositoryName({ name: "MyProject", suffix: "-repo" });
expect(result).toEqual("myproject-repo");
});

test("It trims spaces from the name", async () => {
const result = makeFullRepositoryName({ name: " My Project ", suffix: "-repo" });
expect(result).toEqual("myproject-repo");
});

test("It removes non-alphanumeric characters except dashes", async () => {
const result = makeFullRepositoryName({ name: "My!@#Pro$%^ject", suffix: "-repo" });
expect(result).toEqual("myproject-repo");
});

test("It replaces spaces with dashes", async () => {
const result = makeFullRepositoryName({ name: "My Project", suffix: "-repo" });
expect(result).toEqual("myproject-repo");
});

test("It handles names with multiple spaces correctly", async () => {
const result = makeFullRepositoryName({ name: "My Project", suffix: "-repo" });
expect(result).toEqual("myproject-repo");
});

test("It handles names with no characters left after sanitization", async () => {
const result = makeFullRepositoryName({ name: "!@#$%^", suffix: "-repo" });
expect(result).toEqual("-repo");
});

test("It handles names that are already safe", async () => {
const result = makeFullRepositoryName({ name: "safe-project-name", suffix: "-repo" });
expect(result).toEqual("safe-project-name-repo");
});

test("It returns just the suffix if the name is an empty string", async () => {
const result = makeFullRepositoryName({ name: "", suffix: "-repo" });
expect(result).toEqual("-repo");
});

test("It handles a suffix with special characters correctly", async () => {
const result = makeFullRepositoryName({ name: "My Project", suffix: "!-repo" });
expect(result).toEqual("myproject!-repo");
});
64 changes: 64 additions & 0 deletions __test__/common/utils/makeNewGitHubRepositoryLink.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { makeNewGitHubRepositoryLink } from "@/common/utils/makeNewGitHubRepositoryLink";

test("It generates a URL with repository name and description", async () => {
const result = makeNewGitHubRepositoryLink({
repositoryName: "test-repo",
description: "A test repository"
});
expect(result).toEqual(
"https://github.com/new?name=test-repo&description=A%20test%20repository&visibility=private"
);
});

test("It encodes special characters in the repository name and description", async () => {
const result = makeNewGitHubRepositoryLink({
repositoryName: "test repo",
description: "A test & description"
});
expect(result).toEqual(
"https://github.com/new?name=test%20repo&description=A%20test%20%26%20description&visibility=private"
);
});

test("It generates a URL with a template repository", async () => {
const result = makeNewGitHubRepositoryLink({
templateName: "owner/template-repo",
repositoryName: "test-repo",
description: "A test repository"
});
expect(result).toEqual(
"https://github.com/new?name=test-repo&description=A%20test%20repository&visibility=private&template_owner=owner&template_name=template-repo"
);
});

test("It handles template names with special characters", async () => {
const result = makeNewGitHubRepositoryLink({
templateName: "owner/template repo",
repositoryName: "test-repo",
description: "A test repository"
});
expect(result).toEqual(
"https://github.com/new?name=test-repo&description=A%20test%20repository&visibility=private&template_owner=owner&template_name=template%20repo"
);
});

test("It returns the URL without template parameters if templateName is not provided", async () => {
const result = makeNewGitHubRepositoryLink({
repositoryName: "test-repo",
description: "A test repository"
});
expect(result).toEqual(
"https://github.com/new?name=test-repo&description=A%20test%20repository&visibility=private"
);
});

test("It returns a URL even if the template name cannot be split into owner and repository", async () => {
const result = makeNewGitHubRepositoryLink({
templateName: "invalidTemplateName",
repositoryName: "test-repo",
description: "A test repository"
});
expect(result).toEqual(
"https://github.com/new?name=test-repo&description=A%20test%20repository&visibility=private"
);
});
1 change: 0 additions & 1 deletion drop-tables.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DROP TABLE oauth_tokens;
DROP TABLE verification_token;
DROP TABLE accounts;
DROP TABLE sessions;
DROP TABLE users;
Loading
Loading