-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Main entry point for boilerplate player
- Loading branch information
1 parent
42ba921
commit 57ec83a
Showing
18 changed files
with
1,368 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Build and Release Folders | ||
bin/ | ||
node_modules/ | ||
dist/ | ||
bundle/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# Build and Release Folders | ||
bin/ | ||
node_modules/ | ||
src/ | ||
template/ | ||
|
||
# Dev files | ||
npm-debug.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
|
||
|
||
// all props prefixed with "rt_" will be added to config that is inserted in html | ||
|
||
//------------------------------------------------------ | ||
// global config - same for all swf-files: | ||
//------------------------------------------------------ | ||
|
||
debugConfig: false, // log config in build process | ||
rt_showFPS: false, // show fps display - always false in prod | ||
cacheBuster: true, // add cachebuster to urls - always false in prod | ||
allowURLSearchParams: true, // allow changing config via url-params - always false in prod | ||
split: false, // create own folder for each file - only available in prod | ||
|
||
entryName: "Main", // name of webpack-entry - must be set for each config (use package.main ?) | ||
entryPath: "./src/Main.ts", // path to webpack-entry - must be set for each config (use package.main ?) | ||
|
||
buildinsPath: path.join(__dirname, "builtins"), // path to buildins - must be set when amv2 will be used | ||
indexTemplate: path.join(__dirname, "template", "index_template.html"), // path to game-html template - must be set | ||
gameTemplate: path.join(__dirname, "template", "game_template.html"), // path to index-html template - must be set | ||
loaderTemplate: path.join(__dirname, "template", "loader.js"), // path to loader.js - must be set | ||
|
||
//------------------------------------------------------------------------- | ||
// default config for this game - can be overwritten for every file-config: | ||
//------------------------------------------------------------------------- | ||
|
||
rt_debug: true, // disable JS blobind - always false in prod | ||
rt_title: "Main", // title of game - should be overwritten for each file-config, but also available for index | ||
rt_filename: "", // filename of game - no extension - must be set for each config | ||
rt_splash: "todo.jpg", // path to splash-image - with extension | ||
rt_start: null, // path to start-image - with extension - optional - if present, loader wait for user input to start the game | ||
rt_width: 1024, // width of preloader screen (todo: grab this from splashimage ?) | ||
rt_height: 768, // height of preloader screen (todo: grab this from splashimage ?) | ||
rt_x: 0, // x offset of stage (either absolute px value, or string with percentage of window.innerWidth (0-100)) | ||
rt_y: 0, // y offset of stage (either absolute px value, or string with percentage of window.innerHeight (0-100)) | ||
rt_w: "100%", // width of stage (either absolute px value, or string with percentage of window.innerWidth (0-100)) | ||
rt_h: "100%", // height of stage (either absolute px value, or string with percentage of window.innerHeight (0-100)) | ||
|
||
rt_stageScaleMode:null, // allowed values: EXACT_FIT noBorder noScale showAll | ||
rt_stageAlign:null, // allowed values: B BL BR L R T TL TR | ||
|
||
rt_progressParserWeigth: 1, // weight of parser in reporter - can be ommited or set to 0 aswell | ||
|
||
// properties for progress bar | ||
rt_progress: { | ||
direction: "lr", // lr, td | ||
back: "#130d02", // #000 | ||
line: "#f29f01", // "#00ff00", | ||
rect: [0.25, 0.77, 0.5, 0.01], // values are percentage of width / height | ||
}, | ||
|
||
rt_box2dVersion: 'none', // box2d version: none, legacy, new, custom (external implementation) | ||
// list of file-configs. | ||
// each file-config is a object that must provide: | ||
// - rt_title | ||
// - rt_filename (no extension) | ||
// it can overwrite other config props aswell | ||
fileconfigs: [ | ||
{ | ||
rt_title: "Bacon_Ipsem", | ||
rt_filename: "Bacon_Ipsem", | ||
rt_stageScaleMode: "showAll", | ||
}, | ||
{ | ||
rt_showFPS: true, | ||
rt_title: "BasicAS3Tests_FP30", | ||
rt_filename: "BasicAS3Tests_FP30", | ||
rt_stageScaleMode: "showAll", | ||
}, | ||
{ | ||
rt_title: "text_test", | ||
rt_filename: "text_test", | ||
rt_stageScaleMode: "showAll", | ||
} | ||
], | ||
|
||
resources: ["template/fonts.swf"], // list of urls to preload (fonts) - relative to project folder | ||
|
||
assets:[ | ||
|
||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
|
||
|
||
// read in the /index.ts | ||
// read in the ts-file at filePath | ||
|
||
// use regex to find a console log for printing the version and update it for the new version | ||
|
||
// update /index.ts with the new content | ||
// update ts-file at filePath with the new content | ||
|
||
console.log("update src/index.ts with version:", process.env.npm_package_version); | ||
//console.log(process.env.npm_package_version); | ||
//console.log(process.env.INIT_CWD); | ||
const args = process.argv.slice(2); | ||
if (!args[0]) { | ||
console.log("copyVersionToIndex - no path was provided") | ||
} | ||
let filePath = path.join(process.env.INIT_CWD, args[0]); | ||
|
||
fs.readFile("./index.ts", 'utf8', function(err, data) { | ||
if (err) throw err; | ||
var re = /(.*[a-zA-Z]\s\-\s)(.*)(\"\)\;.*)/; | ||
//console.log("before", data) | ||
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); | ||
//console.log("after", data) | ||
fs.writeFile("./index.ts", data, function(err) { | ||
if (err) throw err; | ||
console.log("Updated ./index.ts with inserted version ", process.env.npm_package_version); | ||
}); | ||
}); | ||
console.log("update ", filePath, " with version:", process.env.npm_package_version); | ||
|
||
fs.readFile(filePath, 'utf8', function (err, data) { | ||
if (err) throw err; | ||
var re = /(.*[a-zA-Z0-9]\s\-\s)(.*)(\"\)\;.*)/; | ||
//console.log("before", data) | ||
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); | ||
//console.log("after", data) | ||
fs.writeFile(filePath, data, function (err) { | ||
if (err) throw err; | ||
console.log("Updated ", filePath, " with inserted version ", process.env.npm_package_version); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,103 @@ | ||
{ | ||
"name": "@awayfl/awayfl-player", | ||
"version": "0.2.29", | ||
"description": "Flash Player emulator for executing SWF files (published for FP versions 6 and up) in javascript", | ||
"main": "bundle/awayfl-player.umd.js", | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"url": "http://www.away3d.com", | ||
"author": "Rob Bateman", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/awayfl/awayfl-player.git" | ||
}, | ||
"scripts": { | ||
"rimraf": "rimraf", | ||
"rollup": "rollup -c", | ||
"uglifyjs": "uglifyjs ./bundle/awayfl-player.umd.js -o ./bundle/awayfl-player.umd.min.js --source-map \"content='./bundle/awayfl-player.umd.js.map'\" --mangle", | ||
"tsc": "tsc", | ||
"tsc:build": "npm run tsc || exit 0", | ||
"clean": "npm cache clean && npm run rimraf -- node_modules dist bundle", | ||
"clean:dist": "npm run rimraf -- dist bundle", | ||
"watch": "npm run tsc -- --w", | ||
"prebuild": "npm run clean:dist", | ||
"build": "npm run tsc:build && npm run rollup && npm run uglifyjs", | ||
"copyVersionToIndex": "node ./copyVersionToIndex && git add ./index.ts && git commit -m \"update version number in index.ts\"", | ||
"version": "npm run copyVersionToIndex && npm run build", | ||
"postversion": "git push && git push --tags && npm publish" | ||
}, | ||
"keywords": [ | ||
"AwayJS", | ||
"WebGL", | ||
"2D", | ||
"3D", | ||
"graphics" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/awayfl/awayfl-player/issues" | ||
}, | ||
"homepage": "https://github.com/awayfl/awayfl-player#readme", | ||
"peerDependencies": { | ||
"@awayfl/avm1": "^0.2.0", | ||
"@awayfl/avm2": "^0.2.0", | ||
"@awayfl/playerglobal": "^0.2.0", | ||
"@awayfl/swf-loader": "^0.4.0", | ||
"@awayjs/core": "^0.9.0", | ||
"@awayjs/scene": "^0.13.0", | ||
"tslib": "^1.9.0" | ||
}, | ||
"devDependencies": { | ||
"@awayfl/avm1": "^0.2.0", | ||
"@awayfl/avm2": "^0.2.0", | ||
"@awayfl/playerglobal": "^0.2.0", | ||
"@awayfl/swf-loader": "^0.4.0", | ||
"@awayjs/core": "^0.9.0", | ||
"@awayjs/graphics": "^0.5.0", | ||
"@awayjs/materials": "^0.6.0", | ||
"@awayjs/renderer": "^0.11.0", | ||
"@awayjs/scene": "^0.13.0", | ||
"@awayjs/stage": "^0.11.0", | ||
"@awayjs/view": "^0.6.0", | ||
"rimraf": "^2.5.2", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-commonjs": "^9.1.0", | ||
"rollup-plugin-includepaths": "^0.2.1", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"tslib": "^1.9.0", | ||
"typescript": "^3.7.3", | ||
"uglify-js": "^3.0.15" | ||
} | ||
"name": "@awayfl/awayfl-player", | ||
"version": "0.2.29", | ||
"description": "Flash Player emulator for executing SWF files (published for FP versions 6 and up) in javascript", | ||
"main": "bundle/awayfl-player.umd.js", | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"url": "http://www.away3d.com", | ||
"author": "Rob Bateman", | ||
"scripts": { | ||
"rimraf": "rimraf", | ||
"rollup": "rollup -c", | ||
"tsc": "tsc", | ||
"tsc:build": "npm run tsc || exit 0", | ||
"webpack": "webpack", | ||
"clean": "npm cache clean && npm run rimraf -- node_modules bin", | ||
"clean:bin": "npm run rimraf -- bin", | ||
"preclean:install": "npm run clean", | ||
"clean:install": "npm set progress=false && npm install", | ||
"preclean:start": "npm run clean", | ||
"clean:start": "npm start", | ||
"watch": "npm run watch:dev", | ||
"watch:dev": "npm run build:dev -- --watch", | ||
"watch:dev:hmr": "npm run watch:dev -- --hot", | ||
"watch:test": "npm run test -- --auto-watch --no-single-run", | ||
"watch:prod": "npm run build:prod -- --watch", | ||
"build": "npm run build:dev", | ||
"prebuild:dev": "npm run clean:bin", | ||
"build:dev": "webpack --config webpack.config.js --progress", | ||
"prebuild:prod": "npm run clean:bin", | ||
"build:prod": "webpack --config webpack.config.js --progress --env.prod", | ||
"server": "npm run server:dev", | ||
"server:dev": "webpack-dev-server --config webpack.config.js --progress --watch", | ||
"server:dev:hmr": "npm run server:dev -- --hot", | ||
"server:prod": "http-server bin --cors", | ||
"start": "npm run server:dev", | ||
"start:hmr": "npm run server:dev:hmr", | ||
"yarnImport": "npm run rimraf -- yarn.lock && yarn import && git add ./yarn.lock && git commit -m \"update yarn.lock file\" || exit 0", | ||
"copyVersionToIndex": "node ./copyVersionToIndex.js ./index.ts && git add ./index.ts && git commit -m \"update version number in index.ts\"", | ||
"version": "npm run yarnImport && npm run copyVersionToIndex && npm run tsc:build && npm run rollup", | ||
"postversion": "git push && git push --tags && npm publish" | ||
}, | ||
"keywords": [ | ||
"AwayFL", | ||
"Flash", | ||
"Emulator", | ||
"2D", | ||
"Graphics", | ||
"WebGL", | ||
"Typescript" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/awayfl/awayfl-player/issues" | ||
}, | ||
"homepage": "https://github.com/awayfl/awayfl-player#readme", | ||
"peerDependencies": { | ||
"@awayfl/avm1": "^0.2.0", | ||
"@awayfl/avm2": "^0.2.0", | ||
"@awayfl/playerglobal": "^0.2.0", | ||
"@awayfl/swf-loader": "^0.4.0", | ||
"@awayjs/core": "^0.9.0", | ||
"@awayjs/graphics": "^0.5.0", | ||
"@awayjs/materials": "^0.6.0", | ||
"@awayjs/renderer": "^0.11.0", | ||
"@awayjs/scene": "^0.13.0", | ||
"@awayjs/stage": "^0.11.0", | ||
"@awayjs/view": "^0.6.0", | ||
"tslib": "^1.9.0" | ||
}, | ||
"devDependencies": { | ||
"@awayfl/avm1": "^0.2.0", | ||
"@awayfl/avm2": "^0.2.0", | ||
"@awayfl/playerglobal": "^0.2.0", | ||
"@awayfl/swf-loader": "^0.4.0", | ||
"@awayjs/core": "^0.9.0", | ||
"@awayjs/graphics": "^0.5.0", | ||
"@awayjs/materials": "^0.6.0", | ||
"@awayjs/renderer": "^0.11.0", | ||
"@awayjs/scene": "^0.13.0", | ||
"@awayjs/stage": "^0.11.0", | ||
"@awayjs/view": "^0.6.0", | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"babel-core": "^6.26.3", | ||
"copy-webpack-plugin": "^5.1.1", | ||
"fs": "^0.0.1-security", | ||
"html-webpack-plugin": "^4.2.0", | ||
"path": "^0.12.7", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.45.2", | ||
"rollup-plugin-gzip": "^2.5.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"terser-webpack-plugin": "^2.3.5", | ||
"ts-loader": "^6.2.2", | ||
"tslib": "^1.9.0", | ||
"typescript": "^3.8.3", | ||
"webpack": "^4.42.1", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3", | ||
"webpack-merge": "^4.2.2" | ||
} | ||
} |
Oops, something went wrong.