eyeleng 1.0.7 → 1.0.8
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/package.json +2 -1
- package/playground.html +16 -4
- package/reports/w3c-shacl12-rules-earl.ttl +1337 -1056
- package/test/browser-bundle.test.js +8 -0
- package/test/shacl12-rules.test.js +0 -8
- package/test/w3c-rdf.test.js +0 -3
- package/tools/bundle.js +0 -17
|
@@ -44,4 +44,12 @@ test('playground inline scripts are syntactically valid', () => {
|
|
|
44
44
|
assert.ok(checked > 0, 'expected at least one inline playground script');
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
+
|
|
48
|
+
test('playground loads version from package.json at runtime', () => {
|
|
49
|
+
const html = fs.readFileSync(path.join(root, 'playground.html'), 'utf8');
|
|
50
|
+
assert.equal(/window\.__EYELENG_VERSION__/.test(html), false, 'playground.html must not hard-code the package version');
|
|
51
|
+
assert.match(html, /fetch\(new URL\(['"]package\.json['"],\s*window\.location\.href\)/);
|
|
52
|
+
assert.match(html, /id=["']version-label["'][^>]*>v…<\/span>/);
|
|
53
|
+
});
|
|
54
|
+
|
|
47
55
|
main();
|
|
@@ -10,7 +10,6 @@ const {
|
|
|
10
10
|
isW3cRequired,
|
|
11
11
|
runShacl12RulesManifest,
|
|
12
12
|
formatShacl12RulesProgressLine,
|
|
13
|
-
writeShacl12RulesEarlReport,
|
|
14
13
|
} = require('../src/shacl12RulesManifest.js');
|
|
15
14
|
|
|
16
15
|
const rootManifestUrl = process.env.EYELENG_SHACL12_RULES_MANIFEST || defaultShacl12RulesManifestUrl;
|
|
@@ -46,13 +45,6 @@ async function main() {
|
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
try {
|
|
50
|
-
const reportPath = writeShacl12RulesEarlReport(result);
|
|
51
|
-
console.log(`${C.dim}EARL report: ${path.relative(path.join(__dirname, '..'), reportPath)}${C.n}`);
|
|
52
|
-
} catch (err) {
|
|
53
|
-
console.error(`Failed to write SHACL Rules EARL report: ${err.message}`);
|
|
54
|
-
result.counts.fail += 1;
|
|
55
|
-
}
|
|
56
48
|
|
|
57
49
|
for (const section of result.bySection) {
|
|
58
50
|
summaryLine(section.failed === 0 ? 'ok' : 'fail', section.passed, section.total, null, { label: section.section });
|
package/test/w3c-rdf.test.js
CHANGED
|
@@ -9,7 +9,6 @@ const {
|
|
|
9
9
|
defaultW3cRdfManifestUrls,
|
|
10
10
|
runW3cRdfManifests,
|
|
11
11
|
formatW3cRdfProgressLine,
|
|
12
|
-
writeRdfEarlReport,
|
|
13
12
|
} = require('../src/rdfManifest.js');
|
|
14
13
|
const { parseNQuads, parseN3 } = require('../src/rdfSyntax.js');
|
|
15
14
|
const { evaluateEntailmentTest, entails } = require('../src/rdfEntailment.js');
|
|
@@ -186,8 +185,6 @@ test('official W3C RDF manifests run with streaming progress when reachable', as
|
|
|
186
185
|
}
|
|
187
186
|
assert.equal(result.counts.fail, 0, `${result.counts.fail} W3C RDF failure(s)`);
|
|
188
187
|
assert.ok(result.counts.pass > 0, 'expected at least one W3C RDF parser test to pass');
|
|
189
|
-
const reportPath = writeRdfEarlReport(result);
|
|
190
|
-
console.log(`${C.dim}EARL report: ${path.relative(path.join(__dirname, '..'), reportPath)}${C.n}`);
|
|
191
188
|
summaryLine('ok', result.counts.pass, result.counts.total, result.durationMs, {
|
|
192
189
|
skipped: result.counts.skip,
|
|
193
190
|
label: 'W3C RDF manifests',
|
package/tools/bundle.js
CHANGED
|
@@ -57,22 +57,6 @@ function js(value) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
function packageVersion() {
|
|
61
|
-
const packageJson = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
62
|
-
if (!packageJson.version) throw new Error('package.json is missing a version');
|
|
63
|
-
return packageJson.version;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function syncPlaygroundVersion() {
|
|
67
|
-
const version = packageVersion();
|
|
68
|
-
const outPath = path.join(root, playgroundOutput);
|
|
69
|
-
const html = fs.readFileSync(outPath, 'utf8');
|
|
70
|
-
const pattern = /(window\.__EYELENG_VERSION__\s*=\s*)["'][^"']*["']\s*;/;
|
|
71
|
-
if (!pattern.test(html)) throw new Error('Could not find window.__EYELENG_VERSION__ in playground.html');
|
|
72
|
-
const next = html.replace(pattern, `$1${js(version)};`);
|
|
73
|
-
fs.writeFileSync(outPath, next, 'utf8');
|
|
74
|
-
console.log(`wrote ${playgroundOutput} version ${version}`);
|
|
75
|
-
}
|
|
76
60
|
|
|
77
61
|
function ensureParentDir(filename) {
|
|
78
62
|
fs.mkdirSync(path.dirname(filename), { recursive: true });
|
|
@@ -172,4 +156,3 @@ function indent(source, spaces) {
|
|
|
172
156
|
|
|
173
157
|
buildCli();
|
|
174
158
|
buildBrowser();
|
|
175
|
-
syncPlaygroundVersion();
|