Skip to content

Release 2.2.5#1072

Merged
smwhr merged 24 commits into
masterfrom
jz/better-typings
Aug 3, 2024
Merged

Release 2.2.5#1072
smwhr merged 24 commits into
masterfrom
jz/better-typings

Conversation

@smwhr
Copy link
Copy Markdown
Collaborator

@smwhr smwhr commented Jul 31, 2024

Checklist

  • The new code additions passed the tests (npm test).
  • The linter ran and found no issues (npm run-script lint).

Description

Tries to fix issues raised on github and Discord :

Fixes imports :
from 'inkjs' or require('inkjs'): Story and Inklist
from 'inkjs/full' or require('inkjs/full') : same as above + Compiler and co for javascript
from 'inkjs/types' : same as above but typed for typescript (pain to use in pure JS for reasons)
from 'inkjs/compiler/Deeply/Nested/Thing' : works again

Also :

  • updated documentation
  • merged upgrade to TS5.0 by @maetl
  • put the inkjs-compiler script in bin to be executed
  • upgraded the ink.js files in the browser templates to test if I didn't break anything
  • added more varied way of importing in the typescript templates also

maetl and others added 15 commits April 6, 2024 11:07
Incorporates various changes to package dependencies, Rollup and TS
config in order to bump up the main TypeScript version to 5.4.4
Fixes `super` lookups that weren’t able to be resolved due to TypeScript
not recognising the context in arrow functions declared as properties
on the class or constructor.

See: https://github.com/basarat/typescript-book/blob/master/docs/arrow-functions.md#tip-arrow-functions-and-inheritance
Might be a good idea to generalise this record type for reuse throughout
this module rather than declaring everything repeatedly inline.
The global `jasmine` API has been removed from Jest with the new test
runner `jest-circus` introduced in v27–v29. While possible to import the
legacy Jasmine package, it seemed to be more robust to upgrade to the
`jest.fn` API which behaves exactly the same as `jasmine.createSpy`.

The main difference is the `callThrough()` method in Jasmine spies. This
behaviour is the default for `jest.fn()`, so the upgrade works as-is.
This prevents the linter from blowing up with hundreds of notices about
trailing commas in multi-line function arg lists that don’t match the
style of the codebase.
@smwhr smwhr changed the title Fixe 2.2.4 importing errors Fix 2.2.4 importing errors Jul 31, 2024
Comment thread ink.d.mts Outdated
Comment thread ink.d.mts Outdated
Comment thread package.json Outdated
"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
Copy Markdown
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 !

Comment thread ink.d.ts
Comment thread package.json
"lint": "eslint 'src/**/*.ts'",
"lint:fix": "npm run lint -- --fix",
"watch": "tsc -p ./ && rollup -c -w",
"prepare": "npm run build"
Copy link
Copy Markdown
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.

Comment thread templates/typescript_player/src/story.json
@smwhr smwhr changed the title Fix 2.2.4 importing errors Release 2.2.5 Aug 3, 2024
@smwhr smwhr merged commit d39664b into master Aug 3, 2024
@smwhr smwhr deleted the jz/better-typings branch August 3, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants