-
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.
feat: initial commit with work component
- Loading branch information
Guilherme Mangabeira Gregio
committed
Aug 7, 2022
1 parent
223f840
commit f953408
Showing
38 changed files
with
7,766 additions
and
0 deletions.
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,7 @@ | ||
build/ | ||
dist/ | ||
coverage/ | ||
public/ | ||
.eslintrc.js | ||
jest.setup.ts | ||
ci-scripts |
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,46 @@ | ||
module.exports = { | ||
extends: ['plugin:@typescript-eslint/recommended', 'prettier'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
ignorePatterns: ['**/*.config.js', '**/*.config.ts'], | ||
plugins: ['@typescript-eslint', 'prettier', 'import'], | ||
settings: { | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx'], | ||
}, | ||
'import/resolver': { | ||
typescript: {}, | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
jest: true, | ||
}, | ||
rules: { | ||
'prettier/prettier': 'error', | ||
'no-console': 'error', | ||
'import/prefer-default-export': 0, | ||
'import/no-extraneous-dependencies': [ | ||
2, | ||
{ | ||
devDependencies: [ | ||
'**/*.test.*', | ||
'**/*.spec.*', | ||
'jest.setup.ts', | ||
'**/mocks/*', | ||
], | ||
}, | ||
], | ||
'@typescript-eslint/indent': 'off', | ||
'@typescript-eslint/no-use-before-define': [ | ||
'error', | ||
{ | ||
functions: false, | ||
classes: false, | ||
variables: 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,16 @@ | ||
## Purpose | ||
|
||
_Describe what you are trying to accomplish_ | ||
|
||
## Approach and changes | ||
|
||
_Describe how you solved the problem_ | ||
|
||
## Definition of done | ||
|
||
- [ ] Unit tests | ||
- [ ] Documentation | ||
|
||
## Jira | ||
|
||
_https://creditas.atlassian.net/browse/CARD-NUMBER_ |
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,143 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/node | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=node | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# 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 | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# 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 | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
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 | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# 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 | ||
|
||
# SvelteKit build / generate output | ||
.svelte-kit | ||
|
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" | ||
|
||
npx --no-install commitlint --edit "$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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install pretty-quick --staged |
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 @@ | ||
lts/* |
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,9 @@ | ||
.gitignore | ||
.prettierignore | ||
LICENSE | ||
coverage | ||
public | ||
dist | ||
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock |
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 @@ | ||
version-git-message "[skip ci] v%s" |
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,9 @@ | ||
# @gregio/google-optimize | ||
|
||
Library too integrate with google optimize | ||
|
||
## Test environment | ||
|
||
We use swc to run jest tests bacause this improve speed | ||
|
||
> Ref: https://miyauchi.dev/posts/speeding-up-jest/ |
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 @@ | ||
module.exports = {extends: ['@commitlint/config-conventional']} |
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,9 @@ | ||
module.exports = { | ||
testEnvironment: 'jest-environment-jsdom', | ||
transform: { | ||
'^.+\\.(t|j)sx?$': ['@swc/jest'], | ||
}, | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/src/$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,71 @@ | ||
{ | ||
"name": "@gregio/google-optimize", | ||
"version": "0.0.4-development", | ||
"repository": "git@github.com:Creditas/person-classification-frontend-sdk.git", | ||
"author": "Guilherme Mangabeira Gregio <guilherme.gregio@creditas.com.br>", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "vite build", | ||
"semantic-release": "semantic-release", | ||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx", | ||
"format": "prettier --write .", | ||
"check-format": "prettier --check .", | ||
"check-types": "tsc -p tsconfig.prod.json ", | ||
"test": "cross-env NODE_ENV=test jest --passWithNoTests --colors", | ||
"test:ci": "cross-env CI=1 yarn test --no-watch --ci --runInBand", | ||
"test:coverage": "yarn test --coverage", | ||
"test:watch": "yarn test --watch", | ||
"prepare": "husky install" | ||
}, | ||
"sideEffects": false, | ||
"files": [ | ||
"dist" | ||
], | ||
"types": "./dist/main.d.ts", | ||
"typings": "dist/main.d.ts", | ||
"main": "./dist/google-optimize.umd.js", | ||
"module": "./dist/google-optimize.es.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/google-optimize.es.js", | ||
"require": "./dist/google-optimize.umd.js" | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "restricted" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.0.0", | ||
"react-dom": ">=16.0.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^17.0.3", | ||
"@commitlint/config-conventional": "^17.0.3", | ||
"@swc/core": "^1.2.224", | ||
"@swc/jest": "^0.2.22", | ||
"@types/jest": "^28.1.6", | ||
"@types/node": "^18.6.4", | ||
"@types/ramda": "^0.28.15", | ||
"@types/react": "^18.0.16", | ||
"@typescript-eslint/eslint-plugin": "^5.32.0", | ||
"@typescript-eslint/parser": "^5.32.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.21.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-import-resolver-typescript": "^3.4.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-json": "^3.1.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"husky": "^8.0.1", | ||
"jest": "^28.1.3", | ||
"prettier": "^2.7.1", | ||
"pretty-quick": "^3.1.3", | ||
"react": "^17.0.1", | ||
"semantic-release": "^19.0.3", | ||
"typescript": "^4.7.4", | ||
"vite": "^3.0.4", | ||
"vite-aliases": "^0.9.2", | ||
"vite-plugin-dts": "^1.4.1" | ||
}, | ||
"dependencies": {} | ||
} |
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,19 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSpacing: false, | ||
endOfLine: 'lf', | ||
htmlWhitespaceSensitivity: 'css', | ||
insertPragma: false, | ||
jsxSingleQuote: false, | ||
printWidth: 80, | ||
proseWrap: 'always', | ||
quoteProps: 'as-needed', | ||
requirePragma: false, | ||
semi: false, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'all', | ||
useTabs: false, | ||
} |
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,3 @@ | ||
module.exports = { | ||
branches: ['main', {name: '[a-z-]*', prerelease: 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,17 @@ | ||
import {createContext} from 'react' | ||
import {ExperimentStatus, ExperimentResult} from '@/domain' | ||
|
||
const defaultValue = { | ||
experiment: { | ||
experimentId: 'NOT_DEFINED', | ||
experimentStatus: ExperimentStatus.INATIVE, | ||
variant: '0', | ||
}, | ||
activate: () => {}, | ||
} | ||
|
||
const Context = createContext<ExperimentResult>(defaultValue) | ||
|
||
const {Provider} = Context | ||
|
||
export {Context, Provider} |
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 @@ | ||
export * from './experimentContext' | ||
export * from './useExperiment' | ||
export * from './useExperimentActivate' | ||
export * from './useExperimentContext' | ||
export * from './useExperimentValue' | ||
export * from './useExperimentVariant' |
Oops, something went wrong.