create-pixi-vn 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-pixi-vn",
3
3
  "description": "Create a new Pixi’VN project",
4
- "version": "1.2.1",
4
+ "version": "1.2.3",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0",
7
7
  "author": "DRincs-Productions",
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "files": [
13
13
  "index.js",
14
+ "template-game-engine",
14
15
  "template-react-vite-muijoy",
15
16
  "template-react-vite-muijoy-ink",
16
17
  "template-react-vite-muijoy-ink-tauri",
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: { browser: true, es2020: true },
4
+ extends: [
5
+ 'eslint:recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ ],
8
+ ignorePatterns: ['dist', '.eslintrc.cjs'],
9
+ parser: '@typescript-eslint/parser',
10
+ "prefer-const": ["error", {
11
+ "destructuring": "all",
12
+ "ignoreReadBeforeAssign": true
13
+ }],
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "recommendations": [
3
+ "ms-vscode.vscode-typescript-next",
4
+ "dbaeumer.vscode-eslint",
5
+ "esbenp.prettier-vscode",
6
+ "vitest.explorer"
7
+ ]
8
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ // bash: https://docs.microsoft.com/it-it/windows/dev-environment/javascript/nodejs-on-wsl
6
+ "version": "0.2.0",
7
+ "configurations": [
8
+ {
9
+ "type": "node",
10
+ "request": "launch",
11
+ "name": "Debug Current Test File",
12
+ "autoAttachChildProcesses": true,
13
+ "skipFiles": ["<node_internals>/**", "**/node_modules/**"],
14
+ "program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
15
+ "args": ["run", "${relativeFile}"],
16
+ "smartStep": true,
17
+ "console": "integratedTerminal"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ // Formatter
3
+ "[typescript]": {
4
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
5
+ "editor.formatOnSave": true
6
+ },
7
+ "[javascript]": {
8
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
9
+ "editor.formatOnSave": true
10
+ },
11
+ "prettier.jsxSingleQuote": true,
12
+ "prettier.printWidth": 120,
13
+ "prettier.useTabs": false,
14
+ "prettier.singleAttributePerLine": false,
15
+ "prettier.tabWidth": 4,
16
+ // reorganise imports
17
+ "editor.codeActionsOnSave": {
18
+ "source.organizeImports": "explicit"
19
+ },
20
+ // references
21
+ "javascript.referencesCodeLens.enabled": true,
22
+ "javascript.referencesCodeLens.showOnAllFunctions": true,
23
+ "typescript.referencesCodeLens.enabled": true,
24
+ "typescript.referencesCodeLens.showOnAllFunctions": true,
25
+ // move file
26
+ "javascript.updateImportsOnFileMove.enabled": "always",
27
+ "typescript.updateImportsOnFileMove.enabled": "always",
28
+ // debug
29
+ "terminal.integrated.defaultProfile.linux": "JavaScript Debug Terminal",
30
+ "terminal.integrated.defaultProfile.windows": "JavaScript Debug Terminal",
31
+ "terminal.integrated.defaultProfile.osx": "JavaScript Debug Terminal",
32
+ // olther
33
+ "extensions.ignoreRecommendations": false,
34
+ "git.fetchOnPull": true
35
+ }
@@ -0,0 +1,30 @@
1
+ # Game Engine
2
+
3
+ Game Engine created with TypeScript and Pixi’VN.
4
+
5
+ ## How build it
6
+
7
+ 1. Install dependencies with `npm install` or `yarn install`
8
+ 2. Build the project with `npm run build` or `yarn build`
9
+
10
+ ## How push it to NPM
11
+
12
+ Prerequisites:
13
+
14
+ - NPM account: <https://www.npmjs.com/signup>
15
+ - NPM login: `npm login`
16
+
17
+ 1. [Build the project](#how-build-it)
18
+ 2. (Optional) Edit the version in `package.json` (e.g., `1.0.0` to `1.0.1`)
19
+ 3. Publish the project with `npm publish` or `yarn publish`
20
+
21
+ ### How to publish with GitHub Actions
22
+
23
+ Prerequisites:
24
+
25
+ - Create a NPM token
26
+ - Create a GitHub secret with the name `NPM_TOKEN` and the value of your NPM token
27
+
28
+ 1. Edit the version in `package.json` (e.g., `1.0.0` to `1.0.1`)
29
+ 2. (Optional) Create a new tag that starts with `v` (e.g., `v1.0.1`)
30
+ 3. Push the tag to GitHub with `git push origin v1.0.1`
@@ -0,0 +1,54 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ push:
8
+ tags:
9
+ - 'v*'
10
+
11
+ run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}
12
+
13
+ jobs:
14
+ build:
15
+ name: Build
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ - uses: actions/setup-node@v3
20
+ with:
21
+ node-version: 20
22
+ - run: npm i
23
+ - run: npm ci
24
+ - run: npm test
25
+
26
+ publish-npm:
27
+ name: Publish to NPM
28
+ needs: build
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v3
32
+ - uses: actions/setup-node@v3
33
+ with:
34
+ node-version: 20
35
+ registry-url: https://registry.npmjs.org/
36
+ - run: |
37
+ npm i
38
+ npm ci
39
+ npm run build
40
+ - run: npm publish -f
41
+ env:
42
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
43
+
44
+ create-release:
45
+ name: Create Release
46
+ needs: publish-npm
47
+ runs-on: ubuntu-latest
48
+ permissions:
49
+ contents: write
50
+ steps:
51
+ - uses: actions/checkout@v3
52
+ - uses: ncipollo/release-action@v1
53
+ with:
54
+ body: "Release ${{ github.ref }}"
@@ -0,0 +1,23 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .idea
17
+ .DS_Store
18
+ *.suo
19
+ *.ntvs*
20
+ *.njsproj
21
+ *.sln
22
+ *.sw?
23
+ package-lock.json
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "my-app-package-name",
3
+ "description": "my-app-description",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsup",
14
+ "test": "vitest"
15
+ },
16
+ "dependencies": {
17
+ "@pixi/devtools": "^2.0.1",
18
+ "@pixi/sound": "^6.0.1",
19
+ "pixi.js": "^8.9.1"
20
+ },
21
+ "devDependencies": {
22
+ "@drincs/pixi-vn": "^1.0.2",
23
+ "@types/crypto-js": "^4.2.2",
24
+ "crypto-js": "^4.2.0",
25
+ "ts-node": "^10.9.2",
26
+ "tsup": "^8.4.0",
27
+ "typescript": "^5.8.3",
28
+ "vitest": "^3.1.1"
29
+ },
30
+ "keywords": [
31
+ "engine",
32
+ "game",
33
+ "game-engine",
34
+ "pixi-vn"
35
+ ]
36
+ }
@@ -0,0 +1,46 @@
1
+ import { LabelAbstract, LabelProps, StepLabelType } from "@drincs/pixi-vn";
2
+ import sha1 from "crypto-js/sha1";
3
+
4
+ export default class Label<T extends {} = {}> extends LabelAbstract<Label<T>, T> {
5
+ public get stepCount(): number {
6
+ return this.steps.length;
7
+ }
8
+ public getStepById(stepId: number): StepLabelType<T> | undefined {
9
+ return this.steps[stepId];
10
+ }
11
+ /**
12
+ * @param id is the id of the label
13
+ * @param steps is the list of steps that the label will perform
14
+ * @param props is the properties of the label
15
+ */
16
+ constructor(id: string, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), props?: LabelProps<Label<T>>) {
17
+ super(id, props);
18
+ this._steps = steps;
19
+ }
20
+
21
+ private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[]);
22
+ /**
23
+ * Get the steps of the label.
24
+ */
25
+ public get steps(): StepLabelType<T>[] {
26
+ if (typeof this._steps === "function") {
27
+ return this._steps();
28
+ }
29
+ return this._steps;
30
+ }
31
+
32
+ public getStepSha(index: number): string {
33
+ if (index < 0 || index >= this.steps.length) {
34
+ console.warn("stepSha not found, setting to ERROR");
35
+ return "error";
36
+ }
37
+ try {
38
+ let step = this.steps[index];
39
+ let sha1String = sha1(step.toString().toLocaleLowerCase());
40
+ return sha1String.toString();
41
+ } catch (e) {
42
+ console.warn("stepSha not found, setting to ERROR", e);
43
+ return "error";
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,151 @@
1
+ import PIXIVN, {
2
+ canvas,
3
+ CanvasManagerStatic,
4
+ GameUnifier,
5
+ HistoryManagerStatic,
6
+ narration,
7
+ NarrationManagerStatic,
8
+ sound,
9
+ stepHistory,
10
+ storage,
11
+ StorageManagerStatic,
12
+ } from "@drincs/pixi-vn";
13
+ import { Devtools } from "@pixi/devtools";
14
+ import { ApplicationOptions } from "pixi.js";
15
+ import { version as ENGINE_VERSION } from "../package.json";
16
+ import { GameState } from "./interfaces";
17
+ import { getGamePath } from "./utils/path-utility";
18
+ export { version as ENGINE_VERSION } from "../package.json";
19
+ export * from "./interfaces";
20
+ export * from "./utils";
21
+
22
+ export namespace Game {
23
+ /**
24
+ * Initialize the Game and PixiJS Application and the interface div.
25
+ * This method should be called before any other method.
26
+ * @param element The html element where I will put the canvas. Example: document.body
27
+ * @param width The width of the canvas
28
+ * @param height The height of the canvas
29
+ * @param options The options of PixiJS Application
30
+ * @param devtoolsOptions The options of the devtools. You can read more about it in the [PixiJS Devtools documentation](https://pixijs.io/devtools/docs/plugin/)
31
+ * @example
32
+ * ```typescript
33
+ * const body = document.body
34
+ * if (!body) {
35
+ * throw new Error('body element not found')
36
+ * }
37
+ * await Game.initialize(body, {
38
+ * width: 1920,
39
+ * height: 1080,
40
+ * backgroundColor: "#303030"
41
+ * })
42
+ * ```
43
+ */
44
+ export async function initialize(
45
+ element: HTMLElement,
46
+ options: Partial<ApplicationOptions> & { width: number; height: number },
47
+ devtoolsOptions?: Devtools
48
+ ) {
49
+ GameUnifier.init({
50
+ getCurrentGameStepState: () => {
51
+ return {
52
+ path: getGamePath(),
53
+ storage: storage.export(),
54
+ canvas: canvas.export(),
55
+ sound: sound.export(),
56
+ labelIndex: NarrationManagerStatic.currentLabelStepIndex || 0,
57
+ openedLabels: narration.openedLabels,
58
+ };
59
+ },
60
+ restoreGameStepState: async (state, navigate) => {
61
+ HistoryManagerStatic._originalStepData = state;
62
+ NarrationManagerStatic._openedLabels = state.openedLabels;
63
+ storage.restore(state.storage);
64
+ await canvas.restore(state.canvas);
65
+ sound.restore(state.sound);
66
+ navigate(state.path);
67
+ },
68
+ // narration
69
+ getStepCounter: () => narration.stepCounter,
70
+ setStepCounter: (value) => {
71
+ NarrationManagerStatic._stepCounter = value;
72
+ },
73
+ getOpenedLabels: () => narration.openedLabels.length,
74
+ addHistoryItem: (historyInfo, opstions) => {
75
+ return stepHistory.add(historyInfo, opstions);
76
+ },
77
+ getCurrentStepsRunningNumber: () => NarrationManagerStatic.stepsRunning,
78
+ // canvas
79
+ onGoNextEnd: async () => {
80
+ CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds.forEach(({ id }) => {
81
+ canvas.forceCompletionOfTicker(id);
82
+ });
83
+ CanvasManagerStatic._tickersToCompleteOnStepEnd.stepAlias.forEach(({ alias, id }) => {
84
+ canvas.forceCompletionOfTicker(id, alias);
85
+ });
86
+ CanvasManagerStatic._tickersToCompleteOnStepEnd = { tikersIds: [], stepAlias: [] };
87
+ },
88
+ // storage
89
+ getVariable: (key) => storage.getVariable(key),
90
+ setVariable: (key, value) => storage.setVariable(key, value),
91
+ removeVariable: (key) => storage.removeVariable(key),
92
+ getFlag: (key) => storage.getFlag(key),
93
+ setFlag: (name, value) => storage.setFlag(name, value),
94
+ onLabelClosing: (openedLabelsNumber) => StorageManagerStatic.clearOldTempVariables(openedLabelsNumber),
95
+ });
96
+ return await canvas.init(element, options, devtoolsOptions);
97
+ }
98
+
99
+ /**
100
+ * Clear all game data. This function is used to reset the game.
101
+ */
102
+ export function clear() {
103
+ storage.clear();
104
+ canvas.clear();
105
+ sound.clear();
106
+ narration.clear();
107
+ stepHistory.clear();
108
+ }
109
+
110
+ /**
111
+ * Get all the game data. It can be used to save the game.
112
+ * @returns The game data
113
+ */
114
+ export function exportGameState(): GameState {
115
+ return {
116
+ engine_version: ENGINE_VERSION,
117
+ stepData: narration.export(),
118
+ storageData: storage.export(),
119
+ canvasData: canvas.export(),
120
+ soundData: sound.export(),
121
+ historyData: stepHistory.export(),
122
+ path: getGamePath(),
123
+ };
124
+ }
125
+
126
+ /**
127
+ * Load the save data
128
+ * @param data The save data
129
+ * @param navigate The function to navigate to a path
130
+ */
131
+ export async function restoreGameState(data: GameState, navigate: (path: string) => void) {
132
+ stepHistory.restore(data.historyData);
133
+ await narration.restore(data.stepData, HistoryManagerStatic.lastHistoryStep);
134
+ storage.restore(data.storageData);
135
+ await canvas.restore(data.canvasData);
136
+ sound.restore(data.soundData);
137
+ navigate(data.path);
138
+ }
139
+
140
+ /**
141
+ * Convert a JSON string to a save data
142
+ * @param json The JSON string
143
+ * @returns The save data
144
+ */
145
+ export function jsonToGameState(json: string): GameState {
146
+ return JSON.parse(json);
147
+ }
148
+ }
149
+
150
+ export { Container, ImageContainer, ImageSprite, Sprite, Text, VideoSprite } from "@drincs/pixi-vn";
151
+ export { canvas, GameUnifier, narration, PIXIVN, sound, stepHistory, storage };
@@ -0,0 +1,17 @@
1
+ import {
2
+ CanvasGameState,
3
+ HistoryGameState,
4
+ NarrationGameState,
5
+ SoundGameState,
6
+ StorageGameState,
7
+ } from "@drincs/pixi-vn";
8
+
9
+ export default interface GameState {
10
+ engine_version: string;
11
+ stepData: NarrationGameState;
12
+ storageData: StorageGameState;
13
+ canvasData: CanvasGameState;
14
+ soundData: SoundGameState;
15
+ historyData: HistoryGameState;
16
+ path: string;
17
+ }
@@ -0,0 +1 @@
1
+ export type { default as GameState } from "./GameState";
@@ -0,0 +1 @@
1
+ export type { newLabel } from "./label";
@@ -0,0 +1,23 @@
1
+ import { LabelProps, RegisteredLabels, StepLabelType } from "@drincs/pixi-vn";
2
+ import Label from "../classes/Label";
3
+
4
+ /**
5
+ * Creates a new label and registers it in the system.
6
+ * **This function must be called at least once at system startup to register the label, otherwise the system cannot be used.**
7
+ * @param id The id of the label, it must be unique
8
+ * @param steps The steps of the label
9
+ * @param props The properties of the label
10
+ * @returns The created label
11
+ */
12
+ export function newLabel<T extends {} = {}>(
13
+ id: string,
14
+ steps: StepLabelType<T>[] | (() => StepLabelType<T>[]),
15
+ props?: Omit<LabelProps<Label<T>>, "choiseIndex">
16
+ ): Label<T> {
17
+ if (RegisteredLabels.get(id)) {
18
+ console.info(`Label ${id} already exists, it will be overwritten`);
19
+ }
20
+ let label = new Label<T>(id, steps, props);
21
+ RegisteredLabels.add(label);
22
+ return label;
23
+ }
@@ -0,0 +1,7 @@
1
+ export function getGamePath(): string {
2
+ let path = window.location.pathname + window.location.hash
3
+ if (path.includes('#')) {
4
+ path = path.split('#')[1]
5
+ }
6
+ return path
7
+ }
@@ -0,0 +1,3 @@
1
+ import { test } from "vitest";
2
+
3
+ test("setup", async () => {});
@@ -0,0 +1,109 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "commonjs", /* Specify what module code is generated. */
29
+ // "rootDir": "./", /* Specify the root folder within your source files. */
30
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
+ "resolveJsonModule": true, /* Enable importing .json files. */
43
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
+
46
+ /* JavaScript Support */
47
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
+
51
+ /* Emit */
52
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
+ "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
+ "outDir": "dist", /* Specify an output folder for all emitted files. */
59
+ // "removeComments": true, /* Disable emitting comments. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
69
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
+
76
+ /* Interop Constraints */
77
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
79
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
81
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
83
+
84
+ /* Type Checking */
85
+ "strict": true, /* Enable all strict type-checking options. */
86
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
+
105
+ /* Completeness */
106
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
+ }
109
+ }
@@ -0,0 +1,17 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ // https://dev.to/orabazu/how-to-bundle-a-tree-shakable-typescript-library-with-tsup-and-publish-with-npm-3c46
4
+ export default defineConfig({
5
+ entry: ["src/**/*.ts"],
6
+ format: ["cjs", "esm"], // Build for commonJS and ESmodules
7
+ dts: true, // Generate declaration file (.d.ts)
8
+ treeshake: true,
9
+ splitting: false,
10
+ // sourcemap: true, // Generate sourcemap, it was removed because otherwise it would explode
11
+ clean: true,
12
+ minify: true,
13
+ bundle: true,
14
+ skipNodeModulesBundle: false, // Skip bundling of node_modules
15
+ entryPoints: ["src/index.ts"],
16
+ noExternal: ["@drincs/pixi-vn", "pixi.js", "@pixi/sound", "@pixi/devtools"],
17
+ });
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "jsdom",
6
+ setupFiles: ["./tests/setup.test.ts"],
7
+ },
8
+ });
@@ -11,7 +11,7 @@
11
11
  "preview": "vite preview"
12
12
  },
13
13
  "dependencies": {
14
- "@drincs/pixi-vn": "^1.0.1",
14
+ "@drincs/pixi-vn": "^1.0.2",
15
15
  "@emotion/react": "^11.14.0",
16
16
  "@emotion/styled": "^11.14.0",
17
17
  "@mui/icons-material": "^7.0.2",
@@ -11,7 +11,7 @@
11
11
  "preview": "vite preview"
12
12
  },
13
13
  "dependencies": {
14
- "@drincs/pixi-vn": "^1.0.1",
14
+ "@drincs/pixi-vn": "^1.0.2",
15
15
  "@drincs/pixi-vn-ink": "^0.6.0",
16
16
  "@emotion/react": "^11.14.0",
17
17
  "@emotion/styled": "^11.14.0",
@@ -12,7 +12,7 @@
12
12
  "tauri": "tauri"
13
13
  },
14
14
  "dependencies": {
15
- "@drincs/pixi-vn": "^1.0.1",
15
+ "@drincs/pixi-vn": "^1.0.2",
16
16
  "@drincs/pixi-vn-ink": "^0.6.0",
17
17
  "@emotion/react": "^11.14.0",
18
18
  "@emotion/styled": "^11.14.0",
@@ -12,7 +12,7 @@
12
12
  "tauri": "tauri"
13
13
  },
14
14
  "dependencies": {
15
- "@drincs/pixi-vn": "^1.0.1",
15
+ "@drincs/pixi-vn": "^1.0.2",
16
16
  "@emotion/react": "^11.14.0",
17
17
  "@emotion/styled": "^11.14.0",
18
18
  "@mui/icons-material": "^7.0.2",