Sfoglia il codice sorgente

Update directory structure, generator code

Use src/ for react-common source

TODO: put other package-related files in packages/react-common/
tags/0.3.0
parent
commit
386f5a365b
40 ha cambiato i file con 31 aggiunte e 25 eliminazioni
  1. +1
    -1
      packages/react-common-docs/src/components/Nav/Nav.tsx
  2. +2
    -1
      packages/react-common-docs/src/components/NavLink/NavLink.tsx
  3. +0
    -0
      packages/react-common-docs/src/components/Playground/Playground.tsx
  4. +1
    -1
      packages/react-common-docs/src/components/Sidebar/Sidebar.tsx
  5. +1
    -1
      packages/react-common-docs/src/pages/_app.tsx
  6. +1
    -1
      packages/react-common-docs/src/pages/components/Button.mdx
  7. +1
    -1
      packages/react-common-docs/src/pages/components/Checkbox.mdx
  8. +1
    -1
      packages/react-common-docs/src/pages/components/Icon.mdx
  9. +1
    -1
      packages/react-common-docs/src/pages/components/RadioButton.mdx
  10. +1
    -1
      packages/react-common-docs/src/pages/components/Select.mdx
  11. +1
    -1
      packages/react-common-docs/src/pages/components/Slider.mdx
  12. +1
    -1
      packages/react-common-docs/src/pages/components/TextInput.mdx
  13. +1
    -1
      packages/react-common/src/components/Button/Button.test.tsx
  14. +0
    -0
      packages/react-common/src/components/Button/Button.tsx
  15. +1
    -1
      packages/react-common/src/components/Checkbox/Checkbox.test.tsx
  16. +0
    -0
      packages/react-common/src/components/Checkbox/Checkbox.tsx
  17. +1
    -1
      packages/react-common/src/components/Icon/Icon.test.tsx
  18. +0
    -0
      packages/react-common/src/components/Icon/Icon.tsx
  19. +1
    -1
      packages/react-common/src/components/RadioButton/RadioButton.test.tsx
  20. +0
    -0
      packages/react-common/src/components/RadioButton/RadioButton.tsx
  21. +1
    -1
      packages/react-common/src/components/Select/Select.test.tsx
  22. +0
    -0
      packages/react-common/src/components/Select/Select.tsx
  23. +1
    -1
      packages/react-common/src/components/Slider/Slider.test.tsx
  24. +0
    -0
      packages/react-common/src/components/Slider/Slider.tsx
  25. +1
    -1
      packages/react-common/src/components/TextInput/TextInput.test.tsx
  26. +0
    -0
      packages/react-common/src/components/TextInput/TextInput.tsx
  27. +1
    -1
      packages/react-common/src/index.test.ts
  28. +0
    -0
      packages/react-common/src/index.ts
  29. +0
    -0
      packages/react-common/src/services/isEmpty.test.ts
  30. +0
    -0
      packages/react-common/src/services/isEmpty.ts
  31. +0
    -0
      packages/react-common/src/services/splitValueAndUnit.test.ts
  32. +0
    -0
      packages/react-common/src/services/splitValueAndUnit.ts
  33. +1
    -1
      packages/react-common/src/services/stringify.test.ts
  34. +0
    -0
      packages/react-common/src/services/stringify.ts
  35. +0
    -0
      packages/react-common/src/services/utilities.ts
  36. +0
    -0
      plop/templates/react-common-docs/component/{{pascalCase name}}.mdx.hbs
  37. +0
    -0
      plop/templates/react-common/component/{{pascalCase name}}.test.tsx.hbs
  38. +0
    -0
      plop/templates/react-common/component/{{pascalCase name}}.tsx.hbs
  39. +9
    -4
      plopfile.js
  40. +1
    -1
      rollup.config.js

packages/react-common-docs/src/components/Nav.tsx → packages/react-common-docs/src/components/Nav/Nav.tsx Vedi File

@@ -1,7 +1,7 @@
import * as React from 'react'
import Link from 'next/link'
import styled from 'styled-components'
import NavLink from './NavLink/NavLink'
import NavLink from '../NavLink/NavLink'

const StyledLink = styled('a')({
display: 'block',

+ 2
- 1
packages/react-common-docs/src/components/NavLink/NavLink.tsx Vedi File

@@ -80,6 +80,7 @@ export const basePropTypes = {
subtitle: PropTypes.string,
graphics: PropTypes.shape(menuGraphicsPropTypes),
indicator: PropTypes.string,
onClick: PropTypes.func,
}

const propTypes = {
@@ -136,7 +137,7 @@ const NavLink = React.forwardRef<HTMLAnchorElement, Props>((
&& (
<IndicatorContainer>
<Icon
name={indicator}
name={indicator!}
/>
</IndicatorContainer>
)


packages/react-common-docs/src/components/Playground.tsx → packages/react-common-docs/src/components/Playground/Playground.tsx Vedi File


packages/react-common-docs/src/components/Sidebar.tsx → packages/react-common-docs/src/components/Sidebar/Sidebar.tsx Vedi File

@@ -1,5 +1,5 @@
import styled from 'styled-components'
import Nav from './Nav'
import Nav from '../Nav/Nav'
import Link from 'next/link'
import * as React from 'react'


+ 1
- 1
packages/react-common-docs/src/pages/_app.tsx Vedi File

@@ -2,7 +2,7 @@ import '../../public/global.css'
import '../../public/theme/dark.css'
import sidebar from '../sidebar.json'
import brand from '../../brand'
import Sidebar from '../components/Sidebar'
import Sidebar from '../components/Sidebar/Sidebar'
import styled from 'styled-components'

const Container = styled('div')({


+ 1
- 1
packages/react-common-docs/src/pages/components/Button.mdx Vedi File

@@ -3,7 +3,7 @@ title: Button
---

import { Button } from '@tesseract-design/react-common'
import Playground from '../../components/Playground'
import Playground from '../../components/Playground/Playground'

# Button



+ 1
- 1
packages/react-common-docs/src/pages/components/Checkbox.mdx Vedi File

@@ -3,7 +3,7 @@ name: Checkbox
---

import { Checkbox } from '@tesseract-design/react-common'
import Playground from '../../components/Playground'
import Playground from '../../components/Playground/Playground'

# Checkbox



+ 1
- 1
packages/react-common-docs/src/pages/components/Icon.mdx Vedi File

@@ -3,7 +3,7 @@ name: Icon
---

import { Icon } from '@tesseract-design/react-common'
import Playground from '../../components/Playground'
import Playground from '../../components/Playground/Playground'

# Icon



+ 1
- 1
packages/react-common-docs/src/pages/components/RadioButton.mdx Vedi File

@@ -3,7 +3,7 @@ name: RadioButton
---

import { RadioButton } from '@tesseract-design/react-common'
import Playground from '../../components/Playground'
import Playground from '../../components/Playground/Playground'

# RadioButton



+ 1
- 1
packages/react-common-docs/src/pages/components/Select.mdx Vedi File

@@ -3,7 +3,7 @@ name: Select
---

import { Select } from '@tesseract-design/react-common'
import Playground from '../../components/Playground'
import Playground from '../../components/Playground/Playground'

# Select



+ 1
- 1
packages/react-common-docs/src/pages/components/Slider.mdx Vedi File

@@ -3,7 +3,7 @@ name: Slider
---

import { Slider } from '@tesseract-design/react-common'
import Playground from '../../components/Playground'
import Playground from '../../components/Playground/Playground'

# Slider



+ 1
- 1
packages/react-common-docs/src/pages/components/TextInput.mdx Vedi File

@@ -3,7 +3,7 @@ name: TextInput
---

import { TextInput } from '@tesseract-design/react-common'
import Playground from '../../components/Playground'
import Playground from '../../components/Playground/Playground'

# TextInput



packages/react-common/components/Button/Button.test.tsx → packages/react-common/src/components/Button/Button.test.tsx Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../../../utilities/jest/extensions.ts" />
/// <reference path="../../../../../utilities/jest/extensions.ts" />

import * as fc from 'fast-check'
import * as Enzyme from 'enzyme'

packages/react-common/components/Button/Button.tsx → packages/react-common/src/components/Button/Button.tsx Vedi File


packages/react-common/components/Checkbox/Checkbox.test.tsx → packages/react-common/src/components/Checkbox/Checkbox.test.tsx Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../../../utilities/jest/extensions.ts" />
/// <reference path="../../../../../utilities/jest/extensions.ts" />

import * as fc from 'fast-check'
import * as Enzyme from 'enzyme'

packages/react-common/components/Checkbox/Checkbox.tsx → packages/react-common/src/components/Checkbox/Checkbox.tsx Vedi File


packages/react-common/components/Icon/Icon.test.tsx → packages/react-common/src/components/Icon/Icon.test.tsx Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../../../utilities/jest/extensions.ts" />
/// <reference path="../../../../../utilities/jest/extensions.ts" />

import * as fc from 'fast-check'
import * as Enzyme from 'enzyme'

packages/react-common/components/Icon/Icon.tsx → packages/react-common/src/components/Icon/Icon.tsx Vedi File


packages/react-common/components/RadioButton/RadioButton.test.tsx → packages/react-common/src/components/RadioButton/RadioButton.test.tsx Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../../../utilities/jest/extensions.ts" />
/// <reference path="../../../../../utilities/jest/extensions.ts" />

import * as fc from 'fast-check'
import * as Enzyme from 'enzyme'

packages/react-common/components/RadioButton/RadioButton.tsx → packages/react-common/src/components/RadioButton/RadioButton.tsx Vedi File


packages/react-common/components/Select/Select.test.tsx → packages/react-common/src/components/Select/Select.test.tsx Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../../../utilities/jest/extensions.ts" />
/// <reference path="../../../../../utilities/jest/extensions.ts" />

import * as fc from 'fast-check'
import * as Enzyme from 'enzyme'

packages/react-common/components/Select/Select.tsx → packages/react-common/src/components/Select/Select.tsx Vedi File


packages/react-common/components/Slider/Slider.test.tsx → packages/react-common/src/components/Slider/Slider.test.tsx Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../../../utilities/jest/extensions.ts" />
/// <reference path="../../../../../utilities/jest/extensions.ts" />

import * as fc from 'fast-check'
import * as Enzyme from 'enzyme'

packages/react-common/components/Slider/Slider.tsx → packages/react-common/src/components/Slider/Slider.tsx Vedi File


packages/react-common/components/TextInput/TextInput.test.tsx → packages/react-common/src/components/TextInput/TextInput.test.tsx Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../../../utilities/jest/extensions.ts" />
/// <reference path="../../../../../utilities/jest/extensions.ts" />

import * as fc from 'fast-check'
import * as Enzyme from 'enzyme'

packages/react-common/components/TextInput/TextInput.tsx → packages/react-common/src/components/TextInput/TextInput.tsx Vedi File


packages/react-common/index.test.ts → packages/react-common/src/index.test.ts Vedi File

@@ -1,5 +1,5 @@
/// <reference types="jest-enzyme" />
/// <reference path="../../utilities/jest/extensions.ts" />
/// <reference path="../../../utilities/jest/extensions.ts" />

import * as T from './index'


packages/react-common/index.ts → packages/react-common/src/index.ts Vedi File


packages/react-common/services/isEmpty.test.ts → packages/react-common/src/services/isEmpty.test.ts Vedi File


packages/react-common/services/isEmpty.ts → packages/react-common/src/services/isEmpty.ts Vedi File


packages/react-common/services/splitValueAndUnit.test.ts → packages/react-common/src/services/splitValueAndUnit.test.ts Vedi File


packages/react-common/services/splitValueAndUnit.ts → packages/react-common/src/services/splitValueAndUnit.ts Vedi File


packages/react-common/services/stringify.test.ts → packages/react-common/src/services/stringify.test.ts Vedi File

@@ -1,5 +1,5 @@
import * as fc from 'fast-check'
import * as fcArb from '../../../utilities/fast-check/arbitraries'
import * as fcArb from '../../../../utilities/fast-check/arbitraries'
import stringify from './stringify'

it('should exist', () => {

packages/react-common/services/stringify.ts → packages/react-common/src/services/stringify.ts Vedi File


packages/react-common/services/utilities.ts → packages/react-common/src/services/utilities.ts Vedi File


plop/templates/component/{{pascalCase name}}.mdx.hbs → plop/templates/react-common-docs/component/{{pascalCase name}}.mdx.hbs Vedi File


plop/templates/component/{{pascalCase name}}.test.tsx.hbs → plop/templates/react-common/component/{{pascalCase name}}.test.tsx.hbs Vedi File


plop/templates/component/{{pascalCase name}}.tsx.hbs → plop/templates/react-common/component/{{pascalCase name}}.tsx.hbs Vedi File


+ 9
- 4
plopfile.js Vedi File

@@ -1,4 +1,3 @@
const testName = require('./plop/helpers/testName.js')
module.exports = plop => {
plop.setGenerator('component', {
description: 'Creates a component.',
@@ -21,9 +20,15 @@ module.exports = plop => {
actions: [
{
type: 'addMany',
templateFiles: 'plop/templates/component/*',
base: 'plop/templates/component',
destination: 'packages/react-common/components/{{pascalCase name}}',
templateFiles: 'plop/templates/react-common/component/*',
base: 'plop/templates/react-common/component',
destination: 'packages/react-common/src/components/{{pascalCase name}}',
},
{
type: 'addMany',
templateFiles: 'plop/templates/react-common-docs/component/*',
base: 'plop/templates/react-common-docs/component',
destination: 'packages/react-common-docs/src/pages/components',
},
],
})


+ 1
- 1
rollup.config.js Vedi File

@@ -4,7 +4,7 @@ import typescript from '@rollup/plugin-typescript'

import pkg from './package.json'

const ENTRY_POINT = './packages/react-common/index.ts'
const ENTRY_POINT = './packages/react-common/src/index.ts'

export default {
input: ENTRY_POINT,


Caricamento…
Annulla
Salva