Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sudhanshutech/sistent int…
Browse files Browse the repository at this point in the history
…o fix/error-boundar
  • Loading branch information
sudhanshutech committed Nov 17, 2023
2 parents 673b6cd + 3727b2c commit d2c0333
Show file tree
Hide file tree
Showing 36 changed files with 4,951 additions and 40 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/release.yml → .github/workflows/_release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
name: Publish NPM Package

on:
release:
types: [published]
branches:
- 'v-*'
- master
workflow_dispatch:
inputs:
release-type:
required: true
on: workflow_dispatch

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Linting and formatting

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install

- name: Run Lint
run: yarn lint && yarn format:check && yarn lint-staged
71 changes: 71 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Pre-release and Publish to NPM

on: workflow_dispatch

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install deps and build
run: |
yarn
yarn build-all
publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
scope: "@layer5"

- name: Install deps and build
run: yarn

- name: Identify changed packages
run: |
CHANGED_PACKAGES=$(yarn lerna changed --json | jq -r '.[].name' || echo "Error parsing JSON")
echo $CHANGED_PACKAGES
- name: Version packages
run: ./scripts/version-prerelease-packages.sh $CHANGED_PACKAGES

- name: Commit changes
run: |
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "chore: publish"
git push origin HEAD
else
echo "No changes to commit."
fi
- name: Create Git tags
run: ./scripts/create-multiple-git-tag.sh

- name: Publish packages
run: yarn lerna publish from-package --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ plugins:
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.6.3.cjs

enableTransparentWorkspaces: false
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ format-fix:
yarn run format:write
```

> [!NOTE]
> Avoid using `type any` in your code. Always specify explicit types to ensure type safety and maintainability.
<br/>

## Join the Layer5 community!

<a name="contributing"></a><a name="community"></a>
Expand Down
3 changes: 3 additions & 0 deletions apps/next-12/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions apps/next-12/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
40 changes: 40 additions & 0 deletions apps/next-12/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
57 changes: 57 additions & 0 deletions apps/next-12/components/DefaultModal/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
IconButton,
Typography
} from '@layer5/sistent-components';
import { CloseIcon } from '@layer5/sistent-svg';
import React from 'react';

export default function DefaultModal() {
const [open, setOpen] = React.useState(false);

const handleClickOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};

return (
<React.Fragment>
<Button variant="contained" onClick={handleClickOpen}>
Open Dialog
</Button>
<Dialog onClose={handleClose} open={open}>
<DialogTitle>Modal Title</DialogTitle>
<IconButton onClick={handleClose} sx={{ position: 'absolute', right: 8, top: 8 }}>
<CloseIcon width={24} height={24} />
</IconButton>
<DialogContent dividers>
<Typography gutterBottom>
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis
in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
</Typography>
<Typography gutterBottom>
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis
lacus vel augue laoreet rutrum faucibus dolor auctor.
</Typography>
<Typography gutterBottom>
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel
scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus
auctor fringilla.
</Typography>
</DialogContent>
<DialogActions>
<Button variant="contained" autoFocus onClick={handleClose}>
Save changes
</Button>
</DialogActions>
</Dialog>
</React.Fragment>
);
}

Loading

0 comments on commit d2c0333

Please sign in to comment.