Skip to content

Commit

Permalink
Migrate to monorepo and add opticks cli (#75)
Browse files Browse the repository at this point in the history
* migrate to yarn workspace

* initial cli

* update lib to dist

* update deps

* add nx

* add ts and tsup to cli

* move transforms to cli

* add yargs

* add nodemon

* add read-pkg

* add initial transform script

* better ux with enquirer

* add spinner

* remove boolean toggle and update tsup config

* fix cleanup command

* return success message

* rename script to opticks-cli

* add changesets

* enable corepack

* upgrade node

* update changeset config

* update action

* add chalk

* refactor and use chalk

* add log util and do some cleanup

* add jscodeshift as dev dep

* update publish action

* add changesets

* update changeset

* change version to minor

* update cli docs

* update docs

* add spinner
  • Loading branch information
dale-french authored Mar 21, 2024
1 parent 3d5b94f commit 69c5295
Show file tree
Hide file tree
Showing 48 changed files with 8,126 additions and 27,885 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
Expand Down
6 changes: 6 additions & 0 deletions .changeset/gentle-seas-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'opticks': minor
---

- Codebase refactor into a monorepo structure to cater for the introduction of an Opticks CLI
- Opticks no longer ships with scripts for automatic cleanup as this will be handled by the CLI
5 changes: 5 additions & 0 deletions .changeset/selfish-kiwis-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'opticks-cli': major
---

Initial version 🚀
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
lib
dist
29 changes: 22 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,28 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Enable Corepack before setting up Node
run: corepack enable

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.13.1'
cache: 'npm'
node-version: '20.8.0'
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Build lib package
run: yarn workspace opticks build

- name: Test lib package
run: yarn workspace opticks test

- name: Build cli package
run: yarn workspace opticks-cli build

- run: npm i
- run: npm run build
- run: npm test
- name: Test cli package
run: yarn workspace opticks-cli test
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.13.1'
cache: 'npm'
node-version: '20.8.0'
cache: 'yarn'

- run: npm i
- run: yarn install
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
publish: yarn workspace opticks release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
/node_modules

# production
/lib
/dist

# misc
.DS_Store

npm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarn
.pnp.*


.nx/cache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.1
20.8.0
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lib
20.8.0
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Loading

0 comments on commit 69c5295

Please sign in to comment.