Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: prepare repository to contain multiple packages #1446

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto
open-pull-requests-limit: 8
rebase-strategy: disabled
- package-ecosystem: npm
directory: "/packages/previous"
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto
open-pull-requests-limit: 8
rebase-strategy: disabled
7 changes: 5 additions & 2 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/previous
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -13,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
node-version-file: "./packages/previous/.nvmrc"

- name: Install dependencies
run: yarn
Expand All @@ -25,4 +28,4 @@ jobs:
with:
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
storybookBuildDir: "storybook-static"
storybookBuildDir: "./packages/previous/storybook-static"
7 changes: 5 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: CI

on:
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/previous

steps:
- name: Checkout
Expand All @@ -16,7 +19,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
node-version-file: "./packages/previous/.nvmrc"
- name: Install dependencies
run: yarn
- name: Build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
release:
name: Release
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./packages/previous
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -16,7 +19,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
node-version-file: "./packages/previous/.nvmrc"
- name: Install dependencies
run: yarn
- name: Build
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,12 @@ yarn-error.log*

# asdf version manager
.tool-versions

# storybook
*storybook.log

# output
*.log
.DS_Store
.cache
coverage
6 changes: 5 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"printWidth": 120
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"printWidth": 120,
"tabWidth": 2
}
199 changes: 4 additions & 195 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,199 +1,8 @@
{
"name": "@nulogy/components",
"version": "0.0.0-development",
"description": "Component library for the Nulogy Design System - http://nulogy.design",
"private": false,
"publishConfig": {
"access": "public"
},
"scripts": {
"new": "plop",
"start": "concurrently \"yarn build --watch\" \"start-storybook -p 9999\"",
"start:e2e": "yarn concurrently --kill-others \"yarn start --ci\" \"yarn wait-on http://localhost:9999 && cypress open\"",
"build": "rollup -c",
"build:storybook": "build-storybook",
"check": "yarn check:types && yarn check:lint && yarn check:format",
"check:types": "tsc && cd cypress && tsc --noEmit",
"check:lint": "eslint --config ./.eslintrc .'*/**/*.{js,ts,tsx}'",
"check:format": "prettier -c .",
"fix": "yarn fix:lint && yarn fix:format",
"fix:lint": "yarn check:lint --fix",
"fix:format": "prettier -w .",
"test": "yarn test:components && yarn run test:e2e",
"test:components": "jest",
"test:e2e": "yarn build:storybook && yarn concurrently --success \"first\" --kill-others \"yarn http-server -p 9999 ./storybook-static\" \"yarn wait-on http://localhost:9999 && yarn cypress run\"",
"test:visual": "npx chromatic --project-token $CHROMATIC_TOKEN --exit-zero-on-changes"
},
"license": "MIT",
"author": "Nulogy <info@nulogy.com> (https://github.com/nulogy)",
"homepage": "http://nulogy.design",
"repository": "https://github.com/nulogy/design-system",
"bugs": {
"url": "https://github.com/nulogy/design-system/issues"
},
"keywords": [
"nulogy",
"design system",
"NDS",
"react",
"components",
"component library"
],
"engines": {
"yarn": "^1.17.3"
},
"main": "dist/main.js",
"module": "dist/main.module.js",
"typings": "dist/src/index.d.ts",
"files": [
"/dist"
],
"peerDependencies": {
"@nulogy/icons": "4",
"react": ">=16.10.2",
"react-dom": ">=16.10.2",
"styled-components": "^5.1.0"
},
"name": "@nulogy/design-system",
"private": true,
"scripts": {},
"devDependencies": {
"@babel/core": "^7.0.0-0",
"@babel/plugin-proposal-private-methods": "^7.10.4",
"@babel/plugin-proposal-private-property-in-object": "^7.10.4",
"@babel/plugin-syntax-class-properties": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "7.3.1",
"@babel/preset-typescript": "^7.10.4",
"@nulogy/eslint-config-nulogy": "^1.0.0",
"@nulogy/icons": "4.34.1",
"@rollup/plugin-babel": "^5.0.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.7",
"@semantic-release/npm": "^9.0.0",
"@semantic-release/release-notes-generator": "^10.0.3",
"@storybook/addon-a11y": "^6.1.9",
"@storybook/addon-actions": "^6.1.9",
"@storybook/addon-knobs": "^6.1.9",
"@storybook/addon-storysource": "^6.1.9",
"@storybook/addon-viewport": "^7.6.6",
"@storybook/codemod": "^6.1.9",
"@storybook/react": "^6.3.12",
"@storybook/theming": "^6.1.9",
"@testing-library/jest-dom": "5.11.5",
"@testing-library/react": "^12.1.5",
"@types/jest": "^29.5.1",
"@types/node": "^14.0.14",
"@types/react": "^17.0.39",
"@types/react-datepicker": "^4.1.0",
"@types/react-dom": "^17.0.20",
"@types/styled-components": "^5.1.9",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^5.30.5",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"awesome-typescript-loader": "^5.2.1",
"babel-eslint": "^10.0.3",
"babel-jest": "29.5.0",
"babel-loader": "8.0.6",
"babel-plugin-inline-json-import": "^0.3.2",
"babel-plugin-require-context-hook": "1.0.0",
"babel-plugin-styled-components": "2.1.3",
"babel-preset-react": "6.24.1",
"chromatic": "^6.0.6",
"concurrently": "^5.2.0",
"cypress": "^13.2.0",
"cypress-enter-plugin": "^1.0.1",
"cypress-plugin-tab": "^1.0.1",
"enzyme": "3.11.0",
"enzyme-to-json": "3.4.4",
"eslint": "6.8.0",
"eslint-plugin-prettier": "^3.1.4",
"http-server": "^14.0.0",
"husky": "^4.3.0",
"jest": "29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-styled-components": "7",
"jscodeshift": "^0.11.0",
"mockdate": "^3.0.2",
"plop": "^2.4.0",
"react": "17.0.2",
"react-color": "^2.18.1",
"react-dom": "17.0.2",
"react-router-dom": "^5.2.0",
"react-test-renderer": "^16.10",
"rollup": "^2.7.3",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-typescript2": "^0.30.0",
"semantic-release": "^17.2.1",
"source-map-loader": "^1.0.1",
"storybook-addon-performance": "^0.17.1",
"styled-components": "^5.3.11",
"svg-sprite-loader": "^6.0.11",
"ts-jest": "^26.1.1",
"typescript": "4.9.5",
"typescript-eslint": "^0.0.1-alpha.0",
"wait-on": "^5.1.0"
},
"dependencies": {
"@babel/runtime": "^7.9.6",
"@nulogy/tokens": "^5.4.0",
"@styled-system/prop-types": "^5.1.4",
"@styled-system/theme-get": "^5.1.2",
"@types/styled-system": "5.1.22",
"body-scroll-lock": "^3.1.5",
"core-js": "3",
"date-fns": "2.23.0",
"debounce": "^1.2.0",
"deep-equal": "^2.2.1",
"framer-motion": "^3.1.3",
"i18next": "^19.3.1",
"polished": "3.4.4",
"react-datepicker": "^4.1.0",
"react-fast-compare": "^3.2.0",
"react-hot-toast": "^2.4.1",
"react-i18next": "^12.3.1",
"react-modal": "^3.14.4",
"react-popper": "1.3.11",
"react-popper-2": "npm:react-popper@2.2.4",
"react-resize-detector": "^9.1.0",
"react-select": "^5.8.0",
"react-windowed-select": "^5.2.0",
"smoothscroll-polyfill": "^0.4.4",
"styled-system": "^5.1.4"
},
"husky": {
"hooks": {
"pre-push": "yarn run check"
}
},
"jest": {
"testEnvironment": "jsdom",
"transform": {
"^.+\\.jsx?$": "babel-jest",
"^.+\\.js?$": "babel-jest",
"^.+\\.ts?$": "babel-jest",
"^.+\\.tsx?$": "babel-jest"
},
"transformIgnorePatterns": [
"node_modules/(?!(@nulogy|storybook-addon-performance))"
],
"testPathIgnorePatterns": [
"<rootDir>/cypress"
],
"testMatch": [
"**/*.spec.tsx",
"**/*.spec.ts"
],
"setupFiles": [
"<rootDir>/spec/support/registerContext.js"
],
"setupFilesAfterEnv": [
"<rootDir>/spec/support/specHelper.js"
],
"snapshotSerializers": [
"enzyme-to-json/serializer"
]
"prettier": "^3.2.5"
}
}
1 change: 1 addition & 0 deletions packages/mobile/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.17.0
17 changes: 17 additions & 0 deletions packages/mobile/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { StorybookConfig } from "@storybook/react-vite"

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-onboarding",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
}
export default config
58 changes: 58 additions & 0 deletions packages/mobile/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import type { Preview } from "@storybook/react"
import preset from "../src/theme/tailwind-preset"
import "../src/theme/main.css"
import NDSProvider from "../src/providers/nds-provider"

const VIEW_PORTS = {
small: {
name: "Small",
styles: {
width: preset.theme.screens.sm,
height: "100%",
},
},
medium: {
name: "Medium",
styles: {
width: preset.theme.screens.md,
height: "100%",
},
},
large: {
name: "Large",
styles: {
width: preset.theme.screens.lg,
height: "100%",
},
},
extraLarge: {
name: "Extra Large",
styles: {
width: preset.theme.screens.xl,
height: "100%",
},
},
}

const preview: Preview = {
parameters: {
viewport: {
viewports: VIEW_PORTS,
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
decorators: [
(Story) => (
<NDSProvider>
<Story />
</NDSProvider>
),
],
}

export default preview
Loading
Loading