Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add additional metadata #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ The specificity is as folows:
author: null,
desc: null,
script: 'js',
site: null,
license: "MIT License (change this to your license of choice)",
version: null,
input: null,
saveid: null
},
Expand All @@ -162,6 +165,9 @@ The specificity is as folows:
- `metadata.author` - The name of the developer.
- `metadata.description` - Optional description of the game.
- `metadata.script` (default `js`) - Used scripting language.
- `metadata.site` - Website of the game.
- `metadata.license` (default `MIT License (change this to your license of choice)`) - License of the game.
- `metadata.version` - Version of the game.
- `metadata.input` - Selects gamepad, mouse or keyboard input source.
- `metadata.saveid` - Allows save data to be shared within multiple games on a copy of TIC.
- `output.path` (default `./`) - Bundled file output path.
Expand Down
3 changes: 3 additions & 0 deletions src/createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ module.exports = config => {
author: normalizeString('metadata.author', null),
desc: normalizeString('metadata.desc', null),
script: normalizeString('metadata.script', 'js'),
site: normalizeString('metadata.site', null),
license: normalizeString('metadata.license', 'MIT License (change this to your license of choice)'),
version: normalizeString('metadata.version', null),
input: normalizeString('metadata.input', null),
saveid: normalizeString('metadata.saveid', null),
},
Expand Down
3 changes: 3 additions & 0 deletions test/unit/createConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ test('[createConfig] creates default config file', t => {
author: null,
desc: null,
script: 'js',
site: null,
license: 'MIT License (change this to your license of choice)',
version: null,
input: null,
saveid: null
},
Expand Down
2 changes: 1 addition & 1 deletion test/unit/run.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test('[run] transforms output if `after` is provided', t => {

const fileData = fs.readFileSync(file, { encoding: 'utf-8' });

t.equal(fileData, `// script: js${EOL}${EOL}`, 'overrides bundle output');
t.equal(fileData, `// script: js${EOL}// license: MIT License (change this to your license of choice)${EOL}${EOL}`, 'overrides bundle output');

fs.unlinkSync(file);

Expand Down