Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
chore: migrate to moonrepo
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Mar 20, 2024
1 parent 5aa1554 commit e4ac4bd
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 514 deletions.
40 changes: 0 additions & 40 deletions nx.json

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"private": true,
"packageManager": "yarn@4.1.1",
"scripts": {
"dev:prepare": "yarn workspace @storipress/karbon-playground nuxt prepare",
"build": "nx run @storipress/karbon:build && yarn dev:prepare",
"build": "moon run playground:dev-prepare",
"test": "vitest",
"postinstall": "yarn build"
},
Expand Down Expand Up @@ -84,7 +83,6 @@
"msw": "1.3.2",
"npm-run-all2": "5.0.0",
"nuxt": "3.6.5",
"nx": "17.2.8",
"prettier": "3.2.4",
"tsx": "4.7.0",
"typescript": "5.3.3",
Expand Down
118 changes: 118 additions & 0 deletions packages/karbon/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
id: karbon

dependsOn:
- code-highlight
- custom-field
- jose-browser

tasks:
build:
command: noop
platform: node
deps:
- dev-prepare
- bundle-cli
- bundle-module
- bundle-helper
build-module:
command:
- nuxt-module-build
- build
platform: node
inputs:
- '@group(sources)'
outputs:
- dist/**/*
# - '!dist/module.mjs'
# - '!dist/helper.mjs'
deps:
- ^:build
- dev-prepare
bundle-cli:
command:
- tsup
- src/cli/karbon.ts
- -d
- bin
env:
POLYFILL_CRYPTO: 'true'
platform: node
inputs:
- '@group(sources)'
outputs:
- bin/**/*
bundle-helper:
command:
- tsup
- dist/helper.mjs
platform: node
inputs:
- 'dist/helper.mjs'
outputs:
- 'dist/helper.mjs'
deps:
- dev-prepare
- bundle-module
bundle-module:
command:
- tsup
- dist/module.mjs
platform: node
inputs:
- 'dist/module.mjs'
outputs:
- 'dist/module.mjs'
deps:
- dev-prepare
- build-module
dev:
command:
- nuxi
- dev
- playground
local: true
platform: node
dev-build:
command:
- nuxi
- build
- playground
platform: node
dev-prepare:
command:
- nuxi
- prepare
- playground
deps:
- ~:dev-stub
env:
JITI_ALIAS: '{"tslib": "tslib/tslib.es6.js"}'
platform: node
dev-stub:
command:
- nuxt-module-build
- build
- --stub
env:
JITI_ALIAS: '{"tslib": "tslib/tslib.es6.js"}'
platform: node
deps:
- ^:build
lint:
command:
- eslint
- .
platform: node
release:
command:
- tsx
- scripts/release.mts
platform: node
test:
command: vitest
platform: node
test-watch:
command:
- vitest
- watch
platform: node
76 changes: 5 additions & 71 deletions packages/karbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,76 +38,11 @@
"node": ">=16.7.0"
},
"scripts": {
"prepack": "yarn build",
"dev": "nuxi dev playground",
"build": "nx run @storipress/karbon:build-nx",
"build-nx": "true",
"build:module": "nuxt-module-build build",
"bundle:cli": "POLYFILL_CRYPTO=true tsup src/cli/karbon.ts -d bin",
"bundle:helper": "tsup dist/helper.mjs",
"bundle:module": "tsup dist/module.mjs",
"dev:build": "nuxi build playground",
"dev:prepare": "JITI_ALIAS='{\"tslib\": \"tslib/tslib.es6.js\"}' nuxt-module-build build --stub && JITI_ALIAS='{\"tslib\": \"tslib/tslib.es6.js\"}' nuxi prepare playground",
"release": "tsx scripts/release.mts",
"lint": "eslint .",
"test": "vitest",
"test:watch": "vitest watch"
},
"nx": {
"namedInputs": {
"dist": [
"{projectRoot}/dist"
]
},
"targets": {
"build-nx": {
"dependsOn": [
"dev:prepare",
"bundle:cli",
"bundle:helper",
"bundle:module"
]
},
"bundle:helper": {
"inputs": [
"{projectRoot}/dist/helper.mjs"
],
"outputs": [
"{projectRoot}/dist/helper.mjs"
],
"dependsOn": [
"dev:prepare",
"build:module"
]
},
"bundle:module": {
"inputs": [
"{projectRoot}/dist/module.mjs"
],
"outputs": [
"{projectRoot}/dist/module.mjs"
],
"dependsOn": [
"dev:prepare",
"build:module"
]
},
"bundle:cli": {
"outputs": [
"{projectRoot}/bin/karbon.mjs"
]
},
"build:module": {
"outputs": [
"{projectRoot}/dist/**",
"{workspaceRoot}/!{projectRoot}/dist/module.mjs",
"{workspaceRoot}/!{projectRoot}/dist/helper.mjs"
],
"dependsOn": [
"dev:prepare"
]
}
}
"build": "moon run build",
"lint": "moon run lint",
"test": "moon run test",
"release": "moon run release",
"prepack": "yarn build"
},
"dependencies": {
"@apollo/client": "^3.8.8",
Expand Down Expand Up @@ -221,7 +156,6 @@
"globby": "14.0.1",
"msw": "1.3.2",
"nuxt": "3.6.5",
"nx": "17.2.8",
"prettier": "3.2.4",
"tsup": "8.0.1",
"tsx": "4.7.0",
Expand Down
38 changes: 38 additions & 0 deletions packages/playground/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
dependsOn:
- custom-field
- karbon

tasks:
build:
command:
- nuxt
- build
platform: node
deps:
- ^:build
bundle:
command: karbon
platform: node
deps:
- ^:build
dev:
command:
- nuxt
- dev
local: true
platform: node
deps:
- dev-prepare
- ^:build
dev-prepare:
command:
- nuxt
- prepare
platform: node
deps:
- ^:build
generate:
command:
- nuxt
- generate
platform: node
13 changes: 4 additions & 9 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
"url": "https://github.com/storipress/karbon"
},
"scripts": {
"build": "nuxt build",
"bundle": "karbon",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"dev:prepare": "nuxt prepare"
"dev": "moon run dev"
},
"msw": {
"workerDirectory": "public"
},
"dependencies": {
"@apollo/client": "^3.8.8",
Expand Down Expand Up @@ -95,8 +93,5 @@
"tsx": "4.7.0",
"typescript": "5.3.3",
"vitest": "0.34.6"
},
"msw": {
"workerDirectory": "public"
}
}
Loading

0 comments on commit e4ac4bd

Please sign in to comment.