-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from howsoai/20421-init
20421: MAJOR Initial package with Feature Attributes
- Loading branch information
Showing
196 changed files
with
30,294 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
] | ||
} |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@howso:registry = https://dpbuild.jfrog.io/artifactory/api/npm/npm-virtual/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
plugins: | ||
tailwindcss/nesting: "postcss-nesting" | ||
tailwindcss: {} | ||
autoprefixer: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
// ); | ||
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<body class="text-black dark:text-white"></body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.