Skip to content

Commit

Permalink
Move to packages (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxjrvs committed Nov 26, 2024
1 parent 9e0c7cd commit 418f74b
Show file tree
Hide file tree
Showing 147 changed files with 75 additions and 81 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/ci-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ jobs:
test:
defaults:
run:
working-directory: '@randsum/${{ inputs.package }}'

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
working-directory: 'packages/@randsum/${{ inputs.package }}'
runs-on: [ubuntu-latest]

steps:
- name: Checkout repo
Expand All @@ -28,7 +24,7 @@ jobs:
with:
filters: |
changesInPackage:
- '@randsum/${{ inputs.package }}/**'
- 'packages/@randsum/${{ inputs.package }}/**'
- name: Use Bun
if: steps.changes.outputs.changesInPackage == 'true'
Expand All @@ -39,27 +35,27 @@ jobs:
# Run the build script to build sibling packages
- name: core
if: steps.changes.outputs.changesInPackage == 'true'
working-directory: '@randsum/core'
working-directory: 'packages/@randsum/core'
run: bun install && bun run build

- name: notation
if: steps.changes.outputs.changesInPackage == 'true'
working-directory: '@randsum/notation'
working-directory: 'packages/@randsum/notation'
run: bun install && bun run build

- name: dice
if: steps.changes.outputs.changesInPackage == 'true'
working-directory: '@randsum/dice'
working-directory: 'packages/@randsum/dice'
run: bun install && bun run build

- name: tower
if: steps.changes.outputs.changesInPackage == 'true'
working-directory: '@randsum/tower'
working-directory: 'packages/@randsum/tower'
run: bun install && bun run build

- name: customdice
if: steps.changes.outputs.changesInPackage == 'true'
working-directory: '@randsum/customdice'
working-directory: 'packages/@randsum/customdice'
run: bun install && bun run build

- name: Type Check
Expand Down
20 changes: 0 additions & 20 deletions @randsum/core/Randsum .code-workspace

This file was deleted.

9 changes: 0 additions & 9 deletions @randsum/tower/tsconfig.json

This file was deleted.

Binary file modified bun.lockb
Binary file not shown.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
"author": "Alex Jarvis",
"icon": "https://raw.githubusercontent.com/RANDSUM/randsum/main/icon.webp",
"workspaces": [
"@randsum/*"
"packages/*",
"packages/@randsum/*"
],
"repository": {
"type": "git",
"url": "https://github.com/RANDSUM/randsum.git"
},
"scripts": {
"refresh:core": "cd @randsum/core && bun install && bun run build",
"refresh:dice": "cd @randsum/dice && bun install && bun update && bun run build",
"refresh:notation": "cd @randsum/notation && bun install && bun update && bun run build",
"refresh:tower" : "cd @randsum/tower && bun install && bun update && bun run build",
"refresh:customdice": "cd @randsum/customdice && bun install && bun update && bun run build",
"refresh:games": "cd @randsum/games && bun install && bun update && bun run build",
"refresh:core": "cd packages/@randsum/core && bun install && bun run build",
"refresh:dice": "cd packages/@randsum/dice && bun install && bun update && bun run build",
"refresh:notation": "cd packages/@randsum/notation && bun install && bun update && bun run build",
"refresh:tower" : "cd packages/@randsum/tower && bun install && bun update && bun run build",
"refresh:customdice": "cd packages/@randsum/customdice && bun install && bun update && bun run build",
"refresh:games": "cd packages/@randsum/games && bun install && bun update && bun run build",
"refresh:all": "bun refresh:core && bun refresh:dice && bun refresh:notation && bun refresh:tower && bun refresh:customdice && bun refresh:games"
},
"type": "module"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'bun:test'
import { configToDescription } from '../src/utils/configToDescription'
import { configToDescription } from '../src'

describe('configToDescription', () => {
test('returns an array strings matching the constraints', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'bun:test'
import { coreRandom } from '../src/utils/coreRandom'
import { coreRandom } from '../src'

describe('coreRandom', () => {
test('it returns an object between 1 and the provided number', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'bun:test'
import { formDicePools } from '../src/utils/formDicePools'
import { formDicePools } from '../src'

describe('formDicePools', () => {
test('returns an object with each argument transformed into a standalone key', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { describe, expect, test } from 'bun:test'
import { type DicePoolLike } from '../src/types'
import { rollDicePools } from '../src/utils/rollDicePools'
import { rollDicePools, type DicePoolLike } from '../src'

describe('rollDicePools', () => {
test('rolls the provided dice a number of times equal to the quantity', () => {
Expand Down
File renamed without changes.
Binary file added packages/@randsum/core/bun.lockb
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"bun-plugin-dts": "^0.3.0",
"bun-types": "latest",
"eslint": "^9.15.0",
"prettier": "^3.4.0",
"prettier": "^3.4.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
},
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
RerollOptions,
UniqueOptions,
RollConfig
} from '@randsum/core/src/types'
} from '../../../src/types'

function formatHumanList(list: (string | number)[]) {
return list
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"extends": "../../tsconfig",
"extends": "../../../tsconfig",
"include": [
"./src",
"__tests__",
],
"exclude": [],
"compilerOptions": {
"composite": true,
"outDir": "q"
"outDir": "./dist"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"bun-plugin-dts": "^0.3.0",
"bun-types": "latest",
"eslint": "^9.15.0",
"prettier": "^3.4.0",
"prettier": "^3.4.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
},
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/@randsum/customdice/src/customDice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { CustomD } from './customD'

export const Fudge = new CustomD(['-', '-', '+', '+', ' ', ' '])
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export * from './guards'
export * from './patterns'

export * from './customD'
export * from './customDice'
export { roll } from './roll'
export { validate } from './validate'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "../../tsconfig",
"include": ["src", "__tests__"],
"extends": "../../../tsconfig",
"include": [
"src",
"__tests__"
],
"exclude": [],
"compilerOptions": {
"composite": true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"bun-plugin-dts": "^0.3.0",
"bun-types": "latest",
"eslint": "^9.15.0",
"prettier": "^3.4.0",
"prettier": "^3.4.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "../../tsconfig",
"include": ["./src", "__tests__"],
"extends": "../../../tsconfig",
"include": [
"./src",
"__tests__"
],
"exclude": [],
"compilerOptions": {
"composite": true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"bun-plugin-dts": "^0.3.0",
"bun-types": "latest",
"eslint": "^9.15.0",
"prettier": "^3.4.0",
"prettier": "^3.4.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
},
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ function roll(
return [rollResult.result, rollResult]
}

export const DnD5E = { roll }
export const FifthEd = { roll }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// export { default as SalvageUnion } from './SalvageUnion'
// export { default as DnD5E } from './DnD5E'
// export { default as Blades } from './Blades'

export { Blades } from './Blades'
export * as BladesTypes from './Blades/types'

export { DnD5E } from './DnD5E'
export * as DnD5ETypes from './DnD5E/types'
export { FifthEd } from './FifthEd'
export * as FifthEdTypes from './FifthEd/types'

export { SalvageUnion } from './SalvageUnion'
export * as SalvageUnionTypes from './SalvageUnion/types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "../../tsconfig",
"include": ["./src", "__tests__"],
"extends": "../../../tsconfig",
"include": [
"./src",
"__tests__"
],
"exclude": [],
"compilerOptions": {
"composite": true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"bun-plugin-dts": "^0.3.0",
"bun-types": "latest",
"eslint": "^9.15.0",
"prettier": "^3.4.0",
"prettier": "^3.4.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "../../tsconfig",
"include": ["./src", "__tests__"],
"extends": "../../../tsconfig",
"include": [
"./src",
"__tests__"
],
"exclude": [],
"compilerOptions": {
"composite": true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"bun-plugin-dts": "^0.3.0",
"bun-types": "latest",
"eslint": "^9.15.0",
"prettier": "^3.4.0",
"prettier": "^3.4.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions packages/@randsum/tower/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../../tsconfig",
"include": [
"./src",
"__tests__"
],
"exclude": [],
"compilerOptions": {
"composite": true,
"outDir": "./dist"
}
}
11 changes: 7 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@
"files": [],
"references": [
{
"path": "./@randsum/notation"
"path": "./packages/@randsum/core"
},
{
"path": "./@randsum/dice"
"path": "./packages/@randsum/notation"
},
{
"path": "./@randsum/core"
"path": "./packages/@randsum/dice"
},
{
"path": "./@randsum/tower"
"path": "./packages/@randsum/tower"
},
{
"path": "./packages/@randsum/games"
}
]
}

0 comments on commit 418f74b

Please sign in to comment.