Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.2.5 #1072

Merged
merged 24 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f3268bb
Remove deprecated TSLint dev dependency
maetl Apr 5, 2024
2d96541
Upgrade build toolchain to TypeScript 5
maetl Apr 6, 2024
1aa62ee
Make enum type more explicit when used in numeric expressions
maetl Apr 6, 2024
5d94165
Explicitly reference the object static properties are declared on
maetl Apr 6, 2024
46a8d0b
Enable TypeScript to recognise when superclass methods are being called
maetl Apr 6, 2024
05a3af6
Can’t set value to `0` if zeroth index doesn’t exist in the enum type
maetl Apr 6, 2024
ec73f77
TypeScript seems to want this to be explicitly declared
maetl Apr 6, 2024
f72fcca
Replace legacy Jasmine dependency in tests with Jest builtin
maetl Apr 6, 2024
7e9a208
Rebuilding package-lock.json to attempt to fix NPM bug in build
maetl Apr 6, 2024
a8f2b5c
Move Lint workflow step to end of job
maetl Apr 6, 2024
59d1cd5
Remove vestiges of deprecated TSLint
maetl Apr 6, 2024
a632f78
Add .prettierrc.json to set `trailingComma: es5`
maetl Apr 6, 2024
799d61e
tentative fix
smwhr Jul 31, 2024
ab4e463
Merge branch 'master' into jz/better-typings
smwhr Jul 31, 2024
151ab8f
seems to be working with all projects
smwhr Jul 31, 2024
bdfb828
cleanup
smwhr Jul 31, 2024
bf18ad0
some changes
smwhr Aug 2, 2024
c010453
Merge branch 'upgrade/ts-5.0' into typescript-upgrade
smwhr Aug 2, 2024
1c055a7
Merge pull request #1053 from maetl/typescript-upgrade
smwhr Aug 2, 2024
926a6ab
Looks like everything is now working fine
smwhr Aug 2, 2024
ad9c183
auto lint fix
smwhr Aug 3, 2024
7eaacc9
link InkParser.ts
smwhr Aug 3, 2024
16c2fbd
update eslintrules + obvious mistakes
smwhr Aug 3, 2024
b5dd123
Merge pull request #1076 from y-lohse/update/2.2.5
smwhr Aug 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 37 additions & 36 deletions ink.d.mts
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
import { Story, InkList } from './engine/Story'
import { Compiler } from './compiler/Compiler'
import { CompilerOptions } from './compiler/CompilerOptions'
import { PosixFileHandler } from './compiler/FileHandler/PosixFileHandler'
import { JsonFileHandler } from './compiler/FileHandler/JsonFileHandler'
import { Story, InkList } from "./engine/Story";
import { Compiler } from "./compiler/Compiler";
import { CompilerOptions } from "./compiler/CompilerOptions";
import { PosixFileHandler } from "./compiler/FileHandler/PosixFileHandler";
import { JsonFileHandler } from "./compiler/FileHandler/JsonFileHandler";

declare interface Inkjs {
/**
* A Story is the core class that represents a complete Ink narrative, and
* manages runtime evaluation and state.
*/
Story: typeof Story
/**
* The underlying type for a list item in Ink.
*/
InkList: typeof InkList

/**
* Compiles Ink stories from source.
*/
Compiler: typeof Compiler

/**
* Metadata options for a compiler pass.
*/
CompilerOptions: typeof CompilerOptions

/**
* Resolves and loads Ink sources from a POSIX filesystem.
*/
PosixFileHandler: typeof PosixFileHandler

/**
* Resolves and loads Ink sources from a JSON hierarchy.
*/
JsonFileHandler: typeof JsonFileHandler
/**
* A Story is the core class that represents a complete Ink narrative, and
* manages runtime evaluation and state.
*/
Story: typeof Story;

/**
* The underlying type for a list item in Ink.
*/
InkList: typeof InkList;

/**
* Compiles Ink stories from source.
*/
Compiler: typeof Compiler;

/**
* Metadata options for a compiler pass.
*/
CompilerOptions: typeof CompilerOptions;

/**
* Resolves and loads Ink sources from a POSIX filesystem.
*/
PosixFileHandler: typeof PosixFileHandler;

/**
* Resolves and loads Ink sources from a JSON hierarchy.
*/
JsonFileHandler: typeof JsonFileHandler;
}


declare let inkjs: Inkjs
export default inkjs
export = inkjs
41 changes: 0 additions & 41 deletions ink.d.ts

This file was deleted.

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"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mistakenly exported the source files instead of the built files, sorry about that !

"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"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepare was triggered all the time, I suggest we just be redondant in the run test steps.

"watch": "tsc -p ./ && rollup -c -w"
},
"author": "Yannick Lohse",
"license": "MIT",
Expand Down
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-player",
"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": "*"
}
}
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"]
}
21 changes: 21 additions & 0 deletions templates/typescript_with_compiler/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "ts-inkjs-with-compiler",
"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": "*"
}
}
17 changes: 17 additions & 0 deletions templates/typescript_with_compiler/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Compiler } from 'inkjs/full';

const inkStory = `
Once upon a time...

* There were two choices.
* There were four lines of content.

- They lived happily ever after.
-> END
`

const s = new Compiler(inkStory).Compile()

let text = s.Continue()

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

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions templates/typescript_with_compiler/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