narraleaf-react 0.4.1 → 0.4.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.
@@ -37,6 +37,25 @@ export declare class Awaitable<T = any, U = T> {
37
37
  static nothing: ((value: any) => any);
38
38
  static resolve<T>(value: T): Awaitable<T>;
39
39
  static delay(ms: number): Awaitable<void>;
40
+ static create<T>(handler: (awaitable: Awaitable<T>) => T): Awaitable<T>;
41
+ /**
42
+ * Creates a new `Awaitable<void>` that resolves when the provided awaitable resolves.
43
+ *
44
+ * **Note**: this approach is _**radical**_! If this Awaitable is canceled, the Promise returned by this method will never be resolved.
45
+ *
46
+ * @param awaitable The awaitable to wait for
47
+ * @returns A new awaitable that resolves when the provided awaitable resolves
48
+ */
49
+ static wait(awaitable: Awaitable<void>): Awaitable<void>;
50
+ /**
51
+ * Creates a new `Awaitable<T>` that resolves with the first resolved value from multiple awaitables.
52
+ * All other awaitables will be cancelled when one resolves.
53
+ *
54
+ * @template T The type of the awaitables
55
+ * @param awaitables Array of awaitables to race
56
+ * @returns A new awaitable that resolves with the first resolved value
57
+ */
58
+ static race<T>(awaitables: Awaitable<T>[]): Awaitable<T>;
40
59
  /**
41
60
  * Creates a new `Awaitable<T>` that forwards resolution and cancellation from/to a source awaitable.
42
61
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narraleaf-react",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "A React visual novel player framework",
5
5
  "main": "./dist/main.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,55 +13,53 @@
13
13
  },
14
14
  "scripts": {
15
15
  "prebuild": "rimraf dist",
16
- "build": "webpack --config webpack.config.js",
17
- "build:prod": "rimraf dist && webpack --config webpack.config.js && tsc-alias -p tsconfig.json",
18
- "build:analyze": "rimraf dist && webpack --config webpack.config.js",
19
- "postbuild": "tsc-alias -p tsconfig.json",
16
+ "build": "cross-env NODE_ENV=production node esbuild.config.js",
17
+ "build:dev": "rimraf dist && cross-env NODE_ENV=development node esbuild.config.js && tsc --emitDeclarationOnly && tsc-alias -p tsconfig.json",
18
+ "postbuild": "tsc --emitDeclarationOnly && tsc-alias -p tsconfig.json",
20
19
  "lint": "eslint \"./src/**/*.{ts,tsx,js,jsx}\"",
21
20
  "lint:fix": "eslint --fix \"./src/**/*.{ts,tsx,js,jsx}\"",
22
- "publish": "npm run lint && rimraf dist && webpack --config webpack.config.js && tsc-alias -p tsconfig.json",
21
+ "prepublishOnly": "npm run lint && rimraf dist && cross-env NODE_ENV=production node esbuild.config.js && tsc --emitDeclarationOnly && tsc-alias -p tsconfig.json",
23
22
  "typedoc": "typedoc src/index.ts --out doc",
24
23
  "prepare": "husky"
25
24
  },
26
25
  "devDependencies": {
27
- "@babel/core": "^7.25.2",
28
- "@babel/preset-env": "^7.25.4",
29
- "@babel/preset-react": "^7.24.7",
30
- "@babel/preset-typescript": "^7.14.5",
31
26
  "@eslint/eslintrc": "^3.1.0",
32
27
  "@eslint/js": "^9.10.0",
28
+ "@tailwindcss/postcss": "^4.1.5",
29
+ "@tailwindcss/postcss7-compat": "^2.2.17",
33
30
  "@types/howler": "^2.2.11",
34
31
  "@types/lodash": "^4.17.7",
32
+ "@types/node": "^22.15.3",
35
33
  "@types/react": ">=19",
36
34
  "@types/react-dom": ">=19",
37
35
  "@typescript-eslint/eslint-plugin": "^8.5.0",
38
36
  "@typescript-eslint/parser": "^8.5.0",
39
- "autoprefixer": "^10.4.20",
40
- "babel-loader": "^8.3.0",
41
- "css-loader": "^7.1.2",
37
+ "autoprefixer": "^10.4.21",
38
+ "cross-env": "^7.0.3",
39
+ "cssnano": "^7.0.6",
40
+ "esbuild": "^0.25.3",
41
+ "esbuild-css-modules-plugin": "^3.1.4",
42
+ "esbuild-plugin-alias": "^0.2.1",
43
+ "esbuild-plugin-postcss2": "^0.1.2",
44
+ "esbuild-postcss": "^0.0.4",
42
45
  "eslint": "^9.10.0",
43
46
  "eslint-plugin-react": "^7.35.2",
44
47
  "globals": "^15.9.0",
45
48
  "husky": "^9.1.6",
46
49
  "jest": "^27.0.6",
47
50
  "motion": "^11.15.0",
51
+ "postcss": "^8.5.3",
52
+ "postcss-cli": "^11.0.1",
53
+ "postcss-import": "^16.1.0",
48
54
  "postcss-loader": "^8.1.1",
55
+ "postcss-preset-env": "^10.1.6",
49
56
  "react": "^19.0.0",
50
57
  "react-dom": "^19.0.0",
51
58
  "rimraf": "^6.0.1",
52
- "style-loader": "^4.0.0",
53
- "tailwindcss": "^3.4.11",
54
- "terser-webpack-plugin": "^5.3.10",
55
- "ts-loader": "^9.5.1",
59
+ "tailwindcss": "^4.1.5",
56
60
  "tsc-alias": "^1.8.10",
57
- "tsconfig-paths": "^4.2.0",
58
- "tsconfig-paths-webpack-plugin": "^4.1.0",
59
61
  "typedoc": "^0.26.7",
60
- "typescript": "^4.9.5",
61
- "webpack": "^5.94.0",
62
- "webpack-bundle-analyzer": "^4.10.2",
63
- "webpack-cli": "^4.10.0",
64
- "webpack-dev-server": "^5.1.0"
62
+ "typescript": "^4.9.5"
65
63
  },
66
64
  "peerDependencies": {
67
65
  "@emotion/is-prop-valid": "*",
@@ -75,10 +73,14 @@
75
73
  },
76
74
  "react-dom": {
77
75
  "optional": false
76
+ },
77
+ "motion": {
78
+ "optional": false
78
79
  }
79
80
  },
80
81
  "files": [
81
- "dist"
82
+ "dist",
83
+ "!dist/**/*.map"
82
84
  ],
83
85
  "keywords": [
84
86
  "react",