Skip to content

Commit

Permalink
Merge pull request #10 from charles4221/develop
Browse files Browse the repository at this point in the history
Finalise for initial production release
  • Loading branch information
charles4221 authored Nov 28, 2024
2 parents fbb2d54 + 71ec3b2 commit e1cca9c
Show file tree
Hide file tree
Showing 96 changed files with 4,372 additions and 1,859 deletions.
34 changes: 8 additions & 26 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,21 @@
"next/core-web-vitals",
"prettier"
],
"plugins": [
"prettier"
],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
"internal"
],
"groups": ["builtin", "external", "internal"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": [
"react"
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
Expand All @@ -49,19 +41,14 @@
},
"overrides": [
{
"files": [
"**/*.js?(x)"
],
"files": ["**/*.js?(x)"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"unicorn/prefer-module": "off"
}
},
{
"files": [
"**/*.tsx",
"**/*.jsx"
],
"files": ["**/*.tsx", "**/*.jsx"],
"rules": {
"unicorn/no-null": "off",
"unicorn/filename-case": [
Expand All @@ -73,9 +60,7 @@
}
},
{
"files": [
"**/app/**/*.tsx"
],
"files": ["**/app/**/*.tsx"],
"rules": {
"unicorn/filename-case": [
"error",
Expand All @@ -87,10 +72,7 @@
},
// hooks-specific
{
"files": [
"**/hooks/**/*.ts",
"**/use*.ts"
],
"files": ["**/hooks/**/*.ts", "**/use*.ts"],
"rules": {
"unicorn/filename-case": [
"error",
Expand All @@ -116,4 +98,4 @@
}
}
]
}
}
12 changes: 9 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ on:
push:
branches:
- main
- develop
- release/*
pull_request:
types: [opened, synchronize, reopened]
jobs:
lint:
name: Lint Code
Expand All @@ -11,19 +14,22 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Node.js v20.11.0
- name: Setup Node.js v22.10.0
uses: actions/setup-node@v3
with:
node-version: '20.11.0'
node-version: '22.10.0'
registry-url: https://npm.fontawesome.com/
scope: '@fortawesome'
cache: 'npm'

- name: Install Node Dependencies
run: npm ci
run: npm ci --legacy-peer-deps
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.NPM_CONFIG_FONT_AWESOME_TOKEN }}

- name: Check Code Formatting with Prettier
run: npm run format:check

- name: Lint Code with ESLint
run: npm run lint

Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ on:
push:
branches:
- main
- develop
- release/*
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
name: Test App
Expand All @@ -11,16 +14,16 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Node.js v20.11.0
- name: Setup Node.js v22.10.0
uses: actions/setup-node@v3
with:
node-version: '20.11.0'
node-version: '22.10.0'
registry-url: https://npm.fontawesome.com/
scope: '@fortawesome'
cache: 'npm'

- name: Install Node Dependencies
run: npm ci
run: npm ci --legacy-peer-deps
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.NPM_CONFIG_FONT_AWESOME_TOKEN }}

Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.slicemachine
.next
# auto-generated mocks and models from slicemachine
src/components/slices/**/mocks.json
src/components/slices/**/model.json
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 20.11.0
nodejs 22.10.0
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
// Extension Settings
"eslint.enable": true,
"eslint.format.enable": false, // formatting is handled by prettier
"prettier.enable": true
}
"prettier.enable": true,
"cSpell.words": ["gsap", "mailjet"]
}
2 changes: 1 addition & 1 deletion customtypes/page/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"hero": {
"type": "SharedSlice"
},
"quote": {
"testimonials": {
"type": "SharedSlice"
},
"text": {
Expand Down
4 changes: 2 additions & 2 deletions customtypes/page/mocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
}
},
{
"key": "quote$6e8fb18a-3fe5-4a3b-9925-6499eff63b8e",
"name": "quote",
"key": "testimonials$6e8fb18a-3fe5-4a3b-9925-6499eff63b8e",
"name": "testimonials",
"widget": {
"__TYPE__": "SharedSliceContent",
"variation": "default",
Expand Down
2 changes: 2 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ const config: Config = {
'src/app/**/*.{ts,tsx}',
'src/components/**/*.{ts,tsx}',
'src/hooks/**/*.{ts,tsx}',
'src/theme/**/*.{ts,tsx}',
'src/utils/**/*.{ts,tsx}',
'!src/**/constants.ts',
'!src/**/*.d.ts',
'!src/**/types.ts',
'!src/components/typography/icons/*',
],

// The directory where Jest should output its coverage files
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
15 changes: 13 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const prismic = require('@prismicio/client');

const sm = require('./slicemachine.config.json');

/** @type {import('next').NextConfig} */
/** @type {() => Promise<import('next').NextConfig>} */
const nextConfig = async () => {
const client = prismic.createClient(sm.repositoryName);

Expand All @@ -19,7 +22,15 @@ const nextConfig = async () => {
// a non-locale prefixed path e.g. `/hello`
defaultLocale: locales[0],
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**.prismic.io',
},
],
},
};
};

module.exports = nextConfig;
module.exports = withBundleAnalyzer(nextConfig);
Loading

0 comments on commit e1cca9c

Please sign in to comment.