Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: monorepo conversion #42

Merged
merged 16 commits into from
Feb 11, 2025
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: 'moonrepo/setup-toolchain@v0'
with:
node-version: "20"
- run: npm ci
- run: npm run build
auto-install: true
- run: pnpm install
- run: moon :build
15 changes: 7 additions & 8 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: 'moonrepo/setup-toolchain@v0'
with:
node-version: "20"
- run: npm ci
- run: npm run build
- uses: JS-DevTools/npm-publish@v3
auto-install: true
- run: pnpm install
- run: moon :build
- uses: simenandre/publish-with-pnpm@v2
with:
token: ${{ secrets.NPM_TOKEN }}
access: 'public'

npm-auth-token: ${{ secrets.NPM_TOKEN }}

16 changes: 10 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
node_modules
.pnp
.pnp.js

# testing
/coverage
coverage

# production
/build
/dist
build
dist

# misc
.DS_Store
Expand All @@ -25,4 +25,8 @@ yarn-error.log*

# Editor directories and files
.idea/
.vscode
.vscode
# moon
.moon/cache
.moon/docker
*.tsbuildinfo
6 changes: 6 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Enable Node.js and override default settings
language: 'typescript'
node:
packageManager: 'pnpm'
typescript:
syncProjectReferences: true
32 changes: 32 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://moonrepo.dev/docs/config/workspace
$schema: 'https://moonrepo.dev/schemas/workspace.json'

# Require a specific version of moon while running commands, otherwise fail.
# versionConstraint: '>=1.0.0'

# Extend and inherit an external configuration file. Must be a valid HTTPS URL or file system path.
# extends: './shared/workspace.yml'

# REQUIRED: A map of all projects found within the workspace, or a list or file system globs.
# When using a map, each entry requires a unique project ID as the map key, and a file system
# path to the project folder as the map value. File paths are relative from the workspace root,
# and cannot reference projects located outside the workspace boundary.
projects:
- 'apps/*'
- 'packages/*'



# Configures the version control system to utilize within the workspace. A VCS
# is required for determining touched (added, modified, etc) files, calculating file hashes,
# computing affected files, and much more.
vcs:
# The client to use when managing the repository.
# Accepts "git". Defaults to "git".
manager: 'git'

# The default branch (master/main/trunk) in the repository for comparing the
# local branch against. For git, this is is typically "master" or "main",
# and must include the remote prefix (before /).
defaultBranch: 'main'

9 changes: 9 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
moon = "1.31.0"
node = "22.13.1"
pnpm = "9.15.3"

[plugins]
moon = "https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"

[settings]
auto-install = true
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ Please read the [TODO](TODO.md) file for upcoming features.
You must have the [tari-dan](https://github.com/tari-project/tari-dan) repo cloned at the same folder level as this repo.

To build the library:
First you must install [proto](https://moonrepo.dev/proto) to manage node and pnpm versions
```shell
npm install
npm run build
proto use
pnpm install
moon tarijs:build
```

The bundled files for deployment or publication will be located under the `dist` folder.
Expand All @@ -29,18 +31,17 @@ To run the example site you will need to:
* Have access to a Tari Wallet Daemon and to the Tari MetaMask Snap.
* Copy the `example/.env.example` file to `example/.env` and edit the correct environment variable values.

To run in development mode:
To run in development mode, in the packages/tarijs folder:
```shell
cd example
npm install
npm run dev
moon tarijs:build
pnpm run dev
```

For building and distribution
For building and distribution, in the packages/tarijs folder
```shell
cd example
npm install
npm run build
moon tarijs:build
```
The distribution files will be under the `example/dist` folder.

Loading