Skip to content

Commit

Permalink
Merge branch 'main' into feature/amplify-app
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsdaniels committed Sep 15, 2023
2 parents c7b5575 + 5f6cf52 commit 2b35a23
Show file tree
Hide file tree
Showing 183 changed files with 23,489 additions and 45,803 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["storybook","website","infrastructure"]
"ignore": ["@apps/infrastructure", "@apps/storybook", "@apps/website"]
}
5 changes: 5 additions & 0 deletions .changeset/long-birds-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codedazur/react-essentials": patch
---

provide correct frame metrics for useUpdateLoop
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-custom`
extends: ["@codedazur"],
settings: {
next: {
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,36 @@ on:

jobs:
quality:
name: Check Quality
runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Checkout
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm

- name: Install
- name: Install Dependencies
run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm ci
- name: Audit
run: npm run audit --audit-level=high

- name: Lint
run: npm run lint

- name: Test
run: npm run test

- name: Audit
run: npm run audit

- name: Build
run: export NODE_OPTIONS="--max_old_space_size=4096" && npm run build

- name: Test
run: npm run test
28 changes: 15 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release-packages:
name: Release packages
publish:
name: Publish Packages
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js 16
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
Expand All @@ -24,29 +25,30 @@ jobs:
run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm ci
- name: Build Packages
run: |
npm run build-packages
npm run build:packages
- name: Create Release Pull Request
- name: Commit or Publish
uses: changesets/action@v1
with:
publish: npm run publish-packages
commit: "ci(changesets): version packages"
commit: "chore(changesets): release packages"
publish: npm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

deploy-apps:
name: Deploy Storybook and Website
deploy:
name: Deploy Apps
runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-deploy
cancel-in-progress: true

steps:
- name: Checkout
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node
Expand All @@ -55,7 +57,7 @@ jobs:
node-version: 16
cache: npm

- name: Install
- name: Install Deoendencies
run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm ci
Expand All @@ -67,7 +69,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}

- name: Deploy
- name: Deploy Apps
run: |
export NODE_OPTIONS="--max_old_space_size=4096"
npm run deploy
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ yarn-error.log*
# turbo
.turbo

dist
# ide files
.idea
.vscode/

dist
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ In addition, it contains a storybook and a website to showcase these packages.
- `storybook` A Storybook project documenting the packages.
- `website` A Next.js project showcasing the packages.

### Internals

- `eslint-config-custom` ESLint configurations for the apps and packages.
- `tsconfig` TypeScript configurations for the apps and packages.

### Packages

- `cdk-cache-invalidator` A step function that invalidates a CloudFront distribution's cache.
- `cdk-static-site` Resources for static site hosting with S3 and CloudFront.
- `eslint-config` Shared ESLint configurations.
- `essentials` A tree-shakeable collection of general-purpose utilities.
- `react-audio` A headless audio player for React projects.
- `react-media` A headless media player for React projects.
- `react-date-picker` A headless date picker for React projects.
- `react-essentials` A tree-shakeable collection of utilities for React projects.
- `react-forms` Business logic for form state management for React projects.
- `react-notifications` A headless implementation of notifications for React projects.
- `react-pagination` A headless implementation of pagination for React projects.
- `react-parallax` A headless implementation of a parallax effect for React projects.
- `react-preferences` A hook for reading OS-level user preferences in React projects.
- `tsconfig` Shared TypeScript configurations.
22 changes: 12 additions & 10 deletions apps/infrastructure/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "infrastructure",
"name": "@apps/infrastructure",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -11,18 +11,20 @@
"destroy": "cdk destroy --all --force"
},
"dependencies": {
"@apps/storybook": "*",
"@apps/website": "*",
"@codedazur/cdk-static-site": "*",
"@codedazur/essentials": "*",
"aws-cdk-lib": "^2.50.0",
"constructs": "^10.1.147",
"storybook": "*",
"website": "*"
"aws-cdk-lib": "^2.89.0",
"constructs": "^10.2.69",
"eslint-config-next": "13.4.19",
"eslint-plugin-react": "7.33.2"
},
"devDependencies": {
"aws-cdk": "^2.50.0",
"dotenv": "^16.0.3",
"ts-jest": "^29.0.3",
"aws-cdk": "^2.89.0",
"dotenv": "^16.3.1",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.4 || ^5.0.0"
"typescript": "^5.1.6"
}
}
}
16 changes: 16 additions & 0 deletions apps/storybook/.babelrc.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": []
}
53 changes: 53 additions & 0 deletions apps/storybook/components/DebugOverlay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Padding, Portal, Positioned } from "@codedazur/react-components";
import { FunctionComponent, useEffect, useState } from "react";
import styled from "styled-components";
import YAML, { ScalarTag } from "yaml";
import { Monospace } from "./Monospace";

interface DebugOverlayProps {
value: unknown;
}

export const DebugOverlay: FunctionComponent<DebugOverlayProps> = ({
value,
}) => {
const [yaml, setYaml] = useState<string>("");

useEffect(() => {
setYaml(
YAML.stringify(value, {
aliasDuplicateObjects: false,
keepUndefined: true,
customTags: [functionTag],
}),
);
}, [value]);

return (
<Portal>
<DebugBox left={0} top={0}>
<Padding all="1rem">
<Monospace>{yaml}</Monospace>
</Padding>
</DebugBox>
</Portal>
);
};

const DebugBox = styled(Positioned).attrs({ mode: "fixed" })`
pointer-events: none;
font-size: smaller;
line-height: 1.5em;
opacity: 0.75;
`;

const functionTag: ScalarTag = {
identify: (value: unknown): value is Function => value instanceof Function,
tag: "!fn",
resolve: (string) => {
return new Function(string);
},
stringify: (item, context) => {
return "Function";
},
};
9 changes: 9 additions & 0 deletions apps/storybook/components/Monospace.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Text } from "@codedazur/react-components";
import styled from "styled-components";

export const Monospace = styled(Text).attrs({
as: "pre",
})`
font-family: monospace;
white-space: pre-wrap;
`;
8 changes: 4 additions & 4 deletions apps/storybook/decorators/WithApp.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { App } from "@codedazur/react-components";
import { DecoratorFn } from "@storybook/react";
import { App, Background, Padding } from "@codedazur/react-components";
import { Decorator } from "@storybook/react";
import { storyTheme } from "../themes/storyTheme";

export const WithApp: DecoratorFn = (Story) => (
<App rootSelector="#root" theme={storyTheme}>
export const WithApp: Decorator = (Story) => (
<App theme={storyTheme}>
<Story />
</App>
);
4 changes: 2 additions & 2 deletions apps/storybook/decorators/WithCenter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Center } from "@codedazur/react-components";
import { DecoratorFn } from "@storybook/react";
import { Decorator } from "@storybook/react";

export const WithCenter: DecoratorFn = (Story) => (
export const WithCenter: Decorator = (Story) => (
<Center>
<Story />
</Center>
Expand Down
21 changes: 8 additions & 13 deletions apps/storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
module.exports = {
stories: [
"./stories/**/*.stories.mdx",
"./stories/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-actions",
"@storybook/addon-interactions",
],
framework: "@storybook/react",
core: {
builder: "@storybook/builder-vite",
stories: ["./stories/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-essentials", "@storybook/addon-interactions"],
docs: {
autodocs: true,
},
framework: {
name: "@storybook/react-webpack5",
options: {},
},
};
Loading

0 comments on commit 2b35a23

Please sign in to comment.