ソースを参照

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
コミット
386f5a365b
40個のファイルの変更31行の追加25行の削除
  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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示


packages/react-common-docs/src/components/Sidebar.tsx → packages/react-common-docs/src/components/Sidebar/Sidebar.tsx ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示


packages/react-common/components/Checkbox/Checkbox.test.tsx → packages/react-common/src/components/Checkbox/Checkbox.test.tsx ファイルの表示

@@ -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 ファイルの表示


packages/react-common/components/Icon/Icon.test.tsx → packages/react-common/src/components/Icon/Icon.test.tsx ファイルの表示

@@ -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 ファイルの表示


packages/react-common/components/RadioButton/RadioButton.test.tsx → packages/react-common/src/components/RadioButton/RadioButton.test.tsx ファイルの表示

@@ -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 ファイルの表示


packages/react-common/components/Select/Select.test.tsx → packages/react-common/src/components/Select/Select.test.tsx ファイルの表示

@@ -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 ファイルの表示


packages/react-common/components/Slider/Slider.test.tsx → packages/react-common/src/components/Slider/Slider.test.tsx ファイルの表示

@@ -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 ファイルの表示


packages/react-common/components/TextInput/TextInput.test.tsx → packages/react-common/src/components/TextInput/TextInput.test.tsx ファイルの表示

@@ -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 ファイルの表示


packages/react-common/index.test.ts → packages/react-common/src/index.test.ts ファイルの表示

@@ -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 ファイルの表示


packages/react-common/services/isEmpty.test.ts → packages/react-common/src/services/isEmpty.test.ts ファイルの表示


packages/react-common/services/isEmpty.ts → packages/react-common/src/services/isEmpty.ts ファイルの表示


packages/react-common/services/splitValueAndUnit.test.ts → packages/react-common/src/services/splitValueAndUnit.test.ts ファイルの表示


packages/react-common/services/splitValueAndUnit.ts → packages/react-common/src/services/splitValueAndUnit.ts ファイルの表示


packages/react-common/services/stringify.test.ts → packages/react-common/src/services/stringify.test.ts ファイルの表示

@@ -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 ファイルの表示


packages/react-common/services/utilities.ts → packages/react-common/src/services/utilities.ts ファイルの表示


plop/templates/component/{{pascalCase name}}.mdx.hbs → plop/templates/react-common-docs/component/{{pascalCase name}}.mdx.hbs ファイルの表示


plop/templates/component/{{pascalCase name}}.test.tsx.hbs → plop/templates/react-common/component/{{pascalCase name}}.test.tsx.hbs ファイルの表示


plop/templates/component/{{pascalCase name}}.tsx.hbs → plop/templates/react-common/component/{{pascalCase name}}.tsx.hbs ファイルの表示


+ 9
- 4
plopfile.js ファイルの表示

@@ -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 ファイルの表示

@@ -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,


読み込み中…
キャンセル
保存