Skip to content

Commit

Permalink
seems to be working with all projects
Browse files Browse the repository at this point in the history
  • Loading branch information
smwhr committed Jul 31, 2024
1 parent ab4e463 commit 151ab8f
Show file tree
Hide file tree
Showing 13 changed files with 499 additions and 16 deletions.
13 changes: 4 additions & 9 deletions ink.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CompilerOptions } from "./compiler/CompilerOptions";
import { PosixFileHandler } from "./compiler/FileHandler/PosixFileHandler";
import { JsonFileHandler } from "./compiler/FileHandler/JsonFileHandler";

export default interface inkjs {
declare interface Inkjs {
/**
* A Story is the core class that represents a complete Ink narrative, and
* manages runtime evaluation and state.
Expand Down Expand Up @@ -37,11 +37,6 @@ export default interface inkjs {
JsonFileHandler: typeof JsonFileHandler;
}

export {
Story,
InkList,
Compiler,
CompilerOptions,
PosixFileHandler,
JsonFileHandler,
};

declare let inkjs: Inkjs
export = inkjs
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "inkjs",
"version": "2.2.4",
"version": "2.2.5",
"description": "A javascript port of inkle's ink scripting language (http://www.inklestudios.com/ink/)",
"type": "commonjs",
"main": "dist/ink-full.js",
"types": "ink.d.ts",
"files": ["src/engine","src/compiler","ink.d.ts", "ink.d.mts","script/inkjs-compiler.ts", "dist"],
"files": ["engine","compiler","ink.d.ts", "ink.d.mts","script/inkjs-compiler.ts", "dist"],
"exports": {
".":{
"types": "./ink.d.mts",
Expand All @@ -19,17 +19,16 @@
}
},
"scripts": {
"test": "npm run test:typescript && npm run test:javascript",
"test": "npm run build && npm run test:typescript && npm run test:javascript",
"test:typescript": "jest",
"test:javascript": "npm run test:javascript:dist && npm run test:javascript:legacy",
"test:javascript": "npm run build && npm run test:javascript:dist && npm run test:javascript:legacy",
"test:javascript:dist": "INK_TEST=dist jest --config='jest.config.javascript.js'",
"test:javascript:legacy": "INK_TEST=legacy jest --config='jest.config.javascript.js'",
"test:compileFiles": "node src/tests/compile.js",
"build": "tsc -p ./ && rollup -c",
"lint": "eslint 'src/**/*.ts'",
"lint:fix": "npm run lint -- --fix",
"watch": "tsc -p ./ && rollup -c -w",
"prepare": "npm run build"
"watch": "tsc -p ./ && rollup -c -w"
},
"author": "Yannick Lohse",
"license": "MIT",
Expand Down
191 changes: 191 additions & 0 deletions templates/typescript_player/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions templates/typescript_player/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "ts-inkjs-test",
"type": "module",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "tsc --resolveJsonModule -p . && tsx src/index.ts"
},
"keywords": [],
"author": "Sebastian Hanlon",
"license": "ISC",
"devDependencies": {
"@types/node": "^20.14.2",
"tsx": "^4.15.2",
"typescript": "^5.4.5"
},
"dependencies": {
"inkjs": "^2.2.4"
}
}
8 changes: 8 additions & 0 deletions templates/typescript_player/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Story } from 'inkjs';
import intercept from "./story.json";

const s = new Story(intercept)

let text = s.Continue()

console.log(text)
1 change: 1 addition & 0 deletions templates/typescript_player/src/story.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions templates/typescript_player/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"lib": ["ES2022"],
"skipLibCheck": true,
"module": "NodeNext",
"target": "ESNext",
"moduleResolution": "Node16",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"types": ["node"],
"outDir": "dist",
"declaration": true,
"resolveJsonModule": true,

/* Linting */
"strict": true
},
"include": ["src"]
}
Loading

0 comments on commit 151ab8f

Please sign in to comment.