Skip to content

Commit

Permalink
Merge remote-tracking branch 'getcronit/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
kleberbaum committed May 27, 2024
2 parents ccc1143 + 551b352 commit 1300357
Show file tree
Hide file tree
Showing 437 changed files with 97,379 additions and 997 deletions.
42 changes: 42 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"standard-with-typescript",
"plugin:prettier/recommended"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": ["./tsconfig.json"]
},
"plugins": ["react", "prettier"],
"rules": {
"react/display-name": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"react/prop-types": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"react/jsx-curly-brace-presence": [
"error",
{
"props": "never",
"children": "never"
}
]
},
"settings": {
"react": {
"version": "detect"
}
}
}
17 changes: 17 additions & 0 deletions .fttemplates/Component/[FTName].stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {ComponentMeta, Story} from '@storybook/react'
import React from 'react'
import {[FTName]} from './[FTName].js'
export default {
title: 'Components/[FTName]',
component: [FTName],
parameters: {
layout: 'fullscreen'
}
} as ComponentMeta<typeof [FTName]>

type ComponentProps = React.ComponentProps<typeof [FTName]>

// Create a template for the component
const Template: Story<ComponentProps> = args => <[FTName] {...args} />

export const Basic: Story<ComponentProps> = Template.bind({})
7 changes: 7 additions & 0 deletions .fttemplates/Component/[FTName].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface [FTName]Props {}

export const [FTName]: React.FC<[FTName]Props> = props => {
return <>
<h1>[FTName]</h1>
</>
}
1 change: 1 addition & 0 deletions .fttemplates/Component/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {[FTName], type [FTName]Props} from './[FTName]'
169 changes: 169 additions & 0 deletions .github/workflows/jaen-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# SPDX-FileCopyrightText: Copyright © 2021 snek.at
# SPDX-License-Identifier: EUPL-1.2
#
# Use of this source code is governed by an EUPL-1.2 license that can be found
# in the LICENSE file at https://snek.at/license

# Workflow name
# See: https://help.github.com/en/articles/workflow-syntax-for-github-actions#name
name: Deploy Jaen

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# Default to bash
defaults:
run:
shell: bash

# Workflow trigger
# See: https://help.github.com/en/articles/workflow-syntax-for-github-actions#on
on:
# Workflow call trigger
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_call
workflow_call:
# Workflow call inputs
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputs
inputs:
CLOUDFLARE_PROJECT_NAME:
description: 'The name of the project in Cloudflare'
required: false
type: 'string'
# Workflow call secrets
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callsecrets
secrets:
CLOUDFLARE_ACCOUNT_ID:
description: Cloudflare account id.
required: false
CLOUDFLARE_API_TOKEN:
description: Cloudflare api key.
required: false
SCALE_SERP_APIKEY:
description: Scale Serp api key.
required: false
SCALE_SERP_GOOGLE_PLACE_ID:
description: Place IDs uniquely identify a place in the Google Places database and on Google Maps.
required: false
GATSBY_MYSHOPIFY_URL:
description: Domain for a Shopify shop (foo.myshopify.com).
required: false
GATSBY_STOREFRONT_API_KEY:
description: Key for Shopify Storefront API.
required: false
SHOPIFY_APP_PASSWORD:
description: Personal access token for a Shopify account.
required: false
SENDGRID_API_KEY:
description: SendGrid api key.
required: false
GATSBY_MAPBOX_ACCESS_TOKEN:
description: Mapbox access token.
required: false
GATSBY_SNEK_FUNCTION_URL:
description: URL of the Snek function.
required: false
SENTRY_AUTH_TOKEN:
description: Sentry token.
required: false

# Environment variables
# See: https://help.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#env
env:
NODE_OPTIONS: --max-old-space-size=8192

# Jobs
# See: https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobs
jobs:
# Job id
# See: https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_id
jaen-deploy:
# Runs on ubuntu-latest
# See: https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest

defaults:
run:
# Working directory
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
working-directory: ${{ github.event.client_payload.cwd || '.' }}

# Steps
# See: https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idsteps
steps:
# Checkout step
# See: https://github.com/actions/checkout
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
# Relative path under $GITHUB_WORKSPACE to place the repository
path: "."
ref: ${{github.ref}}
fetch-depth: 0

- name: Detect package manager 🔍
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine packager manager"
exit 1
fi
- name: Setup Node 🔧
uses: actions/setup-node@v3
with:
node-version: "18"
cache: ${{ steps.detect-package-manager.outputs.manager }}

- name: Install dependencies 📦
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}

- name: Restore cache 🗄️
uses: actions/cache@v3
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-${{ hashFiles('public') }}
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: Build with Gatsby 🛠️
run:
${{ steps.detect-package-manager.outputs.manager }} run build
env:
PREFIX_PATHS: 'true'
GATSBY_MYSHOPIFY_URL: ${{ secrets.GATSBY_MYSHOPIFY_URL }}
GATSBY_STOREFRONT_API_KEY: ${{ secrets.GATSBY_STOREFRONT_API_KEY }}
SHOPIFY_APP_PASSWORD: ${{ secrets.SHOPIFY_APP_PASSWORD }}
SCALE_SERP_APIKEY: ${{ secrets.SCALE_SERP_APIKEY }}
SCALE_SERP_GOOGLE_PLACE_ID: ${{ secrets.SCALE_SERP_GOOGLE_PLACE_ID }}
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
GATSBY_MAPBOX_ACCESS_TOKEN: ${{ secrets.GATSBY_MAPBOX_ACCESS_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Deploy Cloudflare Pages 🚀
# See: https://github.com/cloudflare/pages-action
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ inputs.CLOUDFLARE_PROJECT_NAME }}
directory: ./public
# Optional: Specify the Wrangler version
wranglerVersion: '3'
99 changes: 99 additions & 0 deletions .github/workflows/jaen-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# SPDX-FileCopyrightText: Copyright © 2021 snek.at
# SPDX-License-Identifier: EUPL-1.2
#
# Use of this source code is governed by an EUPL-1.2 license that can be found
# in the LICENSE file at https://snek.at/license

# https://help.github.com/en/articles/workflow-syntax-for-github-actions#name
name: Jaen Publish

# https://help.github.com/en/articles/workflow-syntax-for-github-actions#on
on:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_call
workflow_call:
# https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputs
inputs:
JAEN_MIGRATION_URL:
description: Link to the Jaen migrations file.
# https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputsinput_idtype
type: string
required: false
WORKING_DIRECTORY:
description: Path to working directory in a monorepo.
# https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputsinput_idtype
type: string
required: false

# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobs
jobs:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_id
jaen-publish:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest
defaults:
run:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#
working-directory: ${{ inputs.WORKING_DIRECTORY }}
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv
env:
JAEN_MIGRATION_URL: ${{ inputs.JAEN_MIGRATION_URL }}

# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idsteps
steps:
# https://github.com/actions/checkout
- name: Checkout 🛎️
uses: actions/checkout@v3
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith
with:
# Relative path under $GITHUB_WORKSPACE to place the repository
path: "."

# https://dev.to/mpocock1/how-to-cache-nodemodules-in-github-actions-with-yarn-24eh
- name: Yarn Cache Directory Path
id: yarn-cache-dir-path
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsrun
run: echo "::set-output name=dir::$(yarn cache dir)"

# https://github.com/marketplace/actions/cache
- name: Yarn Cache Folder
uses: actions/cache@v3
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith
with:
# https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

# https://github.com/marketplace/actions/cache
- name: Yarn Cache Node
uses: actions/cache@v3
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

# https://classic.yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-pure-lockfile
- name: Yarn Install
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsrun
run: yarn install --pure-lockfile

# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsid
- name: Configure GitHub Authentication 🔧
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsrun
run: |
# Git: set identity
git config user.name "snekmin"
git config user.email "[email protected]"
# Git: set remote
# https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installation
git remote set-url origin "https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsid
- name: Update patches.txt with JAEN_MIGRATION_URL
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#
working-directory: ${{ inputs.WORKING_DIRECTORY }}
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif
if: ${{ inputs.JAEN_MIGRATION_URL }}
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsrun
run: echo "${{ env.JAEN_MIGRATION_URL }}" >> ./jaen-data/patches.txt
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.cache
public
node_modules
.npmrc

.DS_Store

**/dist

**/tsconfig.tsbuildinfo
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"bracketSameLine": true,
"jsxBracketSameLine": true
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.tslint": "explicit",
"source.fixAll.stylelint": "explicit"
}
}
16 changes: 16 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}
2 changes: 2 additions & 0 deletions examples/my-gatsby-site/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GATSBY_LENS_API_URL=https://api.photonq.lens.atsnek.com/graphql
#SENTRY_AUTH_TOKEN=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
Loading

0 comments on commit 1300357

Please sign in to comment.