forked from outsrc/monorepo
-
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.
- Loading branch information
1 parent
a3f51b8
commit 216e60b
Showing
28 changed files
with
211 additions
and
22 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
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
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,5 @@ | ||
export interface PlopGeneratorConfig { | ||
description: string; | ||
prompts: any; | ||
actions: any; | ||
} |
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 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"activityBar.background": "#16340C", | ||
"titleBar.activeBackground": "#1F4910", | ||
"titleBar.activeForeground": "#F6FDF4" | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
module.exports = { | ||
presets: ['next/babel'] | ||
} | ||
|
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
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 |
---|---|---|
|
@@ -19,4 +19,3 @@ module.exports = { | |
'\\.(css|scss)$': 'identity-obj-proxy' | ||
} | ||
} | ||
|
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
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,29 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
stories: ['../**/*.stories.mdx', '../**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
webpackFinal: async (config, { configType }) => { | ||
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION' | ||
// You can change the configuration based on that. | ||
// 'PRODUCTION' is used when building the static version of storybook. | ||
|
||
// Make whatever fine-grained changes you need | ||
config.module.rules.push({ | ||
test: /\.scss$/, | ||
use: [ | ||
{ loader: 'style-loader' }, | ||
{ | ||
loader: 'css-loader', | ||
options: { modules: true } | ||
}, | ||
{ loader: 'sass-loader' } | ||
], | ||
include: path.resolve(__dirname, '../') | ||
}) | ||
|
||
// Return the altered config | ||
return 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,4 @@ | ||
module.exports.parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' } | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
packages/app/prueba/__tests__/storyshoots/__snapshots__/storyshots.spec.ts.snap
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Storyshots prueba/Button Regular 1`] = ` | ||
<button | ||
className="Button" | ||
data-testid="button" | ||
onClick={[Function]} | ||
> | ||
This is a Button | ||
</button> | ||
`; |
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 @@ | ||
import initStoryshots from '@storybook/addon-storyshots' | ||
|
||
initStoryshots() |
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 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> | ||
|
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 @@ | ||
const { dependencies } = require('./package.json') | ||
|
||
const withTM = require('next-transpile-modules')( | ||
Object.keys(dependencies || []).filter(dependency => dependency.startsWith('@andreani/')) | ||
) | ||
|
||
const withBundleAnalyzer = require('@next/bundle-analyzer')({ | ||
enabled: process.env.ANALYZE === 'true' | ||
}) | ||
|
||
module.exports = withBundleAnalyzer( | ||
withTM({ | ||
trailingSlash: process.env.NODE_ENV === 'production', | ||
env: { | ||
NEXT_PUBLIC_BUILD_REVISION: process.env.BUILD_REVISION || 'DEVELOP' | ||
}, | ||
basePath: '/prueba' | ||
}) | ||
) |
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,25 @@ | ||
{ | ||
"name": "@andreani/prueba", | ||
"version": "0.0.0", | ||
"description": "prueba", | ||
"scripts": { | ||
"dev": "next -p 3000", | ||
"build": "yarn clean && next build && next export", | ||
"clean": "rimraf .next && rimraf out", | ||
"storybook": "start-storybook -p 6006", | ||
"test": "jest --coverage --config ../../../jest.config.js ./src/**/* ./__tests__/**/*", | ||
"start": "yarn build && cd out && ws -p 3000" | ||
}, | ||
"config": { | ||
"port": 3000, | ||
"path": "/prueba" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@andreani/functions": "0.0.0" | ||
}, | ||
"devDependencies": { | ||
"@storybook/react": "^6.1.2" | ||
} | ||
} |
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,8 @@ | ||
.Button { | ||
background-color: cornflowerblue; | ||
color: white; | ||
border: none; | ||
border-radius: 6px; | ||
padding: 3px 10px; | ||
} | ||
|
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,10 @@ | ||
import * as React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import '@testing-library/jest-dom/extend-expect' | ||
import { Button } from './Button' | ||
|
||
test('loads and displays greeting', async () => { | ||
render(<Button label='Click Here' onClick={jest.fn()} />) | ||
|
||
expect(screen.getByTestId('button')).toHaveTextContent('Click Here') | ||
}) |
23 changes: 23 additions & 0 deletions
23
packages/app/prueba/src/components/Button/Button.stories.mdx
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,23 @@ | ||
import { action } from '@storybook/addon-actions' | ||
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks' | ||
import { Button } from './Button' | ||
|
||
<Meta title='prueba/Button' component={Button} /> | ||
|
||
# Button | ||
|
||
With `MDX` we can define a story for `Button` right in the middle of our | ||
Markdown documentation. | ||
|
||
<Canvas> | ||
<Story | ||
name='Regular' | ||
args={{ | ||
label: 'This is a Button', | ||
onClick: action('clicked') | ||
}} | ||
> | ||
{args => <Button {...args} />} | ||
</Story> | ||
</Canvas> | ||
|
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,15 @@ | ||
import * as React from 'react' | ||
import css from './Button.module.scss' | ||
|
||
interface ButtonProps { | ||
label: string | ||
onClick: () => void | ||
} | ||
|
||
export const Button: React.FC<ButtonProps> = ({ label, onClick }) => { | ||
return ( | ||
<button data-testid='button' onClick={onClick} className={css.Button}> | ||
{label} | ||
</button> | ||
) | ||
} |
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 @@ | ||
export * from './Button' |
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,18 @@ | ||
import * as React from 'react' | ||
import { NextPage } from 'next' | ||
import { Button } from 'components/Button' | ||
import { capitalize } from '@andreani/functions' | ||
|
||
const Index: NextPage = () => { | ||
const handleClick = (): void => { | ||
alert('World') | ||
} | ||
|
||
return ( | ||
<div> | ||
<Button label={capitalize('hello prueba')} onClick={handleClick} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Index |
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 @@ | ||
{ | ||
"extends": "../../../config/next.tsconfig.json", | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], | ||
"compilerOptions": { | ||
"baseUrl": "./src" | ||
}, | ||
"exclude": ["node_modules"] | ||
} | ||
|
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
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
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
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
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