Skip to content

Commit

Permalink
Moved code from old packages to new single source package (#1474)
Browse files Browse the repository at this point in the history
Co-authored-by: James Mockett <1166188+jamesmockett@users.noreply.github.com>
Co-authored-by: Oliver Abrahams <ollie.abrahams@guardian.co.uk>
  • Loading branch information
3 people committed May 23, 2024
1 parent cc5259f commit 3ac083e
Show file tree
Hide file tree
Showing 462 changed files with 612 additions and 4,619 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/chromatic-label-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ jobs:
permissions:
checks: write
secrets:
CHROMATIC_SOURCE_FOUNDATIONS_TOKEN: ${{ secrets.CHROMATIC_SOURCE_FOUNDATIONS_TOKEN }}
CHROMATIC_SOURCE_REACT_COMPONENTS_TOKEN: ${{ secrets.CHROMATIC_SOURCE_REACT_COMPONENTS_TOKEN }}
CHROMATIC_SOURCE_REACT_COMPONENTS_DEVELOPMENT_KITCHEN_TOKEN: ${{ secrets.CHROMATIC_SOURCE_REACT_COMPONENTS_DEVELOPMENT_KITCHEN_TOKEN }}
CHROMATIC_SOURCE_TOKEN: ${{ secrets.CHROMATIC_SOURCE_TOKEN }}
CHROMATIC_SOURCE_DEVELOPMENT_KITCHEN_TOKEN: ${{ secrets.CHROMATIC_SOURCE_DEVELOPMENT_KITCHEN_TOKEN }}
16 changes: 6 additions & 10 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ name: Chromatic
on:
workflow_call:
secrets:
CHROMATIC_SOURCE_FOUNDATIONS_TOKEN:
CHROMATIC_SOURCE_TOKEN:
required: true
CHROMATIC_SOURCE_REACT_COMPONENTS_TOKEN:
required: true
CHROMATIC_SOURCE_REACT_COMPONENTS_DEVELOPMENT_KITCHEN_TOKEN:
CHROMATIC_SOURCE_DEVELOPMENT_KITCHEN_TOKEN:
required: true

jobs:
Expand All @@ -18,12 +16,10 @@ jobs:
strategy:
matrix:
include:
- lib: source-foundations
token: CHROMATIC_SOURCE_FOUNDATIONS_TOKEN
- lib: source-react-components
token: CHROMATIC_SOURCE_REACT_COMPONENTS_TOKEN
- lib: source-react-components-development-kitchen
token: CHROMATIC_SOURCE_REACT_COMPONENTS_DEVELOPMENT_KITCHEN_TOKEN
- lib: source
token: CHROMATIC_SOURCE_TOKEN
- lib: source-development-kitchen
token: CHROMATIC_SOURCE_DEVELOPMENT_KITCHEN_TOKEN
steps:
- uses: actions/checkout@v4
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ jobs:
permissions:
checks: write
secrets:
CHROMATIC_SOURCE_FOUNDATIONS_TOKEN: ${{ secrets.CHROMATIC_SOURCE_FOUNDATIONS_TOKEN }}
CHROMATIC_SOURCE_REACT_COMPONENTS_TOKEN: ${{ secrets.CHROMATIC_SOURCE_REACT_COMPONENTS_TOKEN }}
CHROMATIC_SOURCE_REACT_COMPONENTS_DEVELOPMENT_KITCHEN_TOKEN: ${{ secrets.CHROMATIC_SOURCE_REACT_COMPONENTS_DEVELOPMENT_KITCHEN_TOKEN }}
CHROMATIC_SOURCE_TOKEN: ${{ secrets.CHROMATIC_SOURCE_TOKEN }}
CHROMATIC_SOURCE_DEVELOPMENT_KITCHEN_TOKEN: ${{ secrets.CHROMATIC_SOURCE_DEVELOPMENT_KITCHEN_TOKEN }}
if: |
github.ref == 'refs/heads/main' ||
contains(github.event.pull_request.labels.*.name, 'run_chromatic') ||
Expand Down
104 changes: 0 additions & 104 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -429,110 +429,6 @@ install: check-node-version
@guardian/source-development-kitchen\:verify-dist: env
@corepack pnpm --filter @guardian/source-development-kitchen verify-dist

.PHONY: @guardian/source-foundations\:build
@guardian/source-foundations\:build: env
@corepack pnpm --filter @guardian/source-foundations build

.PHONY: @guardian/source-foundations\:build-storybook
@guardian/source-foundations\:build-storybook: env
@corepack pnpm --filter @guardian/source-foundations build-storybook

.PHONY: @guardian/source-foundations\:build-type-presets
@guardian/source-foundations\:build-type-presets: env
@corepack pnpm --filter @guardian/source-foundations build-type-presets

.PHONY: @guardian/source-foundations\:dev
@guardian/source-foundations\:dev: env
@corepack pnpm --filter @guardian/source-foundations dev

.PHONY: @guardian/source-foundations\:fix
@guardian/source-foundations\:fix: env
@corepack pnpm --filter @guardian/source-foundations fix

.PHONY: @guardian/source-foundations\:lint
@guardian/source-foundations\:lint: env
@corepack pnpm --filter @guardian/source-foundations lint

.PHONY: @guardian/source-foundations\:storybook
@guardian/source-foundations\:storybook: env
@corepack pnpm --filter @guardian/source-foundations storybook

.PHONY: @guardian/source-foundations\:test
@guardian/source-foundations\:test: env
@corepack pnpm --filter @guardian/source-foundations test

.PHONY: @guardian/source-foundations\:verify-dist
@guardian/source-foundations\:verify-dist: env
@corepack pnpm --filter @guardian/source-foundations verify-dist

.PHONY: @guardian/source-react-components\:build
@guardian/source-react-components\:build: env
@corepack pnpm --filter @guardian/source-react-components build

.PHONY: @guardian/source-react-components\:build-storybook
@guardian/source-react-components\:build-storybook: env
@corepack pnpm --filter @guardian/source-react-components build-storybook

.PHONY: @guardian/source-react-components\:create-icons
@guardian/source-react-components\:create-icons: env
@corepack pnpm --filter @guardian/source-react-components create-icons

.PHONY: @guardian/source-react-components\:dev
@guardian/source-react-components\:dev: env
@corepack pnpm --filter @guardian/source-react-components dev

.PHONY: @guardian/source-react-components\:fix
@guardian/source-react-components\:fix: env
@corepack pnpm --filter @guardian/source-react-components fix

.PHONY: @guardian/source-react-components\:lint
@guardian/source-react-components\:lint: env
@corepack pnpm --filter @guardian/source-react-components lint

.PHONY: @guardian/source-react-components\:storybook
@guardian/source-react-components\:storybook: env
@corepack pnpm --filter @guardian/source-react-components storybook

.PHONY: @guardian/source-react-components\:test
@guardian/source-react-components\:test: env
@corepack pnpm --filter @guardian/source-react-components test

.PHONY: @guardian/source-react-components\:verify-dist
@guardian/source-react-components\:verify-dist: env
@corepack pnpm --filter @guardian/source-react-components verify-dist

.PHONY: @guardian/source-react-components-development-kitchen\:build
@guardian/source-react-components-development-kitchen\:build: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen build

.PHONY: @guardian/source-react-components-development-kitchen\:build-storybook
@guardian/source-react-components-development-kitchen\:build-storybook: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen build-storybook

.PHONY: @guardian/source-react-components-development-kitchen\:dev
@guardian/source-react-components-development-kitchen\:dev: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen dev

.PHONY: @guardian/source-react-components-development-kitchen\:fix
@guardian/source-react-components-development-kitchen\:fix: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen fix

.PHONY: @guardian/source-react-components-development-kitchen\:lint
@guardian/source-react-components-development-kitchen\:lint: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen lint

.PHONY: @guardian/source-react-components-development-kitchen\:storybook
@guardian/source-react-components-development-kitchen\:storybook: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen storybook

.PHONY: @guardian/source-react-components-development-kitchen\:test
@guardian/source-react-components-development-kitchen\:test: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen test

.PHONY: @guardian/source-react-components-development-kitchen\:verify-dist
@guardian/source-react-components-development-kitchen\:verify-dist: env
@corepack pnpm --filter @guardian/source-react-components-development-kitchen verify-dist

.PHONY: @guardian/tsconfig\:fix
@guardian/tsconfig\:fix: env
@corepack pnpm --filter @guardian/tsconfig fix
Expand Down
38 changes: 0 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ The following packages live in `libs/@guardian/*` and are published to NPM:
- [@guardian/prettier](libs/@guardian/prettier)
- [@guardian/source](libs/@guardian/source)
- [@guardian/source-development-kitchen](libs/@guardian/source-development-kitchen)
- [@guardian/source-foundations](libs/@guardian/source-foundations)
- [@guardian/source-react-components](libs/@guardian/source-react-components)
- [@guardian/source-react-components-development-kitchen](libs/@guardian/source-react-components-development-kitchen)
- [@guardian/tsconfig](libs/@guardian/tsconfig)

<!-- END PUBLISHED_PACKAGES -->
Expand Down Expand Up @@ -191,41 +188,6 @@ Project-specific tasks are defined as `scripts` in a `package.json` or `targets`
- `make @guardian/source-development-kitchen:test`
- `make @guardian/source-development-kitchen:verify-dist`

#### @guardian/source-foundations

- `make @guardian/source-foundations:build`
- `make @guardian/source-foundations:build-storybook`
- `make @guardian/source-foundations:build-type-presets`
- `make @guardian/source-foundations:dev`
- `make @guardian/source-foundations:fix`
- `make @guardian/source-foundations:lint`
- `make @guardian/source-foundations:storybook`
- `make @guardian/source-foundations:test`
- `make @guardian/source-foundations:verify-dist`

#### @guardian/source-react-components

- `make @guardian/source-react-components:build`
- `make @guardian/source-react-components:build-storybook`
- `make @guardian/source-react-components:create-icons`
- `make @guardian/source-react-components:dev`
- `make @guardian/source-react-components:fix`
- `make @guardian/source-react-components:lint`
- `make @guardian/source-react-components:storybook`
- `make @guardian/source-react-components:test`
- `make @guardian/source-react-components:verify-dist`

#### @guardian/source-react-components-development-kitchen

- `make @guardian/source-react-components-development-kitchen:build`
- `make @guardian/source-react-components-development-kitchen:build-storybook`
- `make @guardian/source-react-components-development-kitchen:dev`
- `make @guardian/source-react-components-development-kitchen:fix`
- `make @guardian/source-react-components-development-kitchen:lint`
- `make @guardian/source-react-components-development-kitchen:storybook`
- `make @guardian/source-react-components-development-kitchen:test`
- `make @guardian/source-react-components-development-kitchen:verify-dist`

#### @guardian/tsconfig

- `make @guardian/tsconfig:fix`
Expand Down
19 changes: 2 additions & 17 deletions apps/storybooks/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,15 @@ module.exports = {
},
refs: () => {
return {
'source-foundations': {
title: 'source-foundations',
// port set in libs/@guardian/source-foundations/package.json
url: 'http://localhost:4401',
},
'source-react-components': {
title: 'source-react-components',
// port set in libs/@guardian/source-react-components/package.json
url: 'http://localhost:4402',
},
'source-react-components-development-kitchen': {
title: 'source-react-components-development-kitchen',
// port set in libs/@guardian/source-react-components-development-kitchen/package.json
url: 'http://localhost:4403',
},
source: {
title: 'source',
// port set in libs/@guardian/source/package.json
url: 'http://localhost:4404',
url: 'http://localhost:4401',
},
'source-development-kitchen': {
title: 'source-development-kitchen',
// port set in libs/@guardian/source-development-kitchen/package.json
url: 'http://localhost:4405',
url: 'http://localhost:4402',
},
};
},
Expand Down
2 changes: 1 addition & 1 deletion configs/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@babel/preset-typescript": "7.24.1",
"@emotion/babel-plugin": "11.11.0",
"@emotion/react": "11.11.1",
"@guardian/source-foundations": "workspace:*",
"@guardian/source": "workspace:*",
"@storybook/addon-a11y": "8.0.5",
"@storybook/addon-docs": "8.0.5",
"@storybook/addon-essentials": "8.0.5",
Expand Down
2 changes: 1 addition & 1 deletion configs/storybook/preview/FocusManagerDecorator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Decorator } from '@storybook/react';
import { useEffect } from 'react';
import { FocusStyleManager } from '@guardian/source-foundations';
import { FocusStyleManager } from '@guardian/source/foundations';

export const FocusManagerDecorator: Decorator = (storyFn) => {
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion configs/storybook/preview/backgrounds.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { palette } from '@guardian/source-foundations';
import { palette } from '@guardian/source/foundations';

export const backgrounds = {
default: 'background.primary',
Expand Down
4 changes: 2 additions & 2 deletions configs/storybook/preview/viewport.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Breakpoint } from '@guardian/source-foundations';
import { breakpoints } from '@guardian/source-foundations';
import type { Breakpoint } from '@guardian/source/foundations';
import { breakpoints } from '@guardian/source/foundations';

type ViewportMeta = {
[key in Breakpoint]: {
Expand Down
4 changes: 2 additions & 2 deletions libs/@guardian/source-development-kitchen/jest.dist.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// This means we can run `src/index.test.ts` against `dist` instead.

// @ts-ignore
import * as dist from '.';
import * as reactComponents from './react-components';

jest.mock('./src/index', () => dist);
jest.mock('./src/react-components/index', () => reactComponents);
30 changes: 5 additions & 25 deletions libs/@guardian/source-development-kitchen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"dev": "jest --watch",
"fix": "wireit",
"lint": "wireit",
"storybook": "storybook dev --port 4405",
"storybook": "storybook dev --port 4402",
"test": "wireit",
"verify-dist": "wireit"
},
"devDependencies": {
"@babel/core": "7.24.0",
"@emotion/react": "11.11.1",
"@guardian/libs": "16.0.0",
"@guardian/source": "workspace:*",
"@guardian/source": "0.3.0",
"@storybook/manager-api": "8.0.5",
"@storybook/react": "8.0.5",
"@types/react": "18.2.11",
Expand All @@ -42,7 +42,7 @@
"peerDependencies": {
"@emotion/react": "^11.11.1",
"@guardian/libs": "^16.0.0",
"@guardian/source": "workspace:^",
"@guardian/source": "^0.3.0",
"@types/react": "^18.2.11",
"react": "^18.2.0",
"tslib": "^2.6.2",
Expand All @@ -63,16 +63,8 @@
}
},
"wireit": {
"_deps": {
"dependencies": [
"../source:build"
]
},
"build": {
"command": "rollup -c",
"dependencies": [
"_deps"
],
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
Expand All @@ -86,9 +78,6 @@
},
"build-storybook": {
"command": "NODE_ENV=production storybook build --webpack-stats-json",
"dependencies": [
"_deps"
],
"files": [
"**/*.{ts,tsx,js,json,mdx,md}",
"!storybook-static/**",
Expand All @@ -100,9 +89,6 @@
},
"fix": {
"command": "eslint --cache --color . --fix",
"dependencies": [
"_deps"
],
"clean": false,
"files": [
"!(dist)/**",
Expand All @@ -115,9 +101,6 @@
},
"lint": {
"command": "eslint --cache --color .",
"dependencies": [
"_deps"
],
"files": [
"!(dist)/**",
"!(.eslintcache)",
Expand All @@ -126,10 +109,7 @@
"output": []
},
"test": {
"command": "jest --passWithNoTests",
"dependencies": [
"_deps"
],
"command": "jest",
"files": [
"!(dist)/**",
"!(.eslintcache)",
Expand All @@ -138,7 +118,7 @@
"output": []
},
"verify-dist": {
"command": "jest --passWithNoTests --setupFilesAfterEnv ./jest.dist.setup.js",
"command": "jest --setupFilesAfterEnv ./jest.dist.setup.js",
"dependencies": [
"build"
],
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AgeWarning } from './AgeWarning';

const meta: Meta<typeof AgeWarning> = {
component: AgeWarning,
title: 'AgeWarning',
title: 'React Components/AgeWarning',
};

export default meta;
Expand Down
Loading

0 comments on commit 3ac083e

Please sign in to comment.