diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ccbe46 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules/ diff --git a/docs/create_repo.png b/docs/create_repo.png deleted file mode 100644 index 552081e..0000000 Binary files a/docs/create_repo.png and /dev/null differ diff --git a/docs/github_pages.png b/docs/github_pages.png deleted file mode 100644 index c6c8b06..0000000 Binary files a/docs/github_pages.png and /dev/null differ diff --git a/docs/website_address.png b/docs/website_address.png deleted file mode 100644 index d994e9f..0000000 Binary files a/docs/website_address.png and /dev/null differ diff --git a/map.json b/map.json index d824a67..e73cf01 100644 --- a/map.json +++ b/map.json @@ -143,8 +143,14 @@ "nextlayerid":14, "nextobjectid":1, "orientation":"orthogonal", + "properties":[ + { + "name":"script", + "type":"string", + "value":"script.js" + }], "renderorder":"right-down", - "tiledversion":"1.3.3", + "tiledversion":"2021.03.23", "tileheight":32, "tilesets":[ { @@ -897,6 +903,6 @@ }], "tilewidth":32, "type":"map", - "version":1.2, + "version":1.5, "width":46 } \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..98c40e0 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "workadventure-map-starter-kit", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "devDependencies": { + "@workadventure/iframe-api-typings": "^1.2.0", + "eslint": "^6.8.0", + "html-webpack-plugin": "^4.3.0", + "ts-loader": "^6.2.2", + "ts-node": "^8.10.2", + "typescript": "^3.8.3", + "webpack": "^4.42.1", + "webpack-cli": "^3.3.11", + "webpack-dev-server": "^3.10.3", + "webpack-merge": "^4.2.2" + }, + "scripts": { + "start": "webpack-dev-server --open", + "build": "webpack --config webpack.prod.js", + "test": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json", + "lint": "node_modules/.bin/eslint src/ . --ext .ts", + "fix": "node_modules/.bin/eslint --fix src/ . --ext .ts" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..cdb0c1e --- /dev/null +++ b/src/index.ts @@ -0,0 +1,4 @@ +/// + +console.log('Script started successfully'); +WA.openCoWebSite('https://workadventu.re'); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..b5c8c74 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "outDir": "./dist/", + "sourceMap": true, + "moduleResolution": "node", + "module": "CommonJS", + "target": "ES2015", + "declaration": false, + "downlevelIteration": true, + "jsx": "react", + "allowJs": true, + + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + "strictNullChecks": true, /* Enable strict null checks. */ + "strictFunctionTypes": true, /* Enable strict checking of function types. */ + "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */ + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..72f9e1b --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,60 @@ +const path = require('path'); +const webpack = require('webpack'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); + +module.exports = { + entry: './src/index.ts', + devtool: 'inline-source-map', + devServer: { + contentBase: '.', + //host: '0.0.0.0', + host: 'localhost', + //sockPort: 80, + disableHostCheck: true, + headers: { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS", + "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization" + } + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + ], + }, + resolve: { + extensions: [ '.tsx', '.ts', '.js' ], + }, + output: { + filename: 'script.js', + path: path.resolve(__dirname, 'dist'), + publicPath: '/' + }, + /*externals:[ + require('webpack-require-http') + ],*/ + plugins: [ + /*new webpack.ProvidePlugin({ + WA: ['@workadventure/iframe-api-typings', 'window.WA'] + }),*/ + /*new webpack.EnvironmentPlugin({ + 'API_URL': null, + 'PUSHER_URL': undefined, + 'UPLOADER_URL': null, + 'ADMIN_URL': null, + 'DEBUG_MODE': null, + 'STUN_SERVER': null, + 'TURN_SERVER': null, + 'TURN_USER': null, + 'TURN_PASSWORD': null, + 'JITSI_URL': null, + 'JITSI_PRIVATE_MODE': null, + 'START_ROOM_URL': null + })*/ + ], + +};