-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from PssbleTrngle/codegen
- Loading branch information
Showing
29 changed files
with
739 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
resources/**/*.jar filter=lfs diff=lfs merge=lfs -text | ||
test/resources/**/*.jar filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,4 +132,5 @@ dist | |
# webstorm | ||
.idea | ||
|
||
test-output | ||
test-output | ||
generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
declare module "@pssbletrngle/data-modifier/generated" { | ||
export type RegistryId = string; | ||
|
||
export type InferIds<T extends RegistryId> = string; | ||
|
||
export type ItemId = string; | ||
|
||
export type BlockId = string; | ||
|
||
export type FluidId = string; | ||
|
||
export type RecipeSerializerId = string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ | |
"version": "0.0.0-dev", | ||
"description": "Data Modifier", | ||
"main": "dist/index.js", | ||
"bin": { | ||
"datamod": "dist/cli/index.js" | ||
}, | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./parser": "./dist/parser/index.js", | ||
|
@@ -11,7 +14,8 @@ | |
"./parser/thermal": "./dist/parser/thermal.js", | ||
"./parser/farmersdelight": "./dist/parser/farmersdelight.js", | ||
"./parser/adAstra": "./dist/parser/adAstra.js", | ||
"./parser/roots": "./dist/parser/roots.js" | ||
"./parser/roots": "./dist/parser/roots.js", | ||
"./ids": "./dist/schema/ids.js" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
|
@@ -35,6 +39,9 @@ | |
], | ||
"parser/roots": [ | ||
"./dist/parser/roots.d.ts" | ||
], | ||
"ids": [ | ||
"./dist/schema/ids.d.ts" | ||
] | ||
} | ||
}, | ||
|
@@ -46,7 +53,8 @@ | |
"packageManager": "[email protected]", | ||
"scripts": { | ||
"build": "tsc", | ||
"lint": "eslint \"{src,test}/**/*.ts\"", | ||
"lint": "eslint \"{src,test,playground}/**/*.ts\"", | ||
"cli": "pnpm run build && node dist/cli/index.js", | ||
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest", | ||
"test:ci": "pnpm run lint && pnpm run test --coverage" | ||
}, | ||
|
@@ -78,9 +86,12 @@ | |
"dependencies": { | ||
"@pssbletrngle/pack-resolver": "^1.3.0", | ||
"@pssbletrngle/resource-merger": "^1.2.4", | ||
"@types/command-line-usage": "^5.0.4", | ||
"@types/minimatch": "^3.0.5", | ||
"@types/prettier": "^2.7.0", | ||
"arg": "^5.0.2", | ||
"chalk": "^5.0.1", | ||
"command-line-usage": "^7.0.1", | ||
"json5": "^2.2.3", | ||
"lodash-es": "^4.17.21", | ||
"minimatch": "^5.1.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "@pssbletrngle/data-modifier-playground", | ||
"private": true, | ||
"scripts": { | ||
"build": "pnpm run codegen && tsc", | ||
"codegen": "datamod codegen --output generated --registry-dump ../test/resources/dump" | ||
}, | ||
"dependencies": { | ||
"@pssbletrngle/data-modifier": "workspace:*", | ||
"typescript": "^4.8.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createId, createLogger, PackLoader } from '@pssbletrngle/data-modifier' | ||
import type { InferIds, ItemId, WorldgenBiomeId } from '@pssbletrngle/data-modifier/generated' | ||
|
||
const logger = createLogger() | ||
const loader = new PackLoader(logger) | ||
|
||
const item: ItemId = 'minecraft:acacia_boat' | ||
const otherItem: InferIds<'minecraft:item'> = 'minecraft:acacia_door' | ||
const biome: WorldgenBiomeId = 'minecraft:basalt_deltas' | ||
|
||
createId(biome) | ||
|
||
loader.recipes.replaceResult('minecraft:emerald', { item: 'minecraft:sapphire' }) | ||
loader.recipes.replaceResult(otherItem, { item }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"typeRoots": [ | ||
"node_modules/@types", | ||
"generated/@types" | ||
] | ||
}, | ||
"include": [ | ||
"src" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"dist", | ||
] | ||
} |
Oops, something went wrong.