Skip to content

Commit

Permalink
Merge pull request #60 from mj-studio-library/monorepo-lerna
Browse files Browse the repository at this point in the history
Migration to Monorepo & Lerna
  • Loading branch information
mym0404 authored Mar 27, 2024
2 parents 01cfc00 + 7519584 commit ba6e49b
Show file tree
Hide file tree
Showing 301 changed files with 4,680 additions and 1,859 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules

# generated by bob
lib/
**/lib/**
lib
**/dist/**
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@mj-studio/eslint-config-react"
]
}
3 changes: 0 additions & 3 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Thank you for contributing `react-native-themed-styled-system` package 🤗 -->
<!-- Thank you for contributing `@react-native-styled-system/core` package 🤗 -->

## Type of change

Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ jobs:
with:
node-version: 20

- name: Set git config
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Cache dependencies
id: cache
uses: actions/cache@v3
Expand All @@ -37,7 +44,6 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable


- name: Cache Example dependencies
id: cache-example
uses: actions/cache@v3
Expand Down Expand Up @@ -80,20 +86,14 @@ jobs:
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

- name: Check
run: yarn check:all

- name: Build
run: yarn build
run: lerna run build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
branches: |
[
'main',
{
name: 'alpha',
prerelease: true
}
]
- name: Version
run: lerna run version --yes

- name: Publish
run: lerna publish from-package --yes
4 changes: 2 additions & 2 deletions .github/workflows/static-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
run: yarn install --immutable

- name: Check Lint
run: yarn lint
run: yarn check:lint

- name: Check TypeScript
run: yarn check:type

- name: Test
run: yarn test
run: yarn check:test
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# tsc outDir, build directory
dist/
esm/
lib/
**/dist/
**/esm/
**/lib/

# Webstorm(or any other Intellij IDE) config
.idea/

# Node modules
node_modules/
**/node_modules/

# Built files
tsconfig.tsbuildinfo
Expand All @@ -22,6 +22,9 @@ package/
# Yarn
yarn-error.log

# Lerna
**/lerna-debug.log

# bundled assets

android/app/src/main/assets/*.bundle
Expand Down Expand Up @@ -176,4 +179,5 @@ android/keystores/debug.keystore

# VSCode
.vscode/
jsconfig.json
jsconfig.json
.nx/cache
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
yarn t
echo "🚀 pre-commit hook running..."
yarn check:all
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.0.6](https://github.com/mj-studio-library/react-native-styled-system/compare/v0.0.5...v0.0.6) (2024-03-27)

**Note:** Version bump only for package react-native-styled-system

## [0.0.5](https://github.com/mj-studio-library/react-native-styled-system/compare/v0.0.2...v0.0.5) (2024-03-27)

**Note:** Version bump only for package react-native-styled-system

## [0.0.4](https://github.com/mj-studio-library/react-native-styled-system/compare/v0.0.2...v0.0.4) (2024-03-27)

**Note:** Version bump only for package react-native-styled-system

## [0.0.3](https://github.com/mj-studio-library/react-native-styled-system/compare/v0.0.2...v0.0.3) (2024-03-27)

**Note:** Version bump only for package react-native-styled-system
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ The following steps will get you up and running to contribute to Chakra UI:

**`yarn install`**: bootstraps the entire project, symlinks all dependencies.

**`yarn build`**: Run static checks & build with `react-native-builder-bob`
**`leran run build`**: Run static checks & build with `react-native-builder-bob`

**`yarn lint`**: Check ESLint
**`yarn check:lint`**: Check ESLint

**`yarn check:type`**: Check typescript without noEmit

**`yarn test`**: Run test with jest
**`yarn check:test`**: Run test with jest

## Think you found a bug?

Expand Down Expand Up @@ -92,7 +92,7 @@ https://www.conventionalcommits.org/ or check out the

3. Make and commit your changes following the
[commit convention](https://github.com/mj-studio-library/react-native-styled-system/blob/main/CONTRIBUTING.md#commit-convention).
As you develop, you can run `yarn t` and to make sure everything works as expected.
As you develop, you can run `yarn check:all` and to make sure everything works as expected.

4. You should base branch of PR as `develop`.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2021 dooboolab
Copyright (c) 2024 MJ Studio

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions doc/docs/example-components/styled-button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type { PropsWithChildren, Ref } from 'react';
import React, { forwardRef } from 'react';
import type { TouchableOpacityProps } from 'react-native';
import { TouchableOpacity } from 'react-native';
import type { SxProps } from 'react-native-themed-styled-system';
import { useSx } from 'react-native-themed-styled-system';
import type { SxProps } from '@react-native-styled-system/core';
import { useSx } from '@react-native-styled-system/core';

import { Txt } from './Txt';

Expand Down
4 changes: 2 additions & 2 deletions doc/docs/example-components/styled-image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type { PropsWithChildren, Ref } from 'react';
import React, { forwardRef } from 'react';
import type { ImageProps, ImageStyle } from 'react-native';
import { Image } from 'react-native';
import type { SxProps } from 'react-native-themed-styled-system';
import { useSx } from 'react-native-themed-styled-system';
import type { SxProps } from '@react-native-styled-system/core';
import { useSx } from '@react-native-styled-system/core';

type StyledImageProps = PropsWithChildren<ImageProps & SxProps>;

Expand Down
2 changes: 1 addition & 1 deletion doc/docs/example-components/styled-scroll-view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: StyledScrollView
```tsx title='StyledScrollView.tsx'
import { PropsWithChildren, forwardRef, Ref } from 'react';
import { ScrollViewProps, ScrollView } from 'react-native';
import { SxProps, useSx } from 'react-native-themed-styled-system';
import { SxProps, useSx } from '@react-native-styled-system/core';

type StyledScrollViewProps = PropsWithChildren<
{
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/example-components/styled-view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: StyledView
```tsx title='StyledView.tsx'
import { forwardRef, Ref, PropsWithChildren } from 'react';
import { View, ViewProps } from 'react-native';
import { SxProps, useSx } from 'react-native-themed-styled-system';
import { SxProps, useSx } from '@react-native-styled-system/core';

type StyledViewProps = PropsWithChildren<ViewProps & SxProps>;
const StyledView = forwardRef((props: StyledViewProps, ref: Ref<View>) => {
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/example-components/txt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Txt

```tsx title='Txt.tsx'
import { Text, TextProps } from 'react-native';
import { TextSxProps, useSx } from 'react-native-themed-styled-system';
import { TextSxProps, useSx } from '@react-native-styled-system/core';

type TxtProps = {} & TextSxProps & TextProps;
const Txt = (props: TxtProps) => {
Expand Down
4 changes: 2 additions & 2 deletions doc/docs/usage/component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ It can be defined as follows:
```tsx title="StyledView.tsx"
import { forwardRef, Ref, PropsWithChildren } from 'react';
import { View, ViewProps } from 'react-native';
import { SxProps, useSx } from 'react-native-themed-styled-system';
import { SxProps, useSx } from '@react-native-styled-system/core';

type StyledViewProps = PropsWithChildren<ViewProps & SxProps>;
const StyledView = forwardRef((props: StyledViewProps, ref: Ref<View>) => {
Expand Down Expand Up @@ -129,7 +129,7 @@ You can define a component using the `sx` prop as follows.
```tsx title="StyledScrollView.tsx"
import { PropsWithChildren, forwardRef, Ref } from 'react';
import { ScrollViewProps, ScrollView } from 'react-native';
import { SxProps, useSx } from 'react-native-themed-styled-system';
import { SxProps, useSx } from '@react-native-styled-system/core';

type StyledScrollViewProps = PropsWithChildren<
{
Expand Down
4 changes: 2 additions & 2 deletions doc/docs/usage/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ Installiation step
<Tabs>
<TabItem value="npm" label="npm" default>
```sh
npm install react-native-themed-styled-system
npm install @react-native-styled-system/core
```
</TabItem>
<TabItem value="yarn" label="yarn">
```sh
yarn add react-native-themed-styled-system
yarn add @react-native-styled-system/core
```
</TabItem>
</Tabs>
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/usage/text.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ We can define our new Text component like this.

```tsx title='Txt.tsx'
import { Text, TextProps } from 'react-native';
import { TextSxProps, useSx } from 'react-native-themed-styled-system';
import { TextSxProps, useSx } from '@react-native-styled-system/core';

type TxtProps = {} & TextSxProps & TextProps;
const Txt = (props: TxtProps) => {
Expand Down
8 changes: 4 additions & 4 deletions doc/docs/usage/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ React Native Styled System aims for type-safe use.
Please enter the path to the module where `ThemedDict` is `default exported` as an argument to the command.

```shell
react-native-themed-styled-system src/AppTheme.ts
@react-native-styled-system/core src/AppTheme.ts
```

More convenient use is possible with `scripts` in `package.json`.
Expand All @@ -25,7 +25,7 @@ More convenient use is possible with `scripts` in `package.json`.
{
...
"scripts": {
"theme:gen": "react-native-themed-styled-system src/AppTheme.ts"
"theme:gen": "@react-native-styled-system/core src/AppTheme.ts"
}
}
```
Expand Down Expand Up @@ -58,12 +58,12 @@ We recommend using the `postinstall` script so that it can operate without probl
## How it works

used internally in the package
File in the path `node_modules/react-native-themed-styled-system/lib/typescript/@types/ThemedTypings.d.ts`
File in the path `node_modules/@react-native-styled-system/core/lib/typescript/@types/ThemedTypings.d.ts`
Regenerate it yourself.

Then it is created as follows:

```ts title="node_modules/react-native-themed-styled-system/lib/typescript/@types/ThemedTypings.d.ts"
```ts title="node_modules/@react-native-styled-system/core/lib/typescript/@types/ThemedTypings.d.ts"
import type { ColorsValue, RadiiValue, SizesValue, SpaceValue } from './Token';
export interface ThemedTypings {
Expand Down
2 changes: 1 addition & 1 deletion doc/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function Home(): JSX.Element {
/>
<div style={{ marginTop: 24 }}>
<code style={{ borderWidth: 1, padding: 5, whiteSpace: 'pre-wrap' }}>
{'npm install react-native-themed-styled-system'}
{'npm install @react-native-styled-system/core'}
</code>
</div>
</div>
Expand Down
8 changes: 0 additions & 8 deletions example/.expo/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions example/.expo/devices.json

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/assert/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/async_hooks/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/buffer/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/child_process/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/cluster/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/console/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/constants/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/crypto/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/dgram/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/diagnostics_channel/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/dns/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/domain/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/events/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/fs/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/fs/promises/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/http/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/http2/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/https/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/inspector/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/module/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/net/index.js

This file was deleted.

1 change: 0 additions & 1 deletion example/.expo/metro/externals/os/index.js

This file was deleted.

Loading

0 comments on commit ba6e49b

Please sign in to comment.