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 CHANGED
@@ -10,20 +10,18 @@ import Extwee from '../index.js';
10
10
  // Import Commander
11
11
  import { Command } from 'commander';
12
12
 
13
- // Creat a new Command
13
+ // Create a new Command
14
14
  const program = new Command();
15
15
 
16
16
  program
17
- .version('2.0.2')
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.D === true) {
35
- const inputHTML = Extwee.readFile(options.I);
32
+ if(options.d === true) {
33
+ const inputHTML = Extwee.readFile(options.i);
36
34
  const storyObject = Extwee.parseHTML(inputHTML);
37
- Extwee.writeTwee(storyObject, options.O);
35
+ Extwee.writeTwee(storyObject, options.o);
38
36
  process.exit();
39
37
  }
40
38
 
41
39
  // Compile branch
42
- if(options.C === true) {
43
- const inputTwee = Extwee.readFile(options.I);
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.S);
43
+ const inputStoryFormat = Extwee.readFile(options.s);
46
44
  const parsedStoryFormat = Extwee.parseStoryFormat(inputStoryFormat);
47
- Extwee.writeHTML(options.O, story, parsedStoryFormat);
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.4",
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": "^4.1.1",
24
+ "commander": "^9.3.0",
25
25
  "node-html-parser": "^1.2.16",
26
- "uuid": "^8.3.2",
27
- "semver": "^5.7.1"
26
+ "semver": "^7.3.7",
27
+ "uuid": "^8.3.2"
28
28
  },
29
29
  "devDependencies": {
30
- "@babel/cli": "^7.12.10",
31
- "@babel/core": "^7.12.10",
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/polyfill": "^7.12.1",
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.1",
40
- "eslint": "^7.7.0",
41
- "eslint-config-standard": "^14.1.0",
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": "^24.1.3",
44
- "eslint-plugin-jsdoc": "^30.2.1",
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": "^4.2.1",
47
- "eslint-plugin-standard": "^4.0.1",
48
- "jest": "^27.3.1",
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
- // Pull the name and version of this project from package.json.
5
- const { name, version } = JSON.parse(FileReader.read('package.json'));
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
- #_name = '';
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
@@ -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.3" ifid="2B68ECD6-348F-4CF5-96F8-549A512A8128" zoom="0" format="Harlowe" format-version="3.0.2" options hidden>
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.3" ifid="FA495CE5-0245-407C-8391-15160724A530" zoom="0" format="Snowman" format-version="2.0.0" options hidden>
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&hellip;</div></div>
102
102
  </div>
103
- <tw-storydata name="twineExample" startnode="2" creator="extwee" creator-version="2.0.3" ifid="2B68ECD6-348F-4CF5-96F8-549A512A8128" zoom="0" format="SugarCube" format-version="2.31.1" options hidden>
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.3" ifid="F4A62B98-964F-48EB-9509-EF041FA39EAF" zoom="0" format="Snowman" format-version="2.0.0" options hidden>
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.3" ifid="88EBC02F-BFD4-4450-8BAE-C9625483987B" zoom="0" format="Snowman" format-version="2.0.0" options hidden>
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.3" ifid="C4A583B9-6238-4C4B-A8BA-E6C8F4F937C8" zoom="0" format="Harlowe" format-version="3.0.2" options hidden>
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>
@@ -1,6 +1,6 @@
1
1
  :: StoryData
2
2
  {
3
- "ifid": "64C55055-202E-4B0A-A16B-9F068B9EF5E8",
3
+ "ifid": "040C569C-2902-48C7-B8FD-0471A2190DA6",
4
4
  "format": "Test",
5
5
  "format-version": "1.2.3",
6
6
  "zoom": 1,
@@ -1,6 +1,6 @@
1
1
  :: StoryData
2
2
  {
3
- "ifid": "AC524BC5-2F76-4460-A520-816F95026EE6",
3
+ "ifid": "C801ABDD-CA3B-4114-96B5-0AF843A11637",
4
4
  "start": "Start",
5
5
  "tag-colors": {
6
6
  "bar": "green",