@eltjs/elt 0.1.2 → 0.1.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.
|
@@ -52,7 +52,7 @@ export class DocumentText extends Rule {
|
|
|
52
52
|
}
|
|
53
53
|
catch (failure) {
|
|
54
54
|
if (signal?.aborted ||
|
|
55
|
-
(failure
|
|
55
|
+
(Error.isError(failure) && failure.name === 'AbortError'))
|
|
56
56
|
return { gone: true };
|
|
57
57
|
// A commit removed the copy after the refresh listed it; its rows
|
|
58
58
|
// are gone too, so the file is not a failure.
|
package/dist/core/identifiers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { hash } from 'node:crypto';
|
|
2
|
+
function shortHash(name) {
|
|
3
|
+
return hash('sha256', name).slice(0, 8);
|
|
4
4
|
}
|
|
5
5
|
// Airbyte's rule: decomposed marks dropped, every run of whitespace and every
|
|
6
6
|
// other character outside [A-Za-z0-9_] replaced by `_`, case kept, and a
|
|
@@ -40,12 +40,12 @@ export class Identifiers {
|
|
|
40
40
|
const clean = sanitize(name);
|
|
41
41
|
return clean === name
|
|
42
42
|
? this.#fit(name, name)
|
|
43
|
-
: this.#fit(`${clean}_${
|
|
43
|
+
: this.#fit(`${clean}_${shortHash(name)}`, name);
|
|
44
44
|
}
|
|
45
45
|
// A sanitized name is ASCII, so cutting it by bytes keeps whole characters.
|
|
46
46
|
#fit(name, original) {
|
|
47
47
|
if (Buffer.byteLength(name) <= this.maxBytes)
|
|
48
48
|
return name;
|
|
49
|
-
return `${name.slice(0, this.maxBytes - 9)}_${
|
|
49
|
+
return `${name.slice(0, this.maxBytes - 9)}_${shortHash(original)}`;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash, randomUUID } from 'node:crypto';
|
|
1
|
+
import { createHash, hash, randomUUID } from 'node:crypto';
|
|
2
2
|
import { link, lstat, mkdir, open, readdir, rm } from 'node:fs/promises';
|
|
3
3
|
import { dirname, join, resolve } from 'node:path';
|
|
4
4
|
import { fileExtension } from '../core/file-extension.js';
|
|
@@ -26,7 +26,7 @@ export class LocalFiles extends FileStorage {
|
|
|
26
26
|
}
|
|
27
27
|
// The scope's folder, relative to the storage folder.
|
|
28
28
|
scopeFolder(scope) {
|
|
29
|
-
return join('.elt-files',
|
|
29
|
+
return join('.elt-files', hash('sha256', scope));
|
|
30
30
|
}
|
|
31
31
|
async inspect(path) {
|
|
32
32
|
const info = await lstat(path).catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eltjs/elt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A pipeline that copies the data of apps and services into stores that SQL can read: sources, streams, checkpoints, watches and derived datasets.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|