extwee 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/extwee.js +10 -12
- package/package.json +16 -17
- package/src/Story.js +4 -5
- package/test/CLI/test2.html +1 -1
- package/test/HTMLWriter/creator.html +1 -1
- package/test/HTMLWriter/test11.html +1 -1
- package/test/HTMLWriter/test4.html +1 -1
- package/test/HTMLWriter/test6.html +1 -1
- package/test/Roundtrip/round.html +1 -1
- package/test/TweeWriter/test1.twee +1 -1
- package/test/TweeWriter/test5.twee +1 -1
package/bin/extwee.js
CHANGED
|
@@ -10,20 +10,18 @@ import Extwee from '../index.js';
|
|
|
10
10
|
// Import Commander
|
|
11
11
|
import { Command } from 'commander';
|
|
12
12
|
|
|
13
|
-
//
|
|
13
|
+
// Create a new Command
|
|
14
14
|
const program = new Command();
|
|
15
15
|
|
|
16
16
|
program
|
|
17
|
-
.
|
|
17
|
+
.name('extwee')
|
|
18
|
+
.version('2.0.5')
|
|
18
19
|
.option('-c', 'From Twee into HTML')
|
|
19
20
|
.option('-d', 'From HTML into Twee')
|
|
20
21
|
.option('-s <storyformat>', 'Path to storyformat')
|
|
21
22
|
.option('-i <inputFile>', 'Path to input file')
|
|
22
23
|
.option('-o <outputFile>', 'Path to output file');
|
|
23
24
|
|
|
24
|
-
// Set the process title
|
|
25
|
-
process.title = 'extwee';
|
|
26
|
-
|
|
27
25
|
// Parse the passed arguments
|
|
28
26
|
program.parse(process.argv);
|
|
29
27
|
|
|
@@ -31,19 +29,19 @@ program.parse(process.argv);
|
|
|
31
29
|
const options = program.opts();
|
|
32
30
|
|
|
33
31
|
// Decompile branch
|
|
34
|
-
if(options.
|
|
35
|
-
const inputHTML = Extwee.readFile(options.
|
|
32
|
+
if(options.d === true) {
|
|
33
|
+
const inputHTML = Extwee.readFile(options.i);
|
|
36
34
|
const storyObject = Extwee.parseHTML(inputHTML);
|
|
37
|
-
Extwee.writeTwee(storyObject, options.
|
|
35
|
+
Extwee.writeTwee(storyObject, options.o);
|
|
38
36
|
process.exit();
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
// Compile branch
|
|
42
|
-
if(options.
|
|
43
|
-
const inputTwee = Extwee.readFile(options.
|
|
40
|
+
if(options.c === true) {
|
|
41
|
+
const inputTwee = Extwee.readFile(options.i);
|
|
44
42
|
const story = Extwee.parseTwee(inputTwee);
|
|
45
|
-
const inputStoryFormat = Extwee.readFile(options.
|
|
43
|
+
const inputStoryFormat = Extwee.readFile(options.s);
|
|
46
44
|
const parsedStoryFormat = Extwee.parseStoryFormat(inputStoryFormat);
|
|
47
|
-
Extwee.writeHTML(options.
|
|
45
|
+
Extwee.writeHTML(options.o, story, parsedStoryFormat);
|
|
48
46
|
process.exit();
|
|
49
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extwee",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "A Twee 3 compiler written in JS.",
|
|
5
5
|
"author": "Dan Cox",
|
|
6
6
|
"main": "index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"extwee": "bin/extwee.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"test": "jest --runInBand --coverage --colors",
|
|
11
|
+
"test": "jest --silent --runInBand --coverage --colors",
|
|
12
12
|
"lint": "eslint ./src/**/*.js --fix",
|
|
13
13
|
"lint:test": "eslint ./test/*.test.js --fix",
|
|
14
14
|
"all": "npm run lint && npm run lint:test && npm run test"
|
|
@@ -21,31 +21,30 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"commander": "^
|
|
24
|
+
"commander": "^9.3.0",
|
|
25
25
|
"node-html-parser": "^1.2.16",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"semver": "^7.3.7",
|
|
27
|
+
"uuid": "^8.3.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/cli": "^7.
|
|
31
|
-
"@babel/core": "^7.
|
|
30
|
+
"@babel/cli": "^7.17.10",
|
|
31
|
+
"@babel/core": "^7.18.2",
|
|
32
32
|
"@babel/eslint-parser": "^7.12.1",
|
|
33
33
|
"@babel/eslint-plugin": "^7.12.1",
|
|
34
34
|
"@babel/plugin-proposal-class-properties": "^7.12.1",
|
|
35
35
|
"@babel/plugin-transform-runtime": "^7.12.10",
|
|
36
|
-
"@babel/
|
|
37
|
-
"@babel/preset-env": "^7.12.11",
|
|
36
|
+
"@babel/preset-env": "^7.18.2",
|
|
38
37
|
"babel-loader": "^8.2.2",
|
|
39
|
-
"core-js": "^3.8
|
|
40
|
-
"eslint": "^
|
|
41
|
-
"eslint-config-standard": "^
|
|
38
|
+
"core-js": "^3.22.8",
|
|
39
|
+
"eslint": "^8.17.0",
|
|
40
|
+
"eslint-config-standard": "^17.0.0",
|
|
42
41
|
"eslint-plugin-import": "^2.20.1",
|
|
43
|
-
"eslint-plugin-jest": "^
|
|
44
|
-
"eslint-plugin-jsdoc": "^
|
|
42
|
+
"eslint-plugin-jest": "^26.5.3",
|
|
43
|
+
"eslint-plugin-jsdoc": "^39.3.2",
|
|
45
44
|
"eslint-plugin-node": "^11.0.0",
|
|
46
|
-
"eslint-plugin-promise": "^
|
|
47
|
-
"
|
|
48
|
-
"
|
|
45
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
46
|
+
"jest": "^28.1.1",
|
|
47
|
+
"regenerator-runtime": "^0.13.9",
|
|
49
48
|
"shelljs": "^0.8.4"
|
|
50
49
|
},
|
|
51
50
|
"repository": {
|
package/src/Story.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import Passage from './Passage.js';
|
|
2
|
-
import FileReader from './FileReader.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
const
|
|
3
|
+
const name = 'extwee';
|
|
4
|
+
const version = '2.0.5';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* @class Story
|
|
@@ -14,7 +13,7 @@ export default class Story {
|
|
|
14
13
|
*
|
|
15
14
|
* @private
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
#_name = '';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* Internal start
|
|
@@ -28,7 +27,7 @@ export default class Story {
|
|
|
28
27
|
*
|
|
29
28
|
* @private
|
|
30
29
|
*/
|
|
31
|
-
#_IFID = ''
|
|
30
|
+
#_IFID = '';
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* Internal story format
|
package/test/CLI/test2.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<tw-story></tw-story>
|
|
13
13
|
|
|
14
|
-
<tw-storydata name="twineExample" startnode="2" creator="extwee" creator-version="2.0.
|
|
14
|
+
<tw-storydata name="twineExample" startnode="2" creator="extwee" creator-version="2.0.5" ifid="2B68ECD6-348F-4CF5-96F8-549A512A8128" zoom="0" format="Harlowe" format-version="3.0.2" options hidden>
|
|
15
15
|
<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css">body {background-color: green;}</style>
|
|
16
16
|
<script role="script" id="twine-user-script" type="text/twine-javascript"></script>
|
|
17
17
|
<tw-passagedata pid="1" name="StoryTitle">twineExample</tw-passagedata>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<tw-story tags></tw-story>
|
|
12
|
-
<tw-storydata name="Title" startnode="4" creator="extwee" creator-version="2.0.
|
|
12
|
+
<tw-storydata name="Title" startnode="4" creator="extwee" creator-version="2.0.5" ifid="827B82ED-3279-4429-BCB6-3800F7AD3D2C" zoom="0" format="Snowman" format-version="2.0.0" options hidden>
|
|
13
13
|
<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>
|
|
14
14
|
<script role="script" id="twine-user-script" type="text/twine-javascript"></script>
|
|
15
15
|
<tw-passagedata pid="1" name="A"></tw-passagedata>
|
|
@@ -100,7 +100,7 @@ var saveAs=saveAs||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||f
|
|
|
100
100
|
<div id="init-lacking">Your browser lacks required capabilities. Please upgrade it or switch to another to continue.</div>
|
|
101
101
|
<div id="init-loading"><div>Loading…</div></div>
|
|
102
102
|
</div>
|
|
103
|
-
<tw-storydata name="twineExample" startnode="2" creator="extwee" creator-version="2.0.
|
|
103
|
+
<tw-storydata name="twineExample" startnode="2" creator="extwee" creator-version="2.0.5" ifid="2B68ECD6-348F-4CF5-96F8-549A512A8128" zoom="0" format="SugarCube" format-version="2.31.1" options hidden>
|
|
104
104
|
<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css">body {background-color: green;}</style>
|
|
105
105
|
<script role="script" id="twine-user-script" type="text/twine-javascript"></script>
|
|
106
106
|
<tw-passagedata pid="1" name="StoryTitle">twineExample</tw-passagedata>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<tw-story tags></tw-story>
|
|
12
|
-
<tw-storydata name="Title" startnode="4" creator="extwee" creator-version="2.0.
|
|
12
|
+
<tw-storydata name="Title" startnode="4" creator="extwee" creator-version="2.0.5" ifid="A1B257B5-F799-4618-9683-07B9F6BB6CE2" zoom="0" format="Snowman" format-version="2.0.0" options hidden>
|
|
13
13
|
<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>
|
|
14
14
|
<script role="script" id="twine-user-script" type="text/twine-javascript"></script>
|
|
15
15
|
<tw-passagedata pid="1" name="A"></tw-passagedata>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<tw-story tags></tw-story>
|
|
12
|
-
<tw-storydata name="Name" startnode="3" creator="extwee" creator-version="2.0.
|
|
12
|
+
<tw-storydata name="Name" startnode="3" creator="extwee" creator-version="2.0.5" ifid="64851070-16F0-410B-8C27-F90668C994BC" zoom="0" format="Snowman" format-version="2.0.0" options hidden>
|
|
13
13
|
<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>
|
|
14
14
|
<script role="script" id="twine-user-script" type="text/twine-javascript"></script>
|
|
15
15
|
<tw-passagedata pid="1" name="A"></tw-passagedata>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<tw-story></tw-story>
|
|
13
13
|
|
|
14
|
-
<tw-storydata name="Example1" startnode="4" creator="extwee" creator-version="2.0.
|
|
14
|
+
<tw-storydata name="Example1" startnode="4" creator="extwee" creator-version="2.0.5" ifid="CB42C064-4C1F-4D2B-9618-E9A7FCCE0AE2" zoom="0" format="Harlowe" format-version="3.0.2" options hidden>
|
|
15
15
|
<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>
|
|
16
16
|
<script role="script" id="twine-user-script" type="text/twine-javascript"></script>
|
|
17
17
|
<tw-passagedata pid="1" name="StoryTitle">Example1</tw-passagedata>
|