@awayfl/awayfl-player 0.2.35 → 0.2.36

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.
Files changed (39) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +37 -1
  3. package/awayfl.config.js +85 -85
  4. package/builtins/playerglobal.json +2752 -2752
  5. package/builtins/playerglobal_new.json +4169 -4169
  6. package/bundle/awayfl-player.umd.js +161 -30
  7. package/bundle/awayfl-player.umd.js.gz +0 -0
  8. package/bundle/awayfl-player.umd.js.map +1 -1
  9. package/dist/index.d.ts +8 -8
  10. package/dist/index.js +9 -9
  11. package/dist/lib/AVM1Player.d.ts +4 -4
  12. package/dist/lib/AVM1Player.js +13 -13
  13. package/dist/lib/AVM2Player.d.ts +4 -4
  14. package/dist/lib/AVM2Player.js +14 -14
  15. package/dist/lib/AVMDebugInterface.d.ts +21 -21
  16. package/dist/lib/AVMDebugInterface.js +279 -279
  17. package/dist/lib/AVMPlayer.d.ts +6 -6
  18. package/dist/lib/AVMPlayer.js +27 -27
  19. package/dist/src/Main.d.ts +1 -1
  20. package/dist/src/Main.js +19 -19
  21. package/index.ts +9 -9
  22. package/lib/AVM1Player.ts +9 -9
  23. package/lib/AVM2Player.ts +12 -12
  24. package/lib/AVMDebugInterface.ts +345 -345
  25. package/lib/AVMPlayer.ts +29 -29
  26. package/package.json +97 -100
  27. package/rollup.config.js +30 -30
  28. package/{copyVersionToIndex.js → scripts/copyVersionToIndex.js} +33 -33
  29. package/scripts/initAwayDev_mac.sh +177 -177
  30. package/scripts/initAwayDev_mac_pnpm.sh +177 -177
  31. package/scripts/initAwayDev_win.bat +198 -198
  32. package/scripts/unlinkAwayDev_mac.sh +140 -140
  33. package/scripts/unlinkAwayDev_mac_pnpm.sh +140 -140
  34. package/scripts/unlinkAwayDev_win.bat +140 -140
  35. package/scripts/updateAwayDev_mac.sh +90 -90
  36. package/scripts/updateAwayDev_win.bat +69 -69
  37. package/scripts/updateAway_any.bat +73 -73
  38. package/tsconfig.json +12 -12
  39. package/webpack.config.js +450 -450
package/lib/AVMPlayer.ts CHANGED
@@ -1,29 +1,29 @@
1
- import { AVMStage, AVMEvent, AVMVERSION, release } from "@awayfl/swf-loader";
2
- import { AVMDebug } from "./AVMDebugInterface";
3
-
4
- import { AVM1Handler } from '@awayfl/avm1';
5
- import { AVM2Handler } from '@awayfl/avm2';
6
- import { PlayerGlobal } from "@awayfl/playerglobal";
7
-
8
-
9
- export class AVMPlayer extends AVMStage {
10
- private _debug: AVMDebug;
11
- constructor(gameConfig) {
12
- super(gameConfig);
13
- this.registerAVMStageHandler(new AVM1Handler());
14
- this.registerAVMStageHandler(new AVM2Handler(new PlayerGlobal()));
15
- this.addEventListener(AVMEvent.AVM_COMPLETE, (event: AVMEvent) => this.onAVMAvailable(event));
16
-
17
- // export player api
18
- //if(!release) {
19
- this._debug = new AVMDebug(this);
20
- //}
21
- }
22
-
23
- protected onAVMAvailable(event: AVMEvent) {
24
- if(this._debug) {
25
- this._debug.onAvmInit(event.avmVersion === AVMVERSION.AVM1 ? 1 : 2);
26
- }
27
- }
28
- }
29
-
1
+ import { AVMStage, AVMEvent, AVMVERSION, release } from "@awayfl/swf-loader";
2
+ import { AVMDebug } from "./AVMDebugInterface";
3
+
4
+ import { AVM1Handler } from '@awayfl/avm1';
5
+ import { AVM2Handler } from '@awayfl/avm2';
6
+ import { PlayerGlobal } from "@awayfl/playerglobal";
7
+
8
+
9
+ export class AVMPlayer extends AVMStage {
10
+ private _debug: AVMDebug;
11
+ constructor(gameConfig) {
12
+ super(gameConfig);
13
+ this.registerAVMStageHandler(new AVM1Handler());
14
+ this.registerAVMStageHandler(new AVM2Handler(new PlayerGlobal()));
15
+ this.addEventListener(AVMEvent.AVM_COMPLETE, (event: AVMEvent) => this.onAVMAvailable(event));
16
+
17
+ // export player api
18
+ //if(!release) {
19
+ this._debug = new AVMDebug(this);
20
+ //}
21
+ }
22
+
23
+ protected onAVMAvailable(event: AVMEvent) {
24
+ if(this._debug) {
25
+ this._debug.onAvmInit(event.avmVersion === AVMVERSION.AVM1 ? 1 : 2);
26
+ }
27
+ }
28
+ }
29
+
package/package.json CHANGED
@@ -1,100 +1,97 @@
1
- {
2
- "name": "@awayfl/awayfl-player",
3
- "version": "0.2.35",
4
- "description": "Flash Player emulator for executing SWF files (published for FP versions 6 and up) in javascript",
5
- "main": "bundle/awayfl-player.umd.js",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "url": "http://www.away3d.com",
9
- "author": "Rob Bateman",
10
- "scripts": {
11
- "rimraf": "rimraf",
12
- "rollup": "rollup -c",
13
- "tsc": "tsc",
14
- "tsc:build": "npm run tsc || exit 0",
15
- "webpack": "webpack",
16
- "clean": "npm cache clean && npm run rimraf -- node_modules bin",
17
- "clean:bin": "npm run rimraf -- bin",
18
- "preclean:install": "npm run clean",
19
- "clean:install": "npm set progress=false && npm install",
20
- "preclean:start": "npm run clean",
21
- "clean:start": "npm start",
22
- "watch": "npm run watch:dev",
23
- "watch:dev": "npm run build:dev -- --watch",
24
- "watch:dev:hmr": "npm run watch:dev -- --hot",
25
- "watch:test": "npm run test -- --auto-watch --no-single-run",
26
- "watch:prod": "npm run build:prod -- --watch",
27
- "build": "npm run build:dev",
28
- "prebuild:dev": "npm run clean:bin",
29
- "build:dev": "webpack --config webpack.config.js --progress",
30
- "prebuild:prod": "npm run clean:bin",
31
- "build:prod": "webpack --config webpack.config.js --progress --env.prod",
32
- "server": "npm run server:dev",
33
- "server:dev": "webpack-dev-server --config webpack.config.js --progress",
34
- "server:dev:hmr": "npm run server:dev -- --hot",
35
- "server:prod": "http-server bin --cors",
36
- "start": "npm run server:dev",
37
- "start:hmr": "npm run server:dev:hmr",
38
- "yarnImport": "npm run rimraf -- yarn.lock && yarn import && git add ./yarn.lock && git commit -m \"update yarn.lock file\" || exit 0",
39
- "copyVersionToIndex": "node ./copyVersionToIndex.js ./index.ts && git add ./index.ts && git commit -m \"update version number in index.ts\"",
40
- "version": "npm run yarnImport && npm run copyVersionToIndex && npm run tsc:build && npm run rollup",
41
- "postversion": "git push && git push --tags && npm publish"
42
- },
43
- "keywords": [
44
- "AwayFL",
45
- "Flash",
46
- "Emulator",
47
- "2D",
48
- "Graphics",
49
- "WebGL",
50
- "Typescript"
51
- ],
52
- "license": "Apache-2.0",
53
- "bugs": {
54
- "url": "https://github.com/awayfl/awayfl-player/issues"
55
- },
56
- "homepage": "https://github.com/awayfl/awayfl-player#readme",
57
- "peerDependencies": {
58
- "@awayfl/avm1": "^0.2.0",
59
- "@awayfl/avm2": "^0.2.0",
60
- "@awayfl/playerglobal": "^0.2.0",
61
- "@awayfl/swf-loader": "^0.4.0",
62
- "@awayjs/core": "^0.9.0",
63
- "@awayjs/graphics": "^0.5.0",
64
- "@awayjs/materials": "^0.6.0",
65
- "@awayjs/renderer": "^0.11.0",
66
- "@awayjs/scene": "^0.13.0",
67
- "@awayjs/stage": "^0.11.0",
68
- "@awayjs/view": "^0.6.0",
69
- "tslib": "^2.3.0"
70
- },
71
- "devDependencies": {
72
- "@awayfl/avm1": "^0.2.0",
73
- "@awayfl/avm2": "^0.2.0",
74
- "@awayfl/playerglobal": "^0.2.0",
75
- "@awayfl/swf-loader": "^0.4.0",
76
- "@awayjs/core": "^0.9.0",
77
- "@awayjs/graphics": "^0.5.0",
78
- "@awayjs/materials": "^0.6.0",
79
- "@awayjs/renderer": "^0.11.0",
80
- "@awayjs/scene": "^0.13.0",
81
- "@awayjs/stage": "^0.11.0",
82
- "@awayjs/view": "^0.6.0",
83
- "@rollup/plugin-commonjs": "^18.0.0",
84
- "@rollup/plugin-node-resolve": "^11.2.1",
85
- "copy-webpack-plugin": "^11.0.0",
86
- "html-webpack-plugin": "^5.5.0",
87
- "rimraf": "^4.4.0",
88
- "rollup": "^2.79.1",
89
- "rollup-plugin-gzip": "^3.1.0",
90
- "rollup-plugin-terser": "^7.0.2",
91
- "terser-webpack-plugin": "^5.3.7",
92
- "ts-loader": "^9.4.2",
93
- "tslib": "^2.3.0",
94
- "typescript": "^4.9.5",
95
- "webpack": "^5.76.2",
96
- "webpack-cli": "^5.0.1",
97
- "webpack-dev-server": "^4.12.0",
98
- "webpack-merge": "^5.8.0"
99
- }
100
- }
1
+ {
2
+ "name": "@awayfl/awayfl-player",
3
+ "version": "0.2.36",
4
+ "description": "Flash Player emulator for executing SWF files (published for FP versions 6 and up) in javascript",
5
+ "main": "bundle/awayfl-player.umd.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "url": "http://www.away3d.com",
9
+ "author": "Rob Bateman",
10
+ "scripts": {
11
+ "rimraf": "rimraf",
12
+ "rollup": "rollup -c",
13
+ "tsc": "tsc",
14
+ "tsc:build": "npm run tsc || exit 0",
15
+ "webpack": "webpack",
16
+ "clean": "npm run rimraf -- dist bundle",
17
+ "clean:bin": "npm run rimraf -- bin",
18
+ "preclean:install": "npm run clean",
19
+ "clean:install": "npm set progress=false && npm install",
20
+ "preclean:start": "npm run clean",
21
+ "clean:start": "npm start",
22
+ "watch": "npm run tsc -- --w",
23
+ "build": "npm run build:dev",
24
+ "prebuild:dev": "npm run clean:bin",
25
+ "build:dev": "webpack --config webpack.config.js --progress",
26
+ "prebuild:prod": "npm run clean:bin",
27
+ "build:prod": "webpack --config webpack.config.js --progress --env prod",
28
+ "server": "npm run server:dev",
29
+ "server:dev": "webpack-dev-server --config webpack.config.js --progress",
30
+ "server:dev:hmr": "npm run server:dev -- --hot",
31
+ "server:prod": "http-server bin --cors",
32
+ "start": "npm run server:dev",
33
+ "start:hmr": "npm run server:dev:hmr",
34
+ "yarnImport": "npm run rimraf -- yarn.lock && yarn import && git add ./yarn.lock && git commit -m \"update yarn.lock file\" || exit 0",
35
+ "copyVersionToIndex": "node ./scripts/copyVersionToIndex.js ./index.ts && git add ./index.ts && git commit -m \"update version number in index.ts\"",
36
+ "preversion": "npm run clean",
37
+ "version": "npm run yarnImport && npm run copyVersionToIndex && npm run tsc:build && npm run rollup",
38
+ "postversion": "git push && git push --tags && npm publish"
39
+ },
40
+ "keywords": [
41
+ "AwayFL",
42
+ "Flash",
43
+ "Emulator",
44
+ "2D",
45
+ "Graphics",
46
+ "WebGL",
47
+ "Typescript"
48
+ ],
49
+ "license": "Apache-2.0",
50
+ "bugs": {
51
+ "url": "https://github.com/awayfl/awayfl-player/issues"
52
+ },
53
+ "homepage": "https://github.com/awayfl/awayfl-player#readme",
54
+ "peerDependencies": {
55
+ "@awayfl/avm1": "^0.2.0",
56
+ "@awayfl/avm2": "^0.2.0",
57
+ "@awayfl/playerglobal": "^0.2.0",
58
+ "@awayfl/swf-loader": "^0.4.0",
59
+ "@awayjs/core": "^0.9.0",
60
+ "@awayjs/graphics": "^0.5.0",
61
+ "@awayjs/materials": "^0.6.0",
62
+ "@awayjs/renderer": "^0.11.0",
63
+ "@awayjs/scene": "^0.13.0",
64
+ "@awayjs/stage": "^0.11.0",
65
+ "@awayjs/view": "^0.6.0",
66
+ "tslib": "^2.3.0"
67
+ },
68
+ "devDependencies": {
69
+ "@awayfl/avm1": "^0.2.0",
70
+ "@awayfl/avm2": "^0.2.0",
71
+ "@awayfl/playerglobal": "^0.2.0",
72
+ "@awayfl/swf-loader": "^0.4.0",
73
+ "@awayjs/core": "^0.9.0",
74
+ "@awayjs/graphics": "^0.5.0",
75
+ "@awayjs/materials": "^0.6.0",
76
+ "@awayjs/renderer": "^0.11.0",
77
+ "@awayjs/scene": "^0.13.0",
78
+ "@awayjs/stage": "^0.11.0",
79
+ "@awayjs/view": "^0.6.0",
80
+ "@rollup/plugin-commonjs": "^18.0.0",
81
+ "@rollup/plugin-node-resolve": "^11.2.1",
82
+ "copy-webpack-plugin": "^11.0.0",
83
+ "html-webpack-plugin": "^5.5.0",
84
+ "rimraf": "^4.4.0",
85
+ "rollup": "^2.79.1",
86
+ "rollup-plugin-gzip": "^3.1.0",
87
+ "rollup-plugin-terser": "^7.0.2",
88
+ "terser-webpack-plugin": "^5.3.7",
89
+ "ts-loader": "^9.4.2",
90
+ "tslib": "^2.3.0",
91
+ "typescript": "^4.9.5",
92
+ "webpack": "^5.76.2",
93
+ "webpack-cli": "^5.0.1",
94
+ "webpack-dev-server": "^4.12.0",
95
+ "webpack-merge": "^5.8.0"
96
+ }
97
+ }
package/rollup.config.js CHANGED
@@ -1,31 +1,31 @@
1
- import nodeResolve from '@rollup/plugin-node-resolve';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import { terser } from 'rollup-plugin-terser';
4
- import gzip from 'rollup-plugin-gzip';
5
-
6
- export default {
7
- input: './dist/index.js',
8
- output: {
9
- name: 'awayflplayer',
10
- sourcemap: true,
11
- format: 'iife',
12
- file: './bundle/awayfl-player.umd.js',
13
- },
14
- plugins: [
15
- nodeResolve(),
16
- // {
17
- // transform(code, id) {
18
- // return code.replace(/\/\*\* @class \*\//g, "\/*@__PURE__*\/");
19
- // }
20
- // },
21
- commonjs(),
22
- terser({
23
- // mangle: {
24
- // properties: {
25
- // reserved: ['startPokiGame', 'userAgent', 'Number', '__constructor__', 'prototype']
26
- // }
27
- // }
28
- }),
29
- gzip()
30
- ]
1
+ import nodeResolve from '@rollup/plugin-node-resolve';
2
+ import commonjs from '@rollup/plugin-commonjs';
3
+ import { terser } from 'rollup-plugin-terser';
4
+ import gzip from 'rollup-plugin-gzip';
5
+
6
+ export default {
7
+ input: './dist/index.js',
8
+ output: {
9
+ name: 'awayflplayer',
10
+ sourcemap: true,
11
+ format: 'iife',
12
+ file: './bundle/awayfl-player.umd.js',
13
+ },
14
+ plugins: [
15
+ nodeResolve(),
16
+ // {
17
+ // transform(code, id) {
18
+ // return code.replace(/\/\*\* @class \*\//g, "\/*@__PURE__*\/");
19
+ // }
20
+ // },
21
+ commonjs(),
22
+ terser({
23
+ // mangle: {
24
+ // properties: {
25
+ // reserved: ['startPokiGame', 'userAgent', 'Number', '__constructor__', 'prototype']
26
+ // }
27
+ // }
28
+ }),
29
+ gzip()
30
+ ]
31
31
  };
@@ -1,33 +1,33 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- var fs = require("fs");
4
- var path = require("path");
5
-
6
-
7
- // read in the ts-file at filePath
8
-
9
- // use regex to find a console log for printing the version and update it for the new version
10
-
11
- // update ts-file at filePath with the new content
12
-
13
- //console.log(process.env.npm_package_version);
14
- //console.log(process.env.INIT_CWD);
15
- const args = process.argv.slice(2);
16
- if (!args[0]) {
17
- console.log("copyVersionToIndex - no path was provided")
18
- }
19
- let filePath = path.join(process.env.INIT_CWD, args[0]);
20
-
21
- console.log("update ", filePath, " with version:", process.env.npm_package_version);
22
-
23
- fs.readFile(filePath, 'utf8', function (err, data) {
24
- if (err) throw err;
25
- var re = /(.*[a-zA-Z0-9]\s\-\s)(.*)(\"\)\;.*)/;
26
- //console.log("before", data)
27
- data = data.replace(re, "$1" + process.env.npm_package_version + "$3");//#BUILD_VIA_NPM_VERSION_PATCH_TO_DISPLAY_VERSION_HERE#", process.env.npm_package_version);
28
- //console.log("after", data)
29
- fs.writeFile(filePath, data, function (err) {
30
- if (err) throw err;
31
- console.log("Updated ", filePath, " with inserted version ", process.env.npm_package_version);
32
- });
33
- });
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ var fs = require("fs");
4
+ var path = require("path");
5
+
6
+
7
+ // read in the ts-file at filePath
8
+
9
+ // use regex to find a console log for printing the version and update it for the new version
10
+
11
+ // update ts-file at filePath with the new content
12
+
13
+ //console.log(process.env.npm_package_version);
14
+ //console.log(process.env.INIT_CWD);
15
+ const args = process.argv.slice(2);
16
+ if (!args[0]) {
17
+ console.log("copyVersionToIndex - no path was provided")
18
+ }
19
+ let filePath = path.join(process.env.INIT_CWD, args[0]);
20
+
21
+ console.log("update ", filePath, " with version:", process.env.npm_package_version);
22
+
23
+ fs.readFile(filePath, 'utf8', function (err, data) {
24
+ if (err) throw err;
25
+ var re = /(.*[a-zA-Z0-9]\s\-\s)(.*)(\"\)\;.*)/;
26
+ //console.log("before", data)
27
+ data = data.replace(re, "$1" + process.env.npm_package_version + "$3");//#BUILD_VIA_NPM_VERSION_PATCH_TO_DISPLAY_VERSION_HERE#", process.env.npm_package_version);
28
+ //console.log("after", data)
29
+ fs.writeFile(filePath, data, function (err) {
30
+ if (err) throw err;
31
+ console.log("Updated ", filePath, " with inserted version ", process.env.npm_package_version);
32
+ });
33
+ });