extwee 2.2.1 → 2.2.3

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.
Files changed (68) hide show
  1. package/.eslintrc.json +7 -13
  2. package/.github/codeql-analysis.yml +51 -0
  3. package/README.md +9 -3
  4. package/build/extwee +0 -0
  5. package/build/extwee.web.min.js +1 -1
  6. package/docs/objects/story.md +1 -2
  7. package/index.js +2 -0
  8. package/jest.config.json +5 -0
  9. package/package.json +24 -21
  10. package/src/IFID/generate.js +20 -0
  11. package/src/JSON/parse.js +43 -0
  12. package/src/Passage.js +52 -3
  13. package/src/Story.js +266 -107
  14. package/src/StoryFormat/parse.js +190 -80
  15. package/src/StoryFormat.js +78 -88
  16. package/src/TWS/parse.js +2 -2
  17. package/src/Twee/parse.js +2 -3
  18. package/src/Twine1HTML/compile.js +2 -0
  19. package/src/Twine1HTML/parse.js +2 -3
  20. package/src/Twine2ArchiveHTML/compile.js +8 -0
  21. package/src/Twine2ArchiveHTML/parse.js +33 -3
  22. package/src/Twine2HTML/compile.js +31 -6
  23. package/src/Twine2HTML/parse.js +49 -54
  24. package/test/IFID/IFID.Generate.test.js +10 -0
  25. package/test/JSON/JSON.Parse.test.js +4 -4
  26. package/test/{Passage.test.js → Objects/Passage.test.js} +4 -4
  27. package/test/{Story.test.js → Objects/Story.test.js} +259 -50
  28. package/test/{StoryFormat.test.js → Objects/StoryFormat.test.js} +10 -3
  29. package/test/StoryFormat/StoryFormat.Parse.test.js +442 -55
  30. package/test/TWS/Parse.test.js +1 -1
  31. package/test/Twine2ArchiveHTML/Twine2ArchiveHTML.Parse.test.js +20 -4
  32. package/test/Twine2HTML/Twine2HTML.Compile.test.js +35 -120
  33. package/test/Twine2HTML/Twine2HTML.Parse.test.js +57 -38
  34. package/test/Twine2HTML/Twine2HTMLCompiler/format.js +9 -0
  35. package/test/Twine2HTML/Twine2HTMLParser/missingZoom.html +1 -1
  36. package/types/IFID/generate.d.ts +14 -0
  37. package/types/JSON/parse.d.ts +51 -0
  38. package/types/Passage.d.ts +117 -0
  39. package/types/Story.d.ts +230 -0
  40. package/types/StoryFormat/parse.d.ts +50 -0
  41. package/types/StoryFormat.d.ts +121 -0
  42. package/types/TWS/parse.d.ts +10 -0
  43. package/types/Twee/parse.d.ts +9 -0
  44. package/types/Twine1HTML/compile.d.ts +19 -0
  45. package/types/Twine1HTML/parse.d.ts +9 -0
  46. package/types/Twine2ArchiveHTML/compile.d.ts +14 -0
  47. package/types/Twine2ArchiveHTML/parse.d.ts +36 -0
  48. package/types/Twine2HTML/compile.d.ts +14 -0
  49. package/types/Twine2HTML/parse.d.ts +20 -0
  50. package/web-index.js +2 -0
  51. package/test/StoryFormat/StoryFormatParser/example.js +0 -3
  52. package/test/StoryFormat/StoryFormatParser/example2.js +0 -3
  53. package/test/StoryFormat/StoryFormatParser/format.js +0 -1
  54. package/test/StoryFormat/StoryFormatParser/format_doublename.js +0 -1
  55. package/test/StoryFormat/StoryFormatParser/harlowe.js +0 -3
  56. package/test/StoryFormat/StoryFormatParser/missingAuthor.js +0 -1
  57. package/test/StoryFormat/StoryFormatParser/missingDescription.js +0 -1
  58. package/test/StoryFormat/StoryFormatParser/missingImage.js +0 -1
  59. package/test/StoryFormat/StoryFormatParser/missingLicense.js +0 -1
  60. package/test/StoryFormat/StoryFormatParser/missingName.js +0 -1
  61. package/test/StoryFormat/StoryFormatParser/missingProofing.js +0 -1
  62. package/test/StoryFormat/StoryFormatParser/missingSource.js +0 -1
  63. package/test/StoryFormat/StoryFormatParser/missingURL.js +0 -1
  64. package/test/StoryFormat/StoryFormatParser/missingVersion.js +0 -1
  65. package/test/StoryFormat/StoryFormatParser/versionWrong.js +0 -1
  66. package/test/Twine2HTML/Twine2HTMLParser/missingName.html +0 -33
  67. package/test/Twine2HTML/Twine2HTMLParser/missingPID.html +0 -15
  68. package/test/Twine2HTML/Twine2HTMLParser/missingPassageName.html +0 -15
package/.eslintrc.json CHANGED
@@ -1,25 +1,19 @@
1
1
  {
2
2
  "env": {
3
3
  "browser": true,
4
- "es2023": true,
4
+ "es2021": true,
5
+ "node": true,
5
6
  "jest/globals": true
6
7
  },
7
- "extends": [
8
- "standard",
9
- "plugin:jest/recommended",
10
- "plugin:jsdoc/recommended"
11
- ],
8
+ "extends": "standard",
12
9
  "parserOptions": {
13
- "ecmaVersion": 13,
10
+ "ecmaVersion": "latest",
14
11
  "sourceType": "module"
15
12
  },
16
13
  "rules": {
17
- "semi": ["error", "always"]
14
+ "semi": [2, "always"]
18
15
  },
19
16
  "plugins": [
20
- "jest",
21
- "@babel",
22
- "jsdoc"
23
- ],
24
- "parser": "@babel/eslint-parser"
17
+ "jest"
18
+ ]
25
19
  }
@@ -0,0 +1,51 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [ develop ]
6
+ paths-ignore:
7
+ - 'test/**'
8
+ pull_request:
9
+ branches: [ develop ]
10
+ paths-ignore:
11
+ - 'test/**'
12
+
13
+ jobs:
14
+ analyze:
15
+ name: Analyze
16
+ runs-on: ubuntu-latest
17
+
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ language: [ 'javascript' ]
22
+
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@v3
26
+
27
+ - name: Initialize CodeQL
28
+ uses: github/codeql-action/init@v2
29
+ with:
30
+ languages: ${{ matrix.language }}
31
+
32
+ - name: Perform CodeQL Analysis
33
+ uses: github/codeql-action/analyze@v2
34
+ with:
35
+ upload: false # disable the upload here - we will upload in a different action
36
+ output: sarif-results
37
+
38
+ - name: filter-sarif
39
+ uses: advanced-security/filter-sarif@v1
40
+ with:
41
+ # filter out all test files unless they contain a sql-injection vulnerability
42
+ patterns:
43
+ -test/**/*
44
+ +test/**/*:js/sql-injection
45
+ input: sarif-results/${{ matrix.language }}.sarif
46
+ output: sarif-results/${{ matrix.language }}.sarif
47
+
48
+ - name: Upload SARIF
49
+ uses: github/codeql-action/upload-sarif@v2
50
+ with:
51
+ sarif_file: sarif-results/${{ matrix.language }}.sarif
package/README.md CHANGED
@@ -27,11 +27,11 @@
27
27
 
28
28
  ## Story Compilation
29
29
 
30
- The process of *story compilation* converts human-readable content, what is generally called a *story*, into a playable format such as HyperText Markup Language (HTML) able to be read by another application such as a web browser. The result is then presented as links or other visual, interactive elements to a player or reader, depending on the work created.
30
+ The process of *story compilation* converts human-readable content, what is generally called a *story*, into a playable format such as HyperText Markup Language (HTML). The result is then presented as links or other visual, interactive elements for another party to interact with to see its content.
31
31
 
32
- The term *compilation* is used because different parts of code are put together in a specific arrangement to enable later play. As part of Twine-compatible HTML, this means combining story format JavaScript code with story HTML data.
32
+ The term *compilation* is used because different parts of code are put together in a specific arrangement to enable later play. As part of Twine-compatible HTML, this means combining JavaScript code (generally a "story format") with story HTML data.
33
33
 
34
- Extwee is **not** an authoring tool. It cannot be used to create story content. This data must be created using other tools or processes. Extwee can then *compile* the story with story format code to produce something playable.
34
+ Extwee is **not** an authoring tool. It cannot be used to create story content. This data must be created using other tools or processes. Extwee can then *compile* the content with story format code to produce something playable.
35
35
 
36
36
  Playable formats are the following and require external story formats[^1] to enable play:
37
37
 
@@ -113,6 +113,12 @@ Compiles story, story formats, or other data into an archive or playable format.
113
113
 
114
114
  **Note:** In order to create playable Twine 1 HTML, an `engine.js` file must be supplied.
115
115
 
116
+ ### Support Functionality
117
+
118
+ Multiple Twine formats support using [an IFID](https://ifdb.org/help-ifid) to identify one work from another.
119
+
120
+ As part of its API, the Extwee method `generateIFID()` can be used to create a new IFID for a `Story` object or as part of other processes.
121
+
116
122
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
117
123
 
118
124
  ## Documentation
package/build/extwee CHANGED
Binary file