extwee 2.3.11 → 2.3.13
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/CHANGELOG.md +219 -0
- package/CONTRIBUTING.md +305 -0
- package/README.md +16 -0
- package/build/extwee.core.min.js +1 -1
- package/build/extwee.twine1html.min.js +1 -1
- package/build/extwee.twine2archive.min.js +1 -1
- package/build/extwee.tws.min.js +1 -1
- package/logs/arrays.html +79 -0
- package/logs/arrays.twee +64 -0
- package/logs/example.html +47 -0
- package/logs/fixing.js +23 -0
- package/logs/format-fixed.js +8 -0
- package/logs/format.js +8 -0
- package/logs/test-entities.cjs +40 -0
- package/package.json +19 -16
- package/src/Story.js +2 -2
- package/types/src/Story.d.ts +1 -1
- package/.github/FUNDING.yml +0 -3
- package/.github/codeql-analysis.yml +0 -51
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/dependabot-automerge.yml +0 -23
- package/.github/workflows/nodejs.yml +0 -28
- package/.travis.yml +0 -13
- package/babel.config.json +0 -18
- package/docs/.nojekyll +0 -0
- package/docs/README.md +0 -224
- package/docs/_sidebar.md +0 -19
- package/docs/build/extwee.core.min.js +0 -1
- package/docs/build/extwee.twine1html.min.js +0 -1
- package/docs/build/extwee.twine2archive.min.js +0 -1
- package/docs/build/extwee.tws.min.js +0 -1
- package/docs/demos/compiler/extwee.core.min.js +0 -1
- package/docs/demos/compiler/index.css +0 -105
- package/docs/demos/compiler/index.html +0 -359
- package/docs/demos/decompile/extwee.core.min.js +0 -1
- package/docs/demos/decompile/index.css +0 -584
- package/docs/demos/decompile/index.html +0 -468
- package/docs/examples/dynamicPassages.md +0 -28
- package/docs/examples/jsonToTwee.md +0 -23
- package/docs/examples/twsToTwee.md +0 -25
- package/docs/formats/json.md +0 -17
- package/docs/formats/twee.md +0 -13
- package/docs/formats/twine1HTML.md +0 -13
- package/docs/formats/twine2ArchiveHTML.md +0 -13
- package/docs/formats/twine2HTML.md +0 -13
- package/docs/formats/tws.md +0 -9
- package/docs/index.html +0 -26
- package/docs/install/npm.md +0 -16
- package/docs/install/npx.md +0 -79
- package/docs/objects/passage.md +0 -47
- package/docs/objects/story.md +0 -69
- package/docs/objects/storyformat.md +0 -27
- package/eslint.config.js +0 -28
- package/extwee.config.json +0 -6
- package/extwee.config.md +0 -67
- package/jest.config.json +0 -5
- package/test/CLI/CLI.test.js +0 -49
- package/test/CLI/files/example.json +0 -1
- package/test/CLI/files/example6.twee +0 -22
- package/test/CLI/files/harlowe.js +0 -3
- package/test/CLI/files/input.html +0 -47
- package/test/CLI/files/output/test.twee +0 -0
- package/test/CLI/files/test.twee +0 -18
- package/test/CLI/files/tweeExample.twee +0 -17
- package/test/CLI/files/twine1/LICENSE.txt +0 -32
- package/test/CLI/files/twine1/code.js +0 -5
- package/test/CLI/files/twine1/engine.js +0 -43
- package/test/CLI/files/twine1/header.html +0 -325
- package/test/CLI/files/twine1Test.html +0 -371
- package/test/CLI/files/twineExample.html +0 -16
- package/test/Config/Config.test.js +0 -76
- package/test/Config/files/empty.json +0 -3
- package/test/Config/files/full.json +0 -8
- package/test/Config/files/invalid.json +0 -1
- package/test/Config/files/valid.json +0 -6
- package/test/Config/isDirectory.test.js +0 -50
- package/test/Config/isFile.test.js +0 -53
- package/test/Config/loadStoryFormat.test.js +0 -117
- package/test/Config/readDirectories.test.js +0 -78
- package/test/IFID/IFID.Generate.test.js +0 -10
- package/test/JSON/JSON.Parse.test.js +0 -316
- package/test/Objects/Passage.test.js +0 -274
- package/test/Objects/SnowmanCompatibility.test.js +0 -111
- package/test/Objects/Story.test.js +0 -1075
- package/test/Objects/StoryFormat.test.js +0 -219
- package/test/Roundtrip/Files/Example1.html +0 -64
- package/test/Roundtrip/Files/LICENSE +0 -19
- package/test/Roundtrip/Files/example1.twee +0 -10
- package/test/Roundtrip/Files/example2.twee +0 -27
- package/test/Roundtrip/Files/example4.twee +0 -27
- package/test/Roundtrip/Files/harlowe.js +0 -3
- package/test/Roundtrip/Files/round.html +0 -49
- package/test/Roundtrip/Roundtrip.test.js +0 -54
- package/test/StoryFormat/StoryFormat.Parse.test.js +0 -479
- package/test/TWS/Parse.test.js +0 -56
- package/test/TWS/TWSParser/Example5.tws +0 -414
- package/test/TWS/TWSParser/noscale.tws +0 -0
- package/test/TWS/TWSParser/nostory.tws +0 -0
- package/test/Twee/Twee.Escaping.test.js +0 -200
- package/test/Twee/Twee.Parse.test.js +0 -108
- package/test/Twee/TweeParser/cursed.twee +0 -16
- package/test/Twee/TweeParser/cycling.twee +0 -75
- package/test/Twee/TweeParser/emptytags.twee +0 -2
- package/test/Twee/TweeParser/example.twee +0 -32
- package/test/Twee/TweeParser/malformed.twee +0 -2
- package/test/Twee/TweeParser/missing.twee +0 -19
- package/test/Twee/TweeParser/multipleScriptPassages.twee +0 -19
- package/test/Twee/TweeParser/multipleStyleTag.twee +0 -19
- package/test/Twee/TweeParser/multipletags.twee +0 -10
- package/test/Twee/TweeParser/noTitle.twee +0 -2
- package/test/Twee/TweeParser/notes.twee +0 -16
- package/test/Twee/TweeParser/pasagemetadataerror.twee +0 -2
- package/test/Twee/TweeParser/scriptPassage.twee +0 -16
- package/test/Twee/TweeParser/singletag.twee +0 -13
- package/test/Twee/TweeParser/start.twee +0 -2
- package/test/Twee/TweeParser/startMetadata.twee +0 -14
- package/test/Twee/TweeParser/storydataerror.twee +0 -25
- package/test/Twee/TweeParser/style.twee +0 -16
- package/test/Twee/TweeParser/stylePassage.twee +0 -16
- package/test/Twee/TweeParser/test.twee +0 -25
- package/test/Twine1HTML/Twine1HTML.Compile.test.js +0 -180
- package/test/Twine1HTML/Twine1HTML.Parse.Web.test.js +0 -484
- package/test/Twine1HTML/Twine1HTML.Parse.test.js +0 -183
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/LICENSE +0 -674
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/engine.js +0 -43
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/jquery.js +0 -4
- package/test/Twine1HTML/Twine1HTMLCompiler/Twine1/modernizr.js +0 -4
- package/test/Twine1HTML/Twine1HTMLCompiler/engineTest.html +0 -1
- package/test/Twine1HTML/Twine1HTMLCompiler/jonah-1.4.2/LICENSE +0 -32
- package/test/Twine1HTML/Twine1HTMLCompiler/jonah-1.4.2/code.js +0 -4
- package/test/Twine1HTML/Twine1HTMLCompiler/jonah-1.4.2/header.html +0 -327
- package/test/Twine1HTML/Twine1HTMLCompiler/test.html +0 -0
- package/test/Twine1HTML/Twine1HTMLCompiler/test1.html +0 -6
- package/test/Twine1HTML/Twine1HTMLCompiler/test2.html +0 -6
- package/test/Twine1HTML/Twine1HTMLCompiler/test3.html +0 -43
- package/test/Twine1HTML/Twine1HTMLCompiler/test4.html +0 -372
- package/test/Twine1HTML/Twine1HTMLCompiler/test5.html +0 -372
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTML.Compile.test.js +0 -35
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTML.Parse.Web.test.js +0 -293
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTML.Parse.test.js +0 -42
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTMLCompiler/test1.html +0 -6
- package/test/Twine2ArchiveHTML/Twine2ArchiveHTMLParser/test1.html +0 -3
- package/test/Twine2HTML/Twine2HTML.Compile.test.js +0 -139
- package/test/Twine2HTML/Twine2HTML.Parse.Web.test.js +0 -329
- package/test/Twine2HTML/Twine2HTML.Parse.test.js +0 -192
- package/test/Twine2HTML/Twine2HTMLCompiler/TestTags.html +0 -42
- package/test/Twine2HTML/Twine2HTMLCompiler/creator.html +0 -50
- package/test/Twine2HTML/Twine2HTMLCompiler/example6.twee +0 -16
- package/test/Twine2HTML/Twine2HTMLCompiler/format.js +0 -9
- package/test/Twine2HTML/Twine2HTMLCompiler/missingStoryTitle.twee +0 -29
- package/test/Twine2HTML/Twine2HTMLCompiler/test11.html +0 -121
- package/test/Twine2HTML/Twine2HTMLCompiler/test2.html +0 -58
- package/test/Twine2HTML/Twine2HTMLCompiler/test3.html +0 -49
- package/test/Twine2HTML/Twine2HTMLCompiler/test4.html +0 -50
- package/test/Twine2HTML/Twine2HTMLCompiler/test6.html +0 -49
- package/test/Twine2HTML/Twine2HTMLParser/Example1.html +0 -53
- package/test/Twine2HTML/Twine2HTMLParser/Tags.html +0 -15
- package/test/Twine2HTML/Twine2HTMLParser/lyingStartnode.html +0 -15
- package/test/Twine2HTML/Twine2HTMLParser/lyingTagColors.html +0 -48
- package/test/Twine2HTML/Twine2HTMLParser/missingCreator.html +0 -11
- package/test/Twine2HTML/Twine2HTMLParser/missingCreatorVersion.html +0 -11
- package/test/Twine2HTML/Twine2HTMLParser/missingFormat.html +0 -11
- package/test/Twine2HTML/Twine2HTMLParser/missingFormatVersion.html +0 -11
- package/test/Twine2HTML/Twine2HTMLParser/missingIFID.html +0 -11
- package/test/Twine2HTML/Twine2HTMLParser/missingPassageTags.html +0 -15
- package/test/Twine2HTML/Twine2HTMLParser/missingPosition.html +0 -15
- package/test/Twine2HTML/Twine2HTMLParser/missingScript.html +0 -14
- package/test/Twine2HTML/Twine2HTMLParser/missingSize.html +0 -35
- package/test/Twine2HTML/Twine2HTMLParser/missingStartnode.html +0 -11
- package/test/Twine2HTML/Twine2HTMLParser/missingStyle.html +0 -14
- package/test/Twine2HTML/Twine2HTMLParser/missingZoom.html +0 -11
- package/test/Twine2HTML/Twine2HTMLParser/tagColors.html +0 -31
- package/test/Twine2HTML/Twine2HTMLParser/twineExample.html +0 -23
- package/test/Twine2HTML/Twine2HTMLParser/twineExample2.html +0 -15
- package/test/Twine2HTML/Twine2HTMLParser/twineExample3.html +0 -15
- package/test/Twine2HTML/Twine2HTMLParser/unescaping.html +0 -33
- package/test/Web/web-core-coverage.test.js +0 -175
- package/test/Web/web-core-global.test.js +0 -93
- package/test/Web/web-core.test.js +0 -156
- package/test/Web/web-exports.test.js +0 -136
- package/test/Web/web-twine1html.test.js +0 -105
- package/test/Web/web-twine2archive.test.js +0 -96
- package/test/Web/web-tws.test.js +0 -77
- package/test/Web/window.Extwee.test.js +0 -97
- package/tsconfig.json +0 -21
- package/webpack.config.js +0 -47
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import StoryFormat from '../../src/StoryFormat.js';
|
|
2
|
-
|
|
3
|
-
describe('StoryFormat', () => {
|
|
4
|
-
describe('Default values', () => {
|
|
5
|
-
it('Should have default values', () => {
|
|
6
|
-
const sf = new StoryFormat();
|
|
7
|
-
expect(sf.name).toBe('Untitled Story Format');
|
|
8
|
-
expect(sf.version).toBe('');
|
|
9
|
-
expect(sf.author).toBe('');
|
|
10
|
-
expect(sf.image).toBe('');
|
|
11
|
-
expect(sf.url).toBe('');
|
|
12
|
-
expect(sf.license).toBe('');
|
|
13
|
-
expect(sf.proofing).toBe(false);
|
|
14
|
-
expect(sf.source).toBe('');
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe('Constructor with default values', () => {
|
|
19
|
-
it('Should create an instance of StoryFormat', () => {
|
|
20
|
-
const sf = new StoryFormat();
|
|
21
|
-
expect(sf).toBeInstanceOf(StoryFormat);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
describe('Constructor with parameters', () => {
|
|
26
|
-
it('Should create an instance of StoryFormat with parameters', () => {
|
|
27
|
-
const sf = new StoryFormat('name', 'version', 'description', 'author', 'image', 'url', 'license', true, 'source');
|
|
28
|
-
expect(sf).toBeInstanceOf(StoryFormat);
|
|
29
|
-
expect(sf.name).toBe('name');
|
|
30
|
-
expect(sf.version).toBe('version');
|
|
31
|
-
expect(sf.description).toBe('description');
|
|
32
|
-
expect(sf.author).toBe('author');
|
|
33
|
-
expect(sf.image).toBe('image');
|
|
34
|
-
expect(sf.url).toBe('url');
|
|
35
|
-
expect(sf.license).toBe('license');
|
|
36
|
-
expect(sf.proofing).toBe(true);
|
|
37
|
-
expect(sf.source).toBe('source');
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe('name', () => {
|
|
42
|
-
it('Set new String', () => {
|
|
43
|
-
const sf = new StoryFormat();
|
|
44
|
-
sf.name = 'New';
|
|
45
|
-
expect(sf.name).toBe('New');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('Throw error if non-String', () => {
|
|
49
|
-
const sf = new StoryFormat();
|
|
50
|
-
expect(() => {
|
|
51
|
-
sf.name = 1;
|
|
52
|
-
}).toThrow();
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
describe('version', () => {
|
|
57
|
-
it('Set new String', () => {
|
|
58
|
-
const sf = new StoryFormat();
|
|
59
|
-
sf.version = 'New';
|
|
60
|
-
expect(sf.version).toBe('New');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('Throw error if non-String', () => {
|
|
64
|
-
const sf = new StoryFormat();
|
|
65
|
-
expect(() => {
|
|
66
|
-
sf.version = 1;
|
|
67
|
-
}).toThrow();
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe('author', () => {
|
|
72
|
-
it('Set new String', () => {
|
|
73
|
-
const sf = new StoryFormat();
|
|
74
|
-
sf.author = 'New';
|
|
75
|
-
expect(sf.author).toBe('New');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('Throw error if non-String', () => {
|
|
79
|
-
const sf = new StoryFormat();
|
|
80
|
-
expect(() => {
|
|
81
|
-
sf.author = 1;
|
|
82
|
-
}).toThrow();
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe('image', () => {
|
|
87
|
-
it('Set new String', () => {
|
|
88
|
-
const sf = new StoryFormat();
|
|
89
|
-
sf.image = 'New';
|
|
90
|
-
expect(sf.image).toBe('New');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('Throw error if non-String', () => {
|
|
94
|
-
const sf = new StoryFormat();
|
|
95
|
-
expect(() => {
|
|
96
|
-
sf.image = 1;
|
|
97
|
-
}).toThrow();
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe('url', () => {
|
|
102
|
-
it('Set new String', () => {
|
|
103
|
-
const sf = new StoryFormat();
|
|
104
|
-
sf.url = 'New';
|
|
105
|
-
expect(sf.url).toBe('New');
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('Throw error if non-String', () => {
|
|
109
|
-
const sf = new StoryFormat();
|
|
110
|
-
expect(() => {
|
|
111
|
-
sf.url = 1;
|
|
112
|
-
}).toThrow();
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
describe('license', () => {
|
|
117
|
-
it('Set new String', () => {
|
|
118
|
-
const sf = new StoryFormat();
|
|
119
|
-
sf.license = 'New';
|
|
120
|
-
expect(sf.license).toBe('New');
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it('Throw error if non-String', () => {
|
|
124
|
-
const sf = new StoryFormat();
|
|
125
|
-
expect(() => {
|
|
126
|
-
sf.license = 1;
|
|
127
|
-
}).toThrow();
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
describe('proofing', () => {
|
|
132
|
-
it('Set new String', () => {
|
|
133
|
-
const sf = new StoryFormat();
|
|
134
|
-
sf.proofing = true;
|
|
135
|
-
expect(sf.proofing).toBe(true);
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
it('Throw error if non-String', () => {
|
|
139
|
-
const sf = new StoryFormat();
|
|
140
|
-
expect(() => {
|
|
141
|
-
sf.proofing = 1;
|
|
142
|
-
}).toThrow();
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
describe('source', () => {
|
|
147
|
-
it('Set new String', () => {
|
|
148
|
-
const sf = new StoryFormat();
|
|
149
|
-
sf.source = 'New';
|
|
150
|
-
expect(sf.source).toBe('New');
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('Throw error if non-String', () => {
|
|
154
|
-
const sf = new StoryFormat();
|
|
155
|
-
expect(() => {
|
|
156
|
-
sf.source = 1;
|
|
157
|
-
}).toThrow();
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
describe('description', () => {
|
|
162
|
-
it('Set new String', () => {
|
|
163
|
-
const sf = new StoryFormat();
|
|
164
|
-
sf.description = 'New';
|
|
165
|
-
expect(sf.description).toBe('New');
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it('Throw error if non-String', () => {
|
|
169
|
-
const sf = new StoryFormat();
|
|
170
|
-
expect(() => {
|
|
171
|
-
sf.description = 1;
|
|
172
|
-
}).toThrow();
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
describe('toString', () => {
|
|
177
|
-
it('Should return string representation', () => {
|
|
178
|
-
const sf = new StoryFormat();
|
|
179
|
-
sf.version = '1.0.0';
|
|
180
|
-
expect(sf.toString()).toBe(JSON.stringify(sf, null, '\t'));
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it('Should throw error if version is not valid', () => {
|
|
184
|
-
const sf = new StoryFormat();
|
|
185
|
-
expect(() => {
|
|
186
|
-
sf.toString();
|
|
187
|
-
}).toThrow();
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
describe('toJSON', () => {
|
|
192
|
-
it('Should return JSON representation with default name', () => {
|
|
193
|
-
const sf = new StoryFormat();
|
|
194
|
-
sf.version = '1.0.0';
|
|
195
|
-
expect(sf.toJSON().includes("Untitled Story Format")).toEqual(true);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it('Should return JSON representation with custom name', () => {
|
|
199
|
-
const sf = new StoryFormat();
|
|
200
|
-
sf.name = 'Custom Name';
|
|
201
|
-
sf.version = '1.0.0';
|
|
202
|
-
expect(sf.toJSON().includes("Custom Name")).toEqual(true);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it('Should overwrite with default name if name is empty string', () => {
|
|
206
|
-
const sf = new StoryFormat();
|
|
207
|
-
sf.name = '';
|
|
208
|
-
sf.version = '1.0.0';
|
|
209
|
-
expect(sf.toJSON().includes("Untitled Story Format")).toEqual(true);
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
it('Should throw error if version is not valid', () => {
|
|
213
|
-
const sf = new StoryFormat();
|
|
214
|
-
expect(() => {
|
|
215
|
-
sf.toJSON();
|
|
216
|
-
}).toThrow();
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
});
|