Skip to content

Commit

Permalink
Merge pull request #13 from aabidsofi19/master
Browse files Browse the repository at this point in the history
Add component lib and design system
  • Loading branch information
nebula-aac authored Aug 22, 2023
2 parents dd3084e + cdea30f commit 4b0ddbd
Show file tree
Hide file tree
Showing 26 changed files with 17,053 additions and 14 deletions.
125 changes: 111 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,115 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Test binary, built with `go test -c`
*.test
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# Dependency directories (remove the comment below to include it)
# vendor/

# IDEs
.vscode/*
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "sistent",
"version": "0.0.0",
"main": "index.js",
"repository": "[email protected]:layer5io/sistent.git",
"private": true,
"workspaces": [
"packages/*"
]
}
29 changes: 29 additions & 0 deletions packages/components/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'standard-with-typescript',
'plugin:react/recommended',
'plugin:react/recommended',
'plugin:prettier/recommended'
],
overrides: [
{
env: {
node: true
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script'
}
}
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: ['react'],
rules: {}
};
4 changes: 4 additions & 0 deletions packages/components/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore artifacts:
dist
coverage

8 changes: 8 additions & 0 deletions packages/components/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "none",
"jsxBracketSameLine": true
}
33 changes: 33 additions & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@layer5/sistent-components",
"version": "0.0.0",
"description": "Reusable React Components",
"main": "dist/index.umd.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "vite build && tsc",
"lint": "eslint .",
"lint:fix": "eslint --fix",
"format": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc"
},
"devDependencies": {
"@types/react": "^18.2.20",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.2",
"typescript": "^5.1.6",
"vite": "^4.4.9"
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.5",
"react": "^18.2.0"
}
}
6 changes: 6 additions & 0 deletions packages/components/src/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as React from 'react';
import { Button } from '@mui/material';

export const BaseButton = (_props: any) => {
return <Button variant="contained">Hello world</Button>;
};
3 changes: 3 additions & 0 deletions packages/components/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { BaseButton } from './button';

export { BaseButton };
17 changes: 17 additions & 0 deletions packages/components/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2016",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"jsx": "react",
"module": "ESNext",
"declaration": true,
"sourceMap": true,
"outDir": "dist",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"emitDeclarationOnly": true
}
}
16 changes: 16 additions & 0 deletions packages/components/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//vite.config.js
import { resolve } from 'path';
import { defineConfig } from 'vite';

export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.tsx'),
name: 'components',
fileName: 'index'
},
rollupOptions: {
external: ['react', '@mui/material', '@emotion/react']
}
}
});
Loading

0 comments on commit 4b0ddbd

Please sign in to comment.