Skip to content

Commit b6e59b7

Browse files
authored
Merge branch 'staging' into translate-cookie-consent
2 parents 3266737 + a24c165 commit b6e59b7

File tree

102 files changed

+2465
-11996
lines changed

Some content is hidden

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

102 files changed

+2465
-11996
lines changed

.devcontainer/create.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Add as a safe git directory
4+
git config --global --add safe.directory "/workspaces/smr_frontend"
5+
6+
# Install packages
7+
bun install
8+
9+
# Source those environment variables for translation script
10+
source .devcontainer/env.sh staging
11+
12+
# Download translations
13+
bun run translations

.devcontainer/devcontainer.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "Bun & SvelteKit",
3+
4+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
5+
6+
"features": {
7+
"ghcr.io/shyim/devcontainers-features/bun:0": {},
8+
"./ficsit-feature": {}
9+
},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
"forwardPorts": [3000],
13+
14+
// Consistently name the folder so that it can be added as a git safe directory inside the container
15+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/smr_frontend,type=bind",
16+
"workspaceFolder": "/workspaces/smr_frontend",
17+
18+
"onCreateCommand": "./.devcontainer/create.sh",
19+
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
"ms-vscode.vscode-typescript-next",
24+
"svelte.svelte-vscode",
25+
"dbaeumer.vscode-eslint",
26+
"esbenp.prettier-vscode",
27+
"bradlc.vscode-tailwindcss",
28+
"csstools.postcss",
29+
"mquandalle.graphql",
30+
"GraphQL.vscode-graphql-execution",
31+
"GraphQL.vscode-graphql",
32+
"GraphQL.vscode-graphql-syntax",
33+
"streetsidesoftware.code-spell-checker",
34+
"vunguyentuan.vscode-postcss"
35+
]
36+
}
37+
},
38+
39+
"remoteEnv": {
40+
"NODE_ENV": "staging"
41+
}
42+
}

.devcontainer/env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
export NODE_ENV=$1
4+
5+
set -o allexport; source .env.$NODE_ENV; set +o allexport
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "ficsit",
3+
"id": "ficsit",
4+
"version": "0.0.1"
5+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
# Install watchman
4+
sudo apt-get update && sudo apt-get install -y watchman
5+
6+
# Append bashrc
7+
echo "
8+
alias fenv=\"source .devcontainer/env.sh\"
9+
10+
echo -e \"\e[1;32mWelcome to smr-frontend devcontainer\e[0m\"
11+
echo
12+
echo -e \"\e[31mPlease execute the following command to load the environment:\e[0m\"
13+
echo -e \"\e[1m\$\e[0m fenv staging\"
14+
echo
15+
echo -e \"\e[31mTo start the dev server execute:\e[0m\"
16+
echo -e \"\e[1m\$\e[0m bun run dev\"
17+
echo
18+
" >> $_REMOTE_USER_HOME/.bashrc

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.eslintrc.cjs

Lines changed: 0 additions & 55 deletions
This file was deleted.

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Auto detect text files and perform LF normalization
2+
# This keeps unix/windows machines from wanting to change every file
3+
# from the other because of the line ending (\r vs \r\n)
4+
* text=auto
5+
*.sh text eol=lf

.github/workflows/push-base.yml

Lines changed: 22 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ on:
88
type: string
99

1010
env:
11-
NODE_VERSION: "18"
12-
PNPM_VERSION: "8.6.1"
11+
BUN_VERSION: "1.0.11"
1312

1413
jobs:
1514
build:
@@ -20,69 +19,39 @@ jobs:
2019
matrix:
2120
action: [ "build:node", "build:static" ]
2221
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
2523

26-
- name: Setup nodejs
27-
uses: actions/setup-node@v1
24+
- uses: oven-sh/setup-bun@v1
2825
with:
29-
node-version: ${{ env.NODE_VERSION }}
30-
31-
- name: Cache pnpm modules
32-
uses: actions/cache@v2
33-
env:
34-
cache-name: cache-pnpm-modules
35-
with:
36-
path: ~/.pnpm-store
37-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }}
38-
restore-keys: |
39-
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-
26+
bun-version: ${{ env.BUN_VERSION }}
4027

4128
- name: Install dependencies
42-
uses: pnpm/[email protected]
43-
with:
44-
version: ${{ env.PNPM_VERSION }}
45-
run_install: true
29+
run: bun install
4630

4731
- name: Build
4832
run: |
4933
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
50-
pnpm graphql-codegen && pnpm run translations && pnpm ${{ matrix.action }}
34+
bun run graphql-codegen && bun run translations && bun run ${{ matrix.action }}
5135
env:
5236
NODE_ENV: ${{ inputs.env }}
5337

5438
lint:
5539
name: Lint
5640
runs-on: ubuntu-latest
5741
steps:
58-
- name: Checkout
59-
uses: actions/checkout@v2
60-
61-
- name: Setup nodejs
62-
uses: actions/setup-node@v1
63-
with:
64-
node-version: ${{ env.NODE_VERSION }}
42+
- uses: actions/checkout@v3
6543

66-
- name: Cache pnpm modules
67-
uses: actions/cache@v2
68-
env:
69-
cache-name: cache-pnpm-modules
44+
- uses: oven-sh/setup-bun@v1
7045
with:
71-
path: ~/.pnpm-store
72-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }}
73-
restore-keys: |
74-
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-
46+
bun-version: ${{ env.BUN_VERSION }}
7547

7648
- name: Install dependencies
77-
uses: pnpm/[email protected]
78-
with:
79-
version: ${{ env.PNPM_VERSION }}
80-
run_install: true
49+
run: bun install
8150

8251
- name: Lint
8352
run: |
8453
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
85-
pnpm exec svelte-kit sync && pnpm graphql-codegen && pnpm check && pnpm lint
54+
bun run postinstall && bun run graphql-codegen && bun run check && bun run lint
8655
env:
8756
NODE_ENV: ${{ inputs.env }}
8857

@@ -94,37 +63,21 @@ jobs:
9463
- lint
9564
if: ${{ github.event_name != 'pull_request' }}
9665
steps:
97-
- name: Checkout
98-
uses: actions/checkout@v2
99-
100-
- name: Setup nodejs
101-
uses: actions/setup-node@v1
102-
with:
103-
node-version: ${{ env.NODE_VERSION }}
66+
- uses: actions/checkout@v3
10467

105-
- name: Cache pnpm modules
106-
uses: actions/cache@v2
107-
env:
108-
cache-name: cache-pnpm-modules
68+
- uses: oven-sh/setup-bun@v1
10969
with:
110-
path: ~/.pnpm-store
111-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package.json') }}
112-
restore-keys: |
113-
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NODE_VERSION }}-
70+
bun-version: ${{ env.BUN_VERSION }}
11471

11572
- name: Install dependencies
116-
uses: pnpm/[email protected]
117-
with:
118-
version: ${{ env.PNPM_VERSION }}
119-
run_install: true
73+
run: bun install
12074

121-
- name: Inject slug/short variables
122-
uses: rlespinasse/[email protected]
75+
- uses: rlespinasse/[email protected]
12376

12477
- name: Build
12578
run: |
12679
set -o allexport; source .env.${{ inputs.env }}; set +o allexport
127-
pnpm graphql-codegen && pnpm run translations && pnpm build:static
80+
bun run graphql-codegen && bun run translations && bun run build:static
12881
env:
12982
SVELTE_BASE_PATH: "/${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG }}/${{ env.GITHUB_REF_SLUG }}"
13083
NODE_ENV: ${{ inputs.env }}
@@ -143,26 +96,22 @@ jobs:
14396
- build
14497
- lint
14598
steps:
146-
- name: Checkout
147-
uses: actions/checkout@v2
99+
- uses: actions/checkout@v3
148100

149-
- name: Login to GitHub Container Registry
150-
uses: docker/login-action@v1
101+
- uses: docker/login-action@v2
151102
with:
152103
registry: ghcr.io
153104
username: ${{ github.actor }}
154105
password: ${{ secrets.GITHUB_TOKEN }}
155106

156-
- name: Docker meta
157-
id: meta
158-
uses: docker/metadata-action@v3
107+
- id: meta
108+
uses: docker/metadata-action@v4
159109
with:
160110
images: ghcr.io/${{ github.repository }}
161111
flavor: |
162112
latest=false
163113
164-
- name: Build and push
165-
uses: docker/build-push-action@v2
114+
- uses: docker/build-push-action@v4
166115
with:
167116
context: .
168117
push: ${{ github.event_name != 'pull_request' }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,5 @@ $RECYCLE.BIN/
304304
/schema.graphql
305305
/graphql.schema.json
306306
/.svelte-kit
307-
/static/smui.css
308-
/.pnpm-store
307+
/.pnpm-store
308+
.direnv

0 commit comments

Comments
 (0)