Skip to content

Commit

Permalink
feat(shared-ui-feat-layout): Re-organized the folder structure of ui …
Browse files Browse the repository at this point in the history
…libraries
  • Loading branch information
sullivanpj committed Dec 3, 2022
1 parent 7ee930e commit a812c41
Show file tree
Hide file tree
Showing 60 changed files with 532 additions and 435 deletions.
9 changes: 9 additions & 0 deletions apps/web/contact/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
"options": {
"lintFilePatterns": ["apps/web/contact/**/*.{ts,tsx,js,jsx}"]
}
},
"semantic-release": {
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
"options": {
"github": true,
"npm": false,
"changelog": true,
"tagFormat": "web-contact-v${VERSION}"
}
}
},
"tags": []
Expand Down
4 changes: 2 additions & 2 deletions apps/web/shell/app/Aside.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import { SideTitle } from "@open-system/shared-ui-components";
import { SideTitle } from "@open-system/shared-ui-feat-layout";
import { AnimatePresence, motion, useScroll } from "framer-motion";
import { useLayoutEffect, useState } from "react";

export function Aside() {
export default function Aside() {
const [hide, setHide] = useState(true);

const { scrollYProgress } = useScroll();
Expand Down
5 changes: 2 additions & 3 deletions apps/web/shell/app/Client.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"use client";

import { ArrowDownIcon } from "@heroicons/react/24/solid";

import { AnimatePresence, motion, useScroll, useSpring } from "framer-motion";
import { useLayoutEffect, useRef, useState } from "react";
import Logo from "../../../../assets/box-logo-gradient.svg";
import { Aside } from "./Aside";
import Aside from "./Aside";
import Introduction from "./Introduction";
import Stack from "./Stack";
import Title from "./Title";
Expand All @@ -22,7 +21,7 @@ export default function Client() {
restDelta: 0.001,
});

const [hideScrollArrow, setHideScrollArrow] = useState(true);
const [hideScrollArrow, setHideScrollArrow] = useState(false);
useLayoutEffect(() => {
const unsubscribe = scrollYProgress.onChange((scrollY: number) => {
if (
Expand Down
2 changes: 1 addition & 1 deletion apps/web/shell/app/Stack.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { OsHeader } from "@open-system/design-system-components/react";
import { OsHeader } from "@open-system/design-system-components-react";
import StackLayer from "./StackLayer";

export default function Stack() {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/shell/app/StackLayer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { OsHeader } from "@open-system/design-system-components/react";
import { OsHeader } from "@open-system/design-system-components-react";
import clsx from "clsx";
import { motion, Variants } from "framer-motion";
import { useCallback, useState } from "react";
Expand Down
5 changes: 3 additions & 2 deletions apps/web/shell/app/about/Client.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"use client";

import { OsHeader } from "@open-system/design-system-components/react";
import * as React from "react";

export default function Client() {
React.useRef(null);
return (
<section className="flex w-full snap-center snap-always justify-center overflow-hidden">
<div className="flex h-[88rem] w-fit flex-col gap-20 px-10">
<div className="flex w-fit max-w-[65rem] flex-col gap-20">
<div className="flex flex-col gap-5">
<OsHeader level={2}>About me</OsHeader>
{/*<OsHeader level={2}>About me</OsHeader>*/}

<p className="font-body-1 text-body-1">
While I feel nowadays the term <i>full stack developer</i> is
Expand Down
12 changes: 6 additions & 6 deletions apps/web/shell/app/header.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client";

import { NavigationMenu } from "@open-system/shared-ui-feat-navigation";
import { NavigationMenu } from "@open-system/shared-ui-feat-layout";

export function Header() {
export default function Header() {
return (
<nav className="fixed top-0 z-nav h-20 w-full">
<NavigationMenu
items={[
{ name: "Home", href: "/" },
{ name: "Contact", href: "/contact" },
{ name: "About", href: "/about" },
{ name: "Login", href: "/" },
{ label: "Home", href: "/" },
{ label: "Contact", href: "/contact" },
{ label: "About", href: "/about" },
{ label: "Login", href: "/" },
]}
/>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/shell/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import localFont from "@next/font/local";
import clsx from "clsx";
import React from "react";
import "./globals.css";
import { Header } from "./Header";
import Header from "./Header";

const melody = localFont({
variable: "--font-melody",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/shell/app/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PageLoading } from "@open-system/shared-ui-components";
import { PageLoading } from "@open-system/shared-ui-feat-layout";

export default function Loading() {
return <PageLoading />;
Expand Down
7 changes: 6 additions & 1 deletion apps/web/shell/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const nextConfig = {
fontLoaders: [
{ loader: "@next/font/google", options: { subsets: ["latin"] } },
],
transpilePackages: ["@open-system/shared-ui-components"],
transpilePackages: [
"@open-system/design-system-components-react",
"@open-system/shared-ui-components",
"@open-system/shared-ui-feat-layout",
"@open-system/engagement-ui-feat-like",
],
},

async rewrites() {
Expand Down
16 changes: 16 additions & 0 deletions apps/web/shell/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"sourceRoot": "apps/web/shell",
"projectType": "application",
"targets": {
"dev": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": ["cd apps/web/shell && next dev -p 3000"],
"parallel": true
}
},
"build": {
"executor": "@nrwl/next:build",
"outputs": ["{options.outputPath}"],
Expand Down Expand Up @@ -58,6 +65,15 @@
"options": {
"lintFilePatterns": ["apps/web/shell/**/*.{ts,tsx,js,jsx}"]
}
},
"semantic-release": {
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
"options": {
"github": true,
"npm": false,
"changelog": true,
"tagFormat": "web-shell-v${VERSION}"
}
}
},
"tags": []
Expand Down
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
"openapi",
"partytown",
"Persistor",
"Prehydration",
"rabbitmq",
"Renderable",
"Storyshots",
"svgr",
"systemvars"
"systemvars",
"tailwindcss",
"theunderscorer"
],
"enableFiletypes": [
"mdx"
Expand Down
2 changes: 1 addition & 1 deletion design-system/components/react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@open-system/design-system-components/react",
"name": "@open-system/design-system-components-react",
"version": "0.0.1",
"type": "commonjs"
}
2 changes: 1 addition & 1 deletion design-system/components/stencil/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const config: Config = {
*/
hydratedValue: "inherit",
},
enableCache: true,
enableCache: false,
buildEs5: true,
extras: {
/**
Expand Down
1 change: 0 additions & 1 deletion design-system/components/stencil/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"declaration": false,
"experimentalDecorators": true,
"esModuleInterop": true,
"lib": ["dom", "es2015"],
Expand Down
Binary file modified design-system/tokens/src/open-system/open-system.fig
Binary file not shown.
9 changes: 9 additions & 0 deletions libs/shared/ui/components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@
"jestConfig": "libs/shared/ui/components/jest.config.ts",
"passWithNoTests": true
}
},
"semantic-release": {
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
"options": {
"github": true,
"npm": false,
"changelog": true,
"tagFormat": "shared-ui-components-v${VERSION}"
}
}
}
}
3 changes: 1 addition & 2 deletions libs/shared/ui/components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from "./page-loading";
export * from "./side-title";
export * from "./link";
export * from "./types";
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Link } from "./Link";

describe("Link", () => {
it("should render successfully", () => {
const { baseElement } = render(<Link selected={true} href="/path"></Link>);
const { baseElement } = render(<Link href="/path">Item Label</Link>);
expect(baseElement).toBeTruthy();
});
});
18 changes: 18 additions & 0 deletions libs/shared/ui/components/src/link/Link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import NextLink, { LinkProps as NextLinkProps } from "next/link";
import { PropsWithBase } from "../types";

export type LinkProps = PropsWithBase<
Omit<NextLinkProps, "href"> & Partial<Pick<NextLinkProps, "href">>
>;

/**
* A component to facilitate application navigation. This is essentially a wrapper
* around the NextJS Link component.
*/
export function Link({ children, href = "/", ...props }: LinkProps) {
return (
<NextLink href={href} {...props}>
{children}
</NextLink>
);
}
File renamed without changes.
20 changes: 0 additions & 20 deletions libs/shared/ui/components/src/side-title/SideTitle.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions libs/shared/ui/components/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export type BaseComponentProps = React.PropsWithRef<
| "suppressContentEditableWarning"
| "suppressHydrationWarning"
> & { key?: React.Key }
> >
>
>
>;

export type PropsWithBase<
P extends Record<string, any> = Record<string, never>
> = BaseComponentProps &
P;
> = BaseComponentProps & P;
3 changes: 2 additions & 1 deletion libs/shared/ui/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
Expand All @@ -23,3 +23,4 @@
}
]
}

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["libs/shared/ui/feat-layout/tsconfig.*?.json"]
},
"rules": {}
},
{
Expand Down
7 changes: 7 additions & 0 deletions libs/shared/ui/feat-layout/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# shared-ui-feat-layout

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test shared-ui-feat-layout` to execute the unit tests via [Jest](https://jestjs.io).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
export default {
displayName: "shared-ui-feat-navigation",
displayName: "shared-ui-feat-layout",
preset: "../../../../jest.preset.js",
transform: {
"^.+\\.[tj]sx?$": [
Expand All @@ -9,5 +9,5 @@ export default {
],
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
coverageDirectory: "../../../../coverage/libs/shared/ui/feat-navigation",
coverageDirectory: "../../../../coverage/libs/shared/ui/feat-layout",
};
4 changes: 4 additions & 0 deletions libs/shared/ui/feat-layout/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@open-system/shared-ui-feat-layout",
"version": "0.0.1"
}
Loading

0 comments on commit a812c41

Please sign in to comment.