Skip to content

Commit

Permalink
Merge pull request #1 from howsoai/20421-init
Browse files Browse the repository at this point in the history
20421: MAJOR Initial package with Feature Attributes
  • Loading branch information
lancegliser authored Jun 14, 2024
2 parents a9d9ae0 + 7f826c4 commit 7c29614
Show file tree
Hide file tree
Showing 196 changed files with 30,294 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.js


# Don't lint generated code
src/generated

# don't ever lint node_modules
node_modules

# don't lint nyc coverage output
coverage
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": ["react-app", "react-app/jest", "plugin:storybook/recommended"],
"rules": {
"complexity": [
"error",
{
"max": 15
}
],
"import/no-anonymous-default-export": "off",
"prefer-const": "error"
},
"overrides": [
{
"files": ["**/*.stories.*"],
"rules": {
"import/no-anonymous-default-export": "off"
}
}
]
}
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##########################################
# code ownership
##########################################

# default ownership: default owners for everything in the repo (Unless a later match takes precedence)
* @howsoai/ux-ui
32 changes: 32 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build PR
run-name: "PR Build: #${{ github.event.pull_request.number }} (${{ github.run_attempt }}.${{ github.run_number }}) - ${{ github.event.pull_request.title }}"

on:
pull_request:
branches:
- "main"

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

build:
uses: "./.github/workflows/build.yml"
secrets: inherit
with:
build-type: "PR"

# This job is here to have only one final step to add for "Status Checks"
# in GitHub, instead of adding every leaf test from 'build-test-package'
final-check:
needs: ['build']
if: always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
runs-on: ubuntu-latest
steps:
- run: exit 1
26 changes: 26 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Release
run-name: "Release Build"

on:
workflow_dispatch:
inputs:
optional-release-tag:
description: "Optional release tag (if empty, will search previous commit titles for MAJOR/MINOR and autoincrement latest tag accordingly)"
required: false

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

release:
uses: "./.github/workflows/build.yml"
secrets: inherit
with:
build-type: "release"
optional-release-tag: ${{ inputs.optional-release-tag }}
94 changes: 94 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Build
run-name: "Branch Build (${{ github.run_attempt }}.${{ github.run_number }}) - ${{ github.ref_name }}"

on:
workflow_dispatch:
workflow_call:
inputs:
build-type:
required: false
type: string
optional-release-tag:
required: false
type: string

defaults:
run:
shell: bash

jobs:
metadata:
uses: howsoai/.github/.github/workflows/set-metadata.yml@main
secrets: inherit
with:
build-type: ${{ inputs.build-type }}
optional-release-tag: ${{ inputs.optional-release-tag }}

npm-test:
# Regression testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install dependencies
env:
NPM_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
run: |
echo -e "\n//dpbuild.jfrog.io/:_authToken=${NPM_TOKEN}" >> .npmrc
npm ci
- name: Test
run: npm run test

release:
needs:
- metadata
- npm-test
if: inputs.build-type == 'release'
environment:
name: Artifactory
permissions:
contents: write
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "21.x"
registry-url: ${{ secrets.JFROG_URL }}/artifactory/npm-remote

- name: Set package version
run: |
sed -i "s|\"version\": \"0.0.0\"|\"version\": \"${{ needs.metadata.outputs.version }}\"|g" ./package.json
- name: Build and publish Node package
run: |
npm ci
npm run build
# Remove .npmrc so that we can easily change registries to npm-edge (for publishing)
rm -f .npmrc
- uses: actions/setup-node@v4
with:
node-version: "21.x"
registry-url: ${{ secrets.JFROG_URL }}/artifactory/api/npm/npm-edge/

- name: Publish Node package
run: |
npm publish
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.metadata.outputs.version }}
commit: ${{ github.sha }}
name: "${{ github.event.repository.name }} ${{ needs.metadata.outputs.version }}"
artifactErrorsFailBuild: true
generateReleaseNotes: true
makeLatest: legacy
31 changes: 31 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# .github/workflows/chromatic.yml

name: "Chromatic"

# https://www.chromatic.com/docs/github-actions/#recommended-configuration-for-build-events
on: push

jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install dependencies
env:
NPM_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
run: |
echo -e "\n//dpbuild.jfrog.io/:_authToken=${NPM_TOKEN}" >> .npmrc
npm ci
- name: Publish to Chromatic
uses: chromaui/action@latest
with:
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: "main" # 👈 Option to accept all changes on main
skip: "@(renovate/**|dependabot/**)" # 👈 Option to skip Chromatic for certain branches
zip: true
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*


# NPM
*.tgz

node_modules
lib
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store


# Scratch files
scratch/*
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run pre-commit
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@howso:registry = https://dpbuild.jfrog.io/artifactory/api/npm/npm-virtual/
4 changes: 4 additions & 0 deletions .postcssrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins:
tailwindcss/nesting: "postcss-nesting"
tailwindcss: {}
autoprefixer: {}
4 changes: 4 additions & 0 deletions .storybook/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const longestPersonalName =
"Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr.";
export const longestContentName =
"Large-area InP based photodiode operated at 850 nm wavelengths with high efficiency and high speed for 40 Gbit/sec transmission";
11 changes: 11 additions & 0 deletions .storybook/decorators.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Decorator } from "@storybook/react";

// export const withCard: Decorator = (Story) => {
// return (
// <Card>
// <CardContent>
// <Story />
// </CardContent>
// </Card>
// );
// };
28 changes: 28 additions & 0 deletions .storybook/i18next.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { initReactI18next } from "react-i18next";
import i18n from "i18next";
import Backend from "i18next-http-backend";
import LanguageDetector from "i18next-browser-languagedetector";
import { defaultTranslationNamespace } from "../src/hooks/useDefaultTranslation";

const ns = [defaultTranslationNamespace];
const supportedLngs = ["en"];

i18n
.use(initReactI18next)
.use(LanguageDetector)
.use(Backend)
.init({
//debug: true,
lng: supportedLngs[0],
fallbackLng: supportedLngs[0],
defaultNS: ns[0],
ns,
interpolation: { escapeValue: false },
react: { useSuspense: true },
supportedLngs,
backend: {
loadPath: "/locales/{{ns}}/{{lng}}.json",
},
});

export default i18n;
31 changes: 31 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-a11y",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
staticDirs: ["../public"], //👈 Configures the static asset folder in Storybook
refs: {
"react-tailwind-flowbite-components": {
title: "Howso components",
url: "https://main--65e891231e1f8c382a2b9636.chromatic.com",
expanded: false, // Optional, true by default
},
flowbite: {
title: "Flowbite",
url: "https://storybook.flowbite-react.com/",
expanded: false, // Optional, true by default
},
},
};
export default config;
1 change: 1 addition & 0 deletions .storybook/preview-body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<body class="text-black dark:text-white"></body>
17 changes: 17 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script>
window.global = window;
</script>
<style>
html,
body {
height: 100%;
}

#storybook-root {
position: relative;
}

.sb-main-fullscreen #storybook-root {
height: 100%;
}
</style>
Loading

0 comments on commit 7c29614

Please sign in to comment.