-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into translate-cookie-consent
- Loading branch information
Showing
102 changed files
with
2,465 additions
and
11,996 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Add as a safe git directory | ||
git config --global --add safe.directory "/workspaces/smr_frontend" | ||
|
||
# Install packages | ||
bun install | ||
|
||
# Source those environment variables for translation script | ||
source .devcontainer/env.sh staging | ||
|
||
# Download translations | ||
bun run translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "Bun & SvelteKit", | ||
|
||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
|
||
"features": { | ||
"ghcr.io/shyim/devcontainers-features/bun:0": {}, | ||
"./ficsit-feature": {} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [3000], | ||
|
||
// Consistently name the folder so that it can be added as a git safe directory inside the container | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/smr_frontend,type=bind", | ||
"workspaceFolder": "/workspaces/smr_frontend", | ||
|
||
"onCreateCommand": "./.devcontainer/create.sh", | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.vscode-typescript-next", | ||
"svelte.svelte-vscode", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"bradlc.vscode-tailwindcss", | ||
"csstools.postcss", | ||
"mquandalle.graphql", | ||
"GraphQL.vscode-graphql-execution", | ||
"GraphQL.vscode-graphql", | ||
"GraphQL.vscode-graphql-syntax", | ||
"streetsidesoftware.code-spell-checker", | ||
"vunguyentuan.vscode-postcss" | ||
] | ||
} | ||
}, | ||
|
||
"remoteEnv": { | ||
"NODE_ENV": "staging" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
export NODE_ENV=$1 | ||
|
||
set -o allexport; source .env.$NODE_ENV; set +o allexport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "ficsit", | ||
"id": "ficsit", | ||
"version": "0.0.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install watchman | ||
sudo apt-get update && sudo apt-get install -y watchman | ||
|
||
# Append bashrc | ||
echo " | ||
alias fenv=\"source .devcontainer/env.sh\" | ||
echo -e \"\e[1;32mWelcome to smr-frontend devcontainer\e[0m\" | ||
echo | ||
echo -e \"\e[31mPlease execute the following command to load the environment:\e[0m\" | ||
echo -e \"\e[1m\$\e[0m fenv staging\" | ||
echo | ||
echo -e \"\e[31mTo start the dev server execute:\e[0m\" | ||
echo -e \"\e[1m\$\e[0m bun run dev\" | ||
echo | ||
" >> $_REMOTE_USER_HOME/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Auto detect text files and perform LF normalization | ||
# This keeps unix/windows machines from wanting to change every file | ||
# from the other because of the line ending (\r vs \r\n) | ||
* text=auto | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,7 @@ on: | |
type: string | ||
|
||
env: | ||
NODE_VERSION: "18" | ||
PNPM_VERSION: "8.6.1" | ||
BUN_VERSION: "1.0.11" | ||
|
||
jobs: | ||
build: | ||
|
@@ -20,69 +19,39 @@ jobs: | |
matrix: | ||
action: [ "build:node", "build:static" ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup nodejs | ||
uses: actions/setup-node@v1 | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Cache pnpm modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-pnpm-modules | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}- | ||
bun-version: ${{ env.BUN_VERSION }} | ||
|
||
- name: Install dependencies | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
run_install: true | ||
run: bun install | ||
|
||
- name: Build | ||
run: | | ||
set -o allexport; source .env.${{ inputs.env }}; set +o allexport | ||
pnpm graphql-codegen && pnpm run translations && pnpm ${{ matrix.action }} | ||
bun run graphql-codegen && bun run translations && bun run ${{ matrix.action }} | ||
env: | ||
NODE_ENV: ${{ inputs.env }} | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup nodejs | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache pnpm modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-pnpm-modules | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}- | ||
bun-version: ${{ env.BUN_VERSION }} | ||
|
||
- name: Install dependencies | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
run_install: true | ||
run: bun install | ||
|
||
- name: Lint | ||
run: | | ||
set -o allexport; source .env.${{ inputs.env }}; set +o allexport | ||
pnpm exec svelte-kit sync && pnpm graphql-codegen && pnpm check && pnpm lint | ||
bun run postinstall && bun run graphql-codegen && bun run check && bun run lint | ||
env: | ||
NODE_ENV: ${{ inputs.env }} | ||
|
||
|
@@ -94,37 +63,21 @@ jobs: | |
- lint | ||
if: ${{ github.event_name != 'pull_request' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup nodejs | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache pnpm modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-pnpm-modules | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}- | ||
bun-version: ${{ env.BUN_VERSION }} | ||
|
||
- name: Install dependencies | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
run_install: true | ||
run: bun install | ||
|
||
- name: Inject slug/short variables | ||
uses: rlespinasse/[email protected] | ||
- uses: rlespinasse/[email protected] | ||
|
||
- name: Build | ||
run: | | ||
set -o allexport; source .env.${{ inputs.env }}; set +o allexport | ||
pnpm graphql-codegen && pnpm run translations && pnpm build:static | ||
bun run graphql-codegen && bun run translations && bun run build:static | ||
env: | ||
SVELTE_BASE_PATH: "/${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG }}/${{ env.GITHUB_REF_SLUG }}" | ||
NODE_ENV: ${{ inputs.env }} | ||
|
@@ -143,26 +96,22 @@ jobs: | |
- build | ||
- lint | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
- id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
flavor: | | ||
latest=false | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
pnpm exec commitlint -e $1 | ||
bunx commitlint -e $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
pnpm lint && pnpm check | ||
bun run lint && bun run check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.