Skip to content

Commit

Permalink
Merge pull request #4 from proyecto26/develop
Browse files Browse the repository at this point in the history
Release 1.0.5
  • Loading branch information
jdnichollsc authored Mar 15, 2021
2 parents cb5b8ad + ce01fe8 commit 10196ab
Show file tree
Hide file tree
Showing 33 changed files with 1,993 additions and 1,217 deletions.
File renamed without changes.
13 changes: 13 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"quoteProps": "consistent",
"printWidth": 180,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
92 changes: 92 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Looking for [Phaser Framework 3](https://github.com/photonstorm/phaser)? Check [

### Script tag

- Put a script tag similar to this `<script src='https://unpkg.com/@ion-phaser-ce/[email protected].3/dist/ionphaser.js'></script>` in the head of your index.html
- Put a script tag similar to this `<script src='https://unpkg.com/@ion-phaser-ce/[email protected].5/dist/ionphaser.js'></script>` in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc

### Node Modules
Expand Down Expand Up @@ -307,6 +307,11 @@ export default {

[_from stencil documentation_](https://github.com/ionic-team/stencil-site/blob/master/src/docs/framework-integration/vue.md)

## Contributing ✨
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated** ❤️.
You can learn more about how you can contribute to this project in the [contribution guide](https://github.com/proyecto26/ion-phaser-ce/blob/develop/CONTRIBUTING.md).

## Supporting 🍻
I believe in Unicorns 🦄
Support [me](http://www.paypal.me/jdnichollsc/2), if you do too.
Expand All @@ -320,6 +325,9 @@ The maintainers of IonPhaser CE and thousands of other packages are working with
## Security contact information 🚨
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

## License ⚖️
This repository is available under the [MIT License](https://github.com/proyecto26/ion-phaser-ce/blob/develop/LICENSE).

## Happy coding 💯
Made with ❤️

Expand Down
2 changes: 1 addition & 1 deletion demo-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"@ion-phaser-ce/core": "file:..",
"@ion-phaser-ce/core": "1.0.4",
"phaser-ce": "2.13.3",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
Expand Down
17 changes: 10 additions & 7 deletions demo-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ion-phaser-ce/react": "^1.0.3",
"@ion-phaser-ce/react": "^1.0.5",
"phaser-ce": "2.16.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "^3.4.1"
},
"devDependencies": {
"eslint": "^6.6.0",
"typescript": "^3.8.3",
"@types/jest": "^25.2.1",
"@types/node": "^13.13.4",
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.7",
"phaser-ce": "^2.13.3",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "^3.4.1",
"typescript": "^3.8.3"
"@types/react-dom": "^16.9.7"
},
"scripts": {
"start": "react-scripts start",
Expand Down
7 changes: 4 additions & 3 deletions demo-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'
import React, { useState, useEffect, useRef } from 'react'
import { IonPhaserCe, GameInstance } from '@ion-phaser-ce/react'
import Phaser from 'phaser-ce'
import logo from './assets/logo.png'
Expand Down Expand Up @@ -35,11 +35,12 @@ const gameConfig: GameInstance = {
}

export default function App () {
const gameRef = useRef<HTMLIonPhaserCeElement>()
const [game, setGame] = useState<GameInstance>()
const [initialize, setInitialize] = useState(false)

const destroy = () => {
console.log('Instance', game?.instance)
gameRef.current?.destroy()
setInitialize(false)
setGame(undefined)
}
Expand All @@ -55,7 +56,7 @@ export default function App () {
<header className="App-header">
{ initialize ? (
<>
<IonPhaserCe class="game" game={game} initialize={initialize} />
<IonPhaserCe ref={gameRef} class="game" game={game} initialize={initialize} />
<div onClick={destroy} className="flex destroyButton">
<a href="#1" className="bttn">Destroy</a>
</div>
Expand Down
14 changes: 14 additions & 0 deletions demo-vue/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
}
32 changes: 9 additions & 23 deletions demo-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,21 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^2.6.5",
"core-js": "^3.0.0",
"vue": "^2.6.10",
"phaser-ce": "2.13.3",
"@ion-phaser-ce/core": "file:.."
"phaser-ce": "2.16.2",
"@ion-phaser-ce/core": "^1.0.4"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0",
"@vue/cli-plugin-eslint": "^3.11.0",
"@vue/cli-service": "^3.11.0",
"@vue/cli-plugin-babel": "^4.0.0",
"@vue/cli-plugin-eslint": "^4.0.0",
"@vue/cli-service": "^4.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"expose-loader": "^0.7.5",
"eslint": "^7.0.0",
"eslint-plugin-vue": "^7.0.0",
"expose-loader": "^1.0.0",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
Expand Down
46 changes: 29 additions & 17 deletions demo-vue/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,48 @@
var path = require('path')

var phaserModule = path.join(__dirname, '../node_modules/phaser-ce/')
var phaser = path.join(phaserModule, 'build/custom/phaser-split.js')
var pixi = path.join(phaserModule, 'build/custom/pixi.js')
var p2 = path.join(phaserModule, 'build/custom/p2.js')

module.exports = {
chainWebpack: config => {
config.resolve.alias
.set('phaser', phaser)
.set('pixi', pixi)
.set('p2', p2);
chainWebpack: (config) => {
config.resolve
.alias
.set('phaser', 'phaser-ce/build/custom/phaser-split.js')
.set('pixi', 'phaser-ce/build/custom/pixi.js')
.set('p2', 'phaser-ce/build/custom/p2.js')

config.module
.rule('phaser')
.test(/phaser-split\.js$/)
.use('expose-loader?Phaser')
.loader('expose-loader?Phaser')
.loader('expose-loader')
.options({
exposes: {
globalName: "Phaser",
override: true,
}
})
.end()

config.module
.rule('pixi')
.test(/pixi\.js/)
.test(/pixi\.js$/)
.use('expose-loader?PIXI')
.loader('expose-loader?PIXI')
.loader('expose-loader')
.options({
exposes: {
globalName: "PIXI",
override: true,
}
})
.end()

config.module
.rule('p2')
.test(/p2\.js/)
.test(/p2\.js$/)
.use('expose-loader?p2')
.loader('expose-loader?p2')
.loader('expose-loader')
.options({
exposes: {
globalName: "p2",
override: true,
}
})
.end()
}
}
Loading

0 comments on commit 10196ab

Please sign in to comment.