Skip to content

Commit

Permalink
Merge b2265ce into 23b1573
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybanka authored Jul 31, 2024
2 parents 23b1573 + b2265ce commit d82d8b7
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 125 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-cheetahs-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"atom.io": minor
---

`atom.io` Packages are now built targeting ES2023, providing access to the newer features used in writing the library, for those who desire them.
8 changes: 2 additions & 6 deletions packages/atom.io/__scripts__/define-package-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,14 @@ export default function main(mode: string): void {
newPackageJson.exports = {
"./package.json": `./package.json`,
".": {
types: `./dist/index.d.ts`,
browser: `./dist/index.js`,
import: `./dist/index.js`,
require: `./dist/index.cjs`,
types: `./dist/index.d.ts`,
},
...submodules.reduce((acc, folder) => {
acc[`./${folder}/package.json`] = `./${folder}/package.json`
acc[`./${folder}`] = {
types: `./${folder}/dist/index.d.ts`,
browser: `./${folder}/dist/index.js`,
import: `./${folder}/dist/index.js`,
require: `./${folder}/dist/index.cjs`,
types: `./${folder}/dist/index.d.ts`,
}
return acc
}, {}),
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/__scripts__/define-submodule-manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,11 @@ function defineSubmoduleManifest(submoduleName: string): Json.Object {
name: manifestName,
type: `module`,
private: true,
main: `dist/index.cjs`,
module: `dist/index.js`,
main: `dist/index.js`,
types: `dist/index.d.ts`,
exports: {
".": {
import: `./dist/index.js`,
browser: `./dist/index.js`,
require: `./dist/index.cjs`,
types: `./dist/index.d.ts`,
},
},
Expand Down
15 changes: 10 additions & 5 deletions packages/atom.io/__tests__/public/timeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ describe(`timeline state lifecycle`, () => {
const unitMolecules = moleculeFamily({
key: `unit`,
new: class Unit {
public hpState = this.tools.bond(hpAtoms)
public constructor(public tools: CtorToolkit<string>) {}
public constructor(
public tools: CtorToolkit<string>,
public hpState = this.tools.bond(hpAtoms),
) {}
},
})
const gameTL = timeline({
Expand All @@ -374,7 +376,7 @@ describe(`timeline state lifecycle`, () => {
const game = makeRootMolecule(`world`)
makeMolecule(game, unitMolecules, `captain`)
expect(Internal.IMPLICIT.STORE.molecules.size).toBe(2)
expect(Internal.IMPLICIT.STORE.atoms.size).toBe(1)
expect(Internal.IMPLICIT.STORE.atoms.size).toBe(0)
undo(gameTL)
expect(Internal.IMPLICIT.STORE.molecules.size).toBe(1)
expect(Internal.IMPLICIT.STORE.atoms.size).toBe(0)
Expand All @@ -391,9 +393,12 @@ describe(`timeline state lifecycle`, () => {
const unitMolecules = moleculeFamily({
key: `unit`,
new: class Unit {
public hpState = this.tools.bond(hpAtoms)
public armorState: RegularAtomToken<number> | undefined
public constructor(public tools: CtorToolkit<string>) {}
public constructor(
public tools: CtorToolkit<string>,
public key: string,
public hpState = tools.bond(hpAtoms),
) {}
public addArmor = transaction<(armor: number) => void>({
key: `addArmor`,
do: ({ set }, armor) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/atom.io/__tests__/public/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,11 @@ describe(`transaction.make`, () => {
const unitMolecules = moleculeFamily({
key: `unit`,
new: class Unit {
public hpState = this.tools.bond(hpAtoms)
public constructor(
public tools: CtorToolkit<string>,
public key: string,
public hp: number,
public hpState = tools.bond(hpAtoms),
) {
setState(this.hpState, this.hp)
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-data",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/ephemeral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-ephemeral",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-eslint-plugin",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/immortal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-immortal",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-internal",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/introspection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-introspection",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-json",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
64 changes: 16 additions & 48 deletions packages/atom.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,115 +170,83 @@
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"browser": "./dist/index.js",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"types": "./dist/index.d.ts"
},
"./data/package.json": "./data/package.json",
"./data": {
"types": "./data/dist/index.d.ts",
"browser": "./data/dist/index.js",
"import": "./data/dist/index.js",
"require": "./data/dist/index.cjs"
"types": "./data/dist/index.d.ts"
},
"./ephemeral/package.json": "./ephemeral/package.json",
"./ephemeral": {
"types": "./ephemeral/dist/index.d.ts",
"browser": "./ephemeral/dist/index.js",
"import": "./ephemeral/dist/index.js",
"require": "./ephemeral/dist/index.cjs"
"types": "./ephemeral/dist/index.d.ts"
},
"./eslint-plugin/package.json": "./eslint-plugin/package.json",
"./eslint-plugin": {
"types": "./eslint-plugin/dist/index.d.ts",
"browser": "./eslint-plugin/dist/index.js",
"import": "./eslint-plugin/dist/index.js",
"require": "./eslint-plugin/dist/index.cjs"
"types": "./eslint-plugin/dist/index.d.ts"
},
"./immortal/package.json": "./immortal/package.json",
"./immortal": {
"types": "./immortal/dist/index.d.ts",
"browser": "./immortal/dist/index.js",
"import": "./immortal/dist/index.js",
"require": "./immortal/dist/index.cjs"
"types": "./immortal/dist/index.d.ts"
},
"./internal/package.json": "./internal/package.json",
"./internal": {
"types": "./internal/dist/index.d.ts",
"browser": "./internal/dist/index.js",
"import": "./internal/dist/index.js",
"require": "./internal/dist/index.cjs"
"types": "./internal/dist/index.d.ts"
},
"./introspection/package.json": "./introspection/package.json",
"./introspection": {
"types": "./introspection/dist/index.d.ts",
"browser": "./introspection/dist/index.js",
"import": "./introspection/dist/index.js",
"require": "./introspection/dist/index.cjs"
"types": "./introspection/dist/index.d.ts"
},
"./json/package.json": "./json/package.json",
"./json": {
"types": "./json/dist/index.d.ts",
"browser": "./json/dist/index.js",
"import": "./json/dist/index.js",
"require": "./json/dist/index.cjs"
"types": "./json/dist/index.d.ts"
},
"./react/package.json": "./react/package.json",
"./react": {
"types": "./react/dist/index.d.ts",
"browser": "./react/dist/index.js",
"import": "./react/dist/index.js",
"require": "./react/dist/index.cjs"
"types": "./react/dist/index.d.ts"
},
"./react-devtools/package.json": "./react-devtools/package.json",
"./react-devtools": {
"types": "./react-devtools/dist/index.d.ts",
"browser": "./react-devtools/dist/index.js",
"import": "./react-devtools/dist/index.js",
"require": "./react-devtools/dist/index.cjs"
"types": "./react-devtools/dist/index.d.ts"
},
"./realtime/package.json": "./realtime/package.json",
"./realtime": {
"types": "./realtime/dist/index.d.ts",
"browser": "./realtime/dist/index.js",
"import": "./realtime/dist/index.js",
"require": "./realtime/dist/index.cjs"
"types": "./realtime/dist/index.d.ts"
},
"./realtime-client/package.json": "./realtime-client/package.json",
"./realtime-client": {
"types": "./realtime-client/dist/index.d.ts",
"browser": "./realtime-client/dist/index.js",
"import": "./realtime-client/dist/index.js",
"require": "./realtime-client/dist/index.cjs"
"types": "./realtime-client/dist/index.d.ts"
},
"./realtime-react/package.json": "./realtime-react/package.json",
"./realtime-react": {
"types": "./realtime-react/dist/index.d.ts",
"browser": "./realtime-react/dist/index.js",
"import": "./realtime-react/dist/index.js",
"require": "./realtime-react/dist/index.cjs"
"types": "./realtime-react/dist/index.d.ts"
},
"./realtime-server/package.json": "./realtime-server/package.json",
"./realtime-server": {
"types": "./realtime-server/dist/index.d.ts",
"browser": "./realtime-server/dist/index.js",
"import": "./realtime-server/dist/index.js",
"require": "./realtime-server/dist/index.cjs"
"types": "./realtime-server/dist/index.d.ts"
},
"./realtime-testing/package.json": "./realtime-testing/package.json",
"./realtime-testing": {
"types": "./realtime-testing/dist/index.d.ts",
"browser": "./realtime-testing/dist/index.js",
"import": "./realtime-testing/dist/index.js",
"require": "./realtime-testing/dist/index.cjs"
"types": "./realtime-testing/dist/index.d.ts"
},
"./transceivers/set-rtx/package.json": "./transceivers/set-rtx/package.json",
"./transceivers/set-rtx": {
"types": "./transceivers/set-rtx/dist/index.d.ts",
"browser": "./transceivers/set-rtx/dist/index.js",
"import": "./transceivers/set-rtx/dist/index.js",
"require": "./transceivers/set-rtx/dist/index.cjs"
"types": "./transceivers/set-rtx/dist/index.d.ts"
}
}
}
5 changes: 1 addition & 4 deletions packages/atom.io/react-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-react-devtools",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-react",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/atom.io/realtime-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "atom.io-realtime-client",
"type": "module",
"private": true,
"main": "dist/index.cjs",
"module": "dist/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"browser": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
Expand Down
Loading

0 comments on commit d82d8b7

Please sign in to comment.