Skip to content

Commit

Permalink
Splitting our packages into two more pacakges: types and shared-ui (
Browse files Browse the repository at this point in the history
#68)

* create types package

* fixed build issue for types package

* created a shared-ui package

* fixed fingerprint issues

* added production builds

* added production builds

* fixed build issus in react and react-sdk packages

* updated types of all packages

* fixed production build issues

* used wildcard versioning for packaged (temporary change)

* fixed all the issues with production build

* updated commands for main repo

* refactored react package

* removed yalc

* Use react-app-rewired to allow create-react-app work together with a monorepo

* Update setup.md

* added svgr support for webpack react svg components

* some package-lock.json changes

---------

Co-authored-by: Incorbador <[email protected]>
  • Loading branch information
Aby-JS and incorbador authored Dec 12, 2023
1 parent 0144eaa commit 79a7551
Show file tree
Hide file tree
Showing 136 changed files with 25,806 additions and 29,460 deletions.
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ build
playground
package-lock.json
packages/**/dist
packages/**/tatilwind.config.js
packages/**/webpack.dev.js
packages/**/webpack.common.js
packages/**/webpack.prod.js
webpack.common.js
.eslintrc.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dist
.DS_Store
.idea
.yalc
lerna-debug.log
56 changes: 2 additions & 54 deletions docs/setup.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
<p align="center">
<a href="https://www.corbado.com/" target="_blank" rel="noopener noreferrer">
<img src="https://uploads-ssl.webflow.com/626a572dd59ab59d107b26c6/6285290cdc476312ea882af9_Corbado%20Wort-Bildmarke.svg" height="64">
</a>
<br />
</p>

# Corbado JavaScript SDKs

This repository contains all the Corbado JavaScript SDKs under the `@corbado/`namespace.

## Packages

For package specific details on installation, architecture and usage usage, you can refer to the package's README file.

- [`@corbado/web-core`](./packages/web-core) Corbado Web core package.
- [`@corbado/react-sdk`](./packages/react-sdk) Corbado React SDK package developers can use to develop their own custom React UI.
- [`@corbado/react`](./packages/react) Corbado React UI package ready for plug and play.

## Documentation and Usage

To get started, you can refer to the corbado [documentation](https://docs.corbado.com/overview/welcome) page.

You can add an SDK to your project by either

```sh
npm install @corbado/{package}
```

or

```sh
yarn add @corbado/{package}
```

## Test

### Prerequisite

- Node.js v14+
Expand All @@ -46,20 +9,5 @@ yarn add @corbado/{package}
- In the root directory and run `npm install --global lerna` in the terminal if you don't have Lerna installed already.
- Then run `npm i` to install packages dependencies.
- Run `lerna run build` to build all packages.

### React UI Example

- Go to `react-example` under the playground directory by running `cd playground/react-example` in the terminal.
- Run `npx yalc add @corbado/react`
- Run `npm install` to install react-example app dependencies
- Run `npm start` to start the react-example app which should run on port `3000`
- In your browser, visit `http://localhost:3000` to view the sample app.

### React SDK UI Exxample

- Go to the `react-sdk` directory and run `npx publish @corbado/react-sdk` to publish the package locally.
- Go to `react-custom-ui` under the playground directory by running `cd playground/react-custom-ui` in the terminal.
- Run `npx yalc add @corbado/react-sdk`
- Run `npm install` to install react-custom-ui app dependencies
- Run `npm start` to start the react-custom-ui app which should run on port `3000`
- In your browser, visit `http://localhost:3000` to view the sample app.
- Go to one of the examples (e.g. `cd plaground/react-example`) and run `npm install` to install the example dependencies.
- Now start the example app by running `npm start` and visit `http://localhost:3000` to view the sample app (the url might be different depending on the example app you are running).
19 changes: 0 additions & 19 deletions lerna-debug.log

This file was deleted.

3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.0"
"version": "0.0.0",
"packages": ["packages/**"]
}
8 changes: 4 additions & 4 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "build_and_publish:local"]
"cacheableOperations": ["build", "lint", "build:dev"]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
},
"build:dev": {
"dependsOn": ["^build:dev"]
},
"lint": {
"dependsOn": ["^lint"]
},
"build_and_publish:local": {
"dependsOn": ["^build_and_publish:local"]
}
}
}
Loading

0 comments on commit 79a7551

Please sign in to comment.