Skip to content

Commit

Permalink
Update dependencies and templates, fix tests/eslint, add AS3 template…
Browse files Browse the repository at this point in the history
…, and add GitHub actions (closes #5)

Co-authored-by: Fancy2209 <[email protected]>
  • Loading branch information
joshtynjala and Fancy2209 committed Oct 2, 2023
1 parent d711570 commit 330209c
Show file tree
Hide file tree
Showing 55 changed files with 12,122 additions and 7,118 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on: [push, pull_request]

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true

- uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install Dependencies
run: |
npm ci
- name: Run Tests
run: |
npm test
- name: Package Library for npm
run: |
npm pack
- uses: actions/upload-artifact@v3
with:
name: generator-openfl-npm
path: generator-openfl-*.tgz
if-no-files-found: error
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
coverage
node_modules/
generators/**/package-lock.json
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .yo-rc.json

This file was deleted.

13 changes: 7 additions & 6 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)
MIT License
===========

Copyright (c) 2018-2023 Joshua Granick
Copyright (c) 2013-2023 Joshua Granick and other OpenFL contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# generator-openfl [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
> Generator for OpenFL ES5, ES6, TypeScript or Haxe NPM-based projects
# generator-openfl [![NPM version][npm-image]][npm-url]

> Generator for OpenFL ES5, ES6, TypeScript, AS3/Royale, or Haxe NPM-based projects
## Installation

First, install [Yeoman](http://yeoman.io) and generator-openfl using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
First, install [Yeoman](http://yeoman.io) and generator-openfl using [npm](https://www.npmjs.com/) (we assume you have pre-installed [Node.js](https://nodejs.org/)).

```bash
npm install -g yo
Expand All @@ -18,19 +19,15 @@ yo openfl

## Getting To Know Yeoman

* Yeoman has a heart of gold.
* Yeoman is a person with feelings and opinions, but is very easy to work with.
* Yeoman can be too opinionated at times but is easily convinced not to be.
* Feel free to [learn more about Yeoman](http://yeoman.io/).
* Yeoman has a heart of gold.
* Yeoman is a person with feelings and opinions, but is very easy to work with.
* Yeoman can be too opinionated at times but is easily convinced not to be.
* Feel free to [learn more about Yeoman](http://yeoman.io/).

## License

MIT © [Joshua Granick]()
© [Joshua Granick and OpenFL contributors](https://github.com/openfl/generator-openfl)


[npm-image]: https://badge.fury.io/js/generator-openfl.svg
[npm-url]: https://npmjs.org/package/generator-openfl
[travis-image]: https://travis-ci.org/openfl/generator-openfl.svg?branch=master
[travis-url]: https://travis-ci.org/openfl/generator-openfl
[daviddm-image]: https://david-dm.org/openfl/generator-openfl.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/openfl/generator-openfl
147 changes: 131 additions & 16 deletions __tests__/app.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,132 @@
'use strict';
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');

describe('generator-openfl:app', () => {
beforeAll(() => {
return helpers.run(path.join(__dirname, '../generators/app'))
.withPrompts({someAnswer: true});
});

it('creates files', () => {
assert.file([
'dummyfile.txt'
]);
});
"use strict";
const path = require ("path");
const assert = require ("yeoman-assert");
const helpers = require ("yeoman-test");

describe ("generator-openfl:app", () => {

describe ("TypeScript", () => {

beforeAll (() => {

return helpers.run (path.join (__dirname, "../generators/app"))
.withPrompts ({name: "hello-openfl", language: "TypeScript"});

});

it ("creates files", () => {

assert.file ([
".gitignore",
"package.json",
"tsconfig.json",
"webpack.config.js",
"public/index.html",
"public/favicon.png",
"src/app.ts"
]);

});

});

describe ("ES6", () => {

beforeAll (() => {

return helpers.run (path.join (__dirname, "../generators/app"))
.withPrompts ({name: "hello-openfl", language: "ES6/JavaScript"});

});

it ("creates files", () => {

assert.file ([
".babelrc",
".gitignore",
"package.json",
"webpack.config.js",
"public/index.html",
"public/favicon.png",
"src/app.js"
]);

});

});

describe ("ES5", () => {

beforeAll (() => {

return helpers.run (path.join (__dirname, "../generators/app"))
.withPrompts ({name: "hello-openfl", language: "ES5/JavaScript"});

});

it ("creates files", () => {

assert.file ([
".gitignore",
"package.json",
"webpack.config.js",
"public/index.html",
"public/favicon.png",
"src/app.js"
]);

});

});

describe ("Haxe", () => {

beforeAll (() => {

return helpers.run (path.join (__dirname, "../generators/app"))
.withPrompts ({name: "hello-openfl", language: "Haxe"});

});

it ("creates files", () => {

assert.file ([
".gitignore",
"build.hxml",
"package.json",
"webpack.config.js",
"public/index.html",
"public/favicon.png",
"src/App.hx"
]);

});

});

describe ("AS3/Royale", () => {

beforeAll (() => {

return helpers.run (path.join (__dirname, "../generators/app"))
.withPrompts ({name: "hello-openfl", language: "AS3/Royale"});

});

it ("creates files", () => {

assert.file ([
".gitignore",
"asconfig.json",
"package.json",
"template.html",
"favicon.png",
"src/App.as",
"src/Main.as"
]);

});

});

});
Loading

0 comments on commit 330209c

Please sign in to comment.