@haibun/domain-storage 1.13.6 → 1.13.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/build/AStorage.d.ts +7 -8
- package/build/AStorage.js +40 -47
- package/build/AStorage.js.map +1 -1
- package/build/domain-storage.d.ts +11 -12
- package/build/domain-storage.js +39 -47
- package/build/domain-storage.js.map +1 -1
- package/build/domain-storage.test.d.ts +0 -1
- package/build/domain-storage.test.js +2 -7
- package/build/domain-storage.test.js.map +1 -1
- package/index.js +1 -0
- package/package.json +9 -20
- package/build/AStorage.d.ts.map +0 -1
- package/build/domain-storage.d.ts.map +0 -1
- package/build/domain-storage.test.d.ts.map +0 -1
package/build/AStorage.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { AStepper, TNamed } from "@haibun/core/build/lib/defs";
|
|
3
|
-
import { TLocationOptions, TMediaType } from "./domain-storage";
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { AStepper, TNamed } from "@haibun/core/build/lib/defs.js";
|
|
3
|
+
import { TLocationOptions, TMediaType } from "./domain-storage.js";
|
|
4
4
|
export interface IFile {
|
|
5
5
|
name: string;
|
|
6
6
|
isDirectory: boolean;
|
|
@@ -32,20 +32,19 @@ export declare abstract class AStorage extends AStepper {
|
|
|
32
32
|
steps: {
|
|
33
33
|
setLatest: {
|
|
34
34
|
gwta: string;
|
|
35
|
-
action: ({ where, what }: TNamed, vstep: any) => Promise<import("@haibun/core/build/lib/defs").TOKActionResult>;
|
|
35
|
+
action: ({ where, what }: TNamed, vstep: any) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
36
36
|
};
|
|
37
37
|
readFile: {
|
|
38
38
|
gwta: string;
|
|
39
|
-
action: ({ where }: TNamed) => Promise<import("@haibun/core/build/lib/defs").TOKActionResult>;
|
|
39
|
+
action: ({ where }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
40
40
|
};
|
|
41
41
|
clearFiles: {
|
|
42
42
|
gwta: string;
|
|
43
|
-
action: ({ where }: TNamed) => Promise<import("@haibun/core/build/lib/defs").TOKActionResult>;
|
|
43
|
+
action: ({ where }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
44
44
|
};
|
|
45
45
|
clearAllFiles: {
|
|
46
46
|
gwta: string;
|
|
47
|
-
action: () => Promise<import("@haibun/core/build/lib/defs").TOKActionResult>;
|
|
47
|
+
action: () => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
//# sourceMappingURL=AStorage.d.ts.map
|
package/build/AStorage.js
CHANGED
|
@@ -1,47 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const defs_1 = require("@haibun/core/build/lib/defs");
|
|
5
|
-
const vars_1 = require("@haibun/core/build/steps/vars");
|
|
6
|
-
class AStorage extends defs_1.AStepper {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.steps = {
|
|
10
|
-
setLatest: {
|
|
11
|
-
gwta: `set {what} to the latest file from {where}`,
|
|
12
|
-
action: async ({ where, what }, vstep) => {
|
|
13
|
-
const latest = await this.latestFrom(where);
|
|
14
|
-
(0, vars_1.setShared)({ what, value: latest.file }, vstep, this.getWorld());
|
|
15
|
-
return defs_1.OK;
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
readFile: {
|
|
19
|
-
gwta: `read text from {where: STORAGE_ITEM}`,
|
|
20
|
-
action: async ({ where }) => {
|
|
21
|
-
const text = await this.readFile(where, 'utf-8');
|
|
22
|
-
this.getWorld().logger.log(text);
|
|
23
|
-
return defs_1.OK;
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
clearFiles: {
|
|
27
|
-
gwta: `clear files matching {where}`,
|
|
28
|
-
action: async ({ where }) => {
|
|
29
|
-
const dirs = where.split(',').map(d => d.trim());
|
|
30
|
-
for (const dir of dirs) {
|
|
31
|
-
await this.rmrf(dir);
|
|
32
|
-
}
|
|
33
|
-
return defs_1.OK;
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
clearAllFiles: {
|
|
37
|
-
gwta: `clear files`,
|
|
38
|
-
action: async () => {
|
|
39
|
-
await this.rmrf('');
|
|
40
|
-
return defs_1.OK;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
1
|
+
import { CAPTURE, AStepper, OK, DEFAULT_DEST, } from "@haibun/core/build/lib/defs.js";
|
|
2
|
+
import { setShared } from "@haibun/core/build/steps/vars.js";
|
|
3
|
+
export class AStorage extends AStepper {
|
|
45
4
|
async writeFile(file, contents, mediaType) {
|
|
46
5
|
if (typeof contents === 'string') {
|
|
47
6
|
await this.writeFileBuffer(file, Buffer.from(contents), mediaType);
|
|
@@ -60,11 +19,11 @@ class AStorage extends defs_1.AStepper {
|
|
|
60
19
|
throw Error(`rmrf not implemented at ${dir}`);
|
|
61
20
|
}
|
|
62
21
|
fromCaptureLocation(mediaType, ...where) {
|
|
63
|
-
return [`./${
|
|
22
|
+
return [`./${CAPTURE}`, ...where].join('/');
|
|
64
23
|
}
|
|
65
24
|
locator(loc, ...where) {
|
|
66
25
|
const { options } = loc;
|
|
67
|
-
const path = [options.base,
|
|
26
|
+
const path = [options.base, CAPTURE, options.DEST || DEFAULT_DEST].concat(where.filter(w => w !== undefined));
|
|
68
27
|
return '.' + path.join('/');
|
|
69
28
|
}
|
|
70
29
|
async getCaptureLocation(loc, app) {
|
|
@@ -97,6 +56,40 @@ class AStorage extends defs_1.AStepper {
|
|
|
97
56
|
}
|
|
98
57
|
}
|
|
99
58
|
}
|
|
59
|
+
steps = {
|
|
60
|
+
setLatest: {
|
|
61
|
+
gwta: `set {what} to the latest file from {where}`,
|
|
62
|
+
action: async ({ where, what }, vstep) => {
|
|
63
|
+
const latest = await this.latestFrom(where);
|
|
64
|
+
setShared({ what, value: latest.file }, vstep, this.getWorld());
|
|
65
|
+
return OK;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
readFile: {
|
|
69
|
+
gwta: `read text from {where: STORAGE_ITEM}`,
|
|
70
|
+
action: async ({ where }) => {
|
|
71
|
+
const text = await this.readFile(where, 'utf-8');
|
|
72
|
+
this.getWorld().logger.log(text);
|
|
73
|
+
return OK;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
clearFiles: {
|
|
77
|
+
gwta: `clear files matching {where}`,
|
|
78
|
+
action: async ({ where }) => {
|
|
79
|
+
const dirs = where.split(',').map(d => d.trim());
|
|
80
|
+
for (const dir of dirs) {
|
|
81
|
+
await this.rmrf(dir);
|
|
82
|
+
}
|
|
83
|
+
return OK;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
clearAllFiles: {
|
|
87
|
+
gwta: `clear files`,
|
|
88
|
+
action: async () => {
|
|
89
|
+
await this.rmrf('');
|
|
90
|
+
return OK;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
100
94
|
}
|
|
101
|
-
exports.AStorage = AStorage;
|
|
102
95
|
//# sourceMappingURL=AStorage.js.map
|
package/build/AStorage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AStorage.js","sourceRoot":"","sources":["../src/AStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AStorage.js","sourceRoot":"","sources":["../src/AStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAU,YAAY,GAAG,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAU7D,MAAM,OAAgB,QAAS,SAAQ,QAAQ;IAM3C,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,QAAyB,EAAE,SAAq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
|
1
|
-
import { WorkspaceContext } from '@haibun/core/build/lib/contexts';
|
|
2
|
-
import { TNamed, TVStep, AStepper, TFromDomain, TFileTypeDomain, TExtraOptions, TFeatureResult, TOptions, TTag, TWorld } from '@haibun/core/build/lib/defs';
|
|
3
|
-
export
|
|
1
|
+
import { WorkspaceContext } from '@haibun/core/build/lib/contexts.js';
|
|
2
|
+
import { TNamed, TVStep, AStepper, TFromDomain, TFileTypeDomain, TExtraOptions, TFeatureResult, TOptions, TTag, TWorld } from '@haibun/core/build/lib/defs.js';
|
|
3
|
+
export type TTrackResult = {
|
|
4
4
|
meta: {
|
|
5
5
|
title: string;
|
|
6
6
|
startTime: string;
|
|
@@ -8,7 +8,7 @@ export declare type TTrackResult = {
|
|
|
8
8
|
};
|
|
9
9
|
result: TFeatureResult;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type TMissingTracks = {
|
|
12
12
|
error: string;
|
|
13
13
|
};
|
|
14
14
|
export declare const STORAGE_LOCATION = "STORAGE_LOCATION";
|
|
@@ -37,21 +37,21 @@ declare const DomainStorage: {
|
|
|
37
37
|
steps: {
|
|
38
38
|
aLocation: {
|
|
39
39
|
gwta: string;
|
|
40
|
-
action: ({ where }: TNamed, vstep: TVStep) => Promise<import("@haibun/core/build/lib/defs").TOKActionResult>;
|
|
40
|
+
action: ({ where }: TNamed, vstep: TVStep) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
41
41
|
};
|
|
42
42
|
anItem: {
|
|
43
43
|
gwta: string;
|
|
44
|
-
action: ({ name }: TNamed) => Promise<import("@haibun/core/build/lib/defs").TOKActionResult>;
|
|
44
|
+
action: ({ name }: TNamed) => Promise<import("@haibun/core/build/lib/defs.js").TOKActionResult>;
|
|
45
45
|
build: ({ name }: TNamed, a: TVStep, workspace: WorkspaceContext) => Promise<{
|
|
46
46
|
ok: true;
|
|
47
|
-
topics?: import("@haibun/core/build/lib/defs").TActionResultTopics
|
|
47
|
+
topics?: import("@haibun/core/build/lib/defs.js").TActionResultTopics;
|
|
48
48
|
}>;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
world?: TWorld
|
|
51
|
+
world?: TWorld;
|
|
52
52
|
close?(): void;
|
|
53
53
|
endFeature?(): void;
|
|
54
|
-
onFailure?(result: import("@haibun/core/build/lib/defs").TStepResult): void;
|
|
54
|
+
onFailure?(result: import("@haibun/core/build/lib/defs.js").TStepResult): void;
|
|
55
55
|
setWorld(world: TWorld, steppers: AStepper[]): void;
|
|
56
56
|
getWorld(): TWorld;
|
|
57
57
|
};
|
|
@@ -63,8 +63,8 @@ export declare const enum EMediaTypes {
|
|
|
63
63
|
json = "json",
|
|
64
64
|
image = "image"
|
|
65
65
|
}
|
|
66
|
-
export
|
|
67
|
-
export
|
|
66
|
+
export type TMediaType = EMediaTypes;
|
|
67
|
+
export type TLocationOptions = {
|
|
68
68
|
tag: TTag;
|
|
69
69
|
options: TOptions;
|
|
70
70
|
extraOptions: TExtraOptions;
|
|
@@ -81,4 +81,3 @@ export interface IPublishResults {
|
|
|
81
81
|
}
|
|
82
82
|
export declare function guessMediaExt(file: string): any;
|
|
83
83
|
export declare function guessMediaType(file: string): EMediaTypes;
|
|
84
|
-
//# sourceMappingURL=domain-storage.d.ts.map
|
package/build/domain-storage.js
CHANGED
|
@@ -1,52 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
exports.STORAGE_ITEM = 'STORAGE_ITEM';
|
|
8
|
-
exports.storageLocation = {
|
|
9
|
-
name: exports.STORAGE_LOCATION, fileType: exports.STORAGE_LOCATION, is: 'string', validate: (content) => {
|
|
1
|
+
import { OK, AStepper } from '@haibun/core/build/lib/defs.js';
|
|
2
|
+
import { stringOrError } from '@haibun/core/build/lib/util/index.js';
|
|
3
|
+
export const STORAGE_LOCATION = 'STORAGE_LOCATION';
|
|
4
|
+
export const STORAGE_ITEM = 'STORAGE_ITEM';
|
|
5
|
+
export const storageLocation = {
|
|
6
|
+
name: STORAGE_LOCATION, fileType: STORAGE_LOCATION, is: 'string', validate: (content) => {
|
|
10
7
|
return undefined;
|
|
11
8
|
}
|
|
12
9
|
};
|
|
13
|
-
|
|
14
|
-
const DomainStorage = class DomainStorage extends
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const location = vstep.source.name;
|
|
33
|
-
return defs_1.OK;
|
|
34
|
-
},
|
|
10
|
+
export const storageItem = { name: STORAGE_ITEM, from: STORAGE_LOCATION, is: 'string' };
|
|
11
|
+
const DomainStorage = class DomainStorage extends AStepper {
|
|
12
|
+
domains = [
|
|
13
|
+
storageLocation,
|
|
14
|
+
storageItem,
|
|
15
|
+
];
|
|
16
|
+
locator = (location) => `http://localhost:8123/${location}`;
|
|
17
|
+
options = {
|
|
18
|
+
BASE_DIRECTORY: {
|
|
19
|
+
desc: 'run browsers without a window (true or false)',
|
|
20
|
+
parse: (input) => stringOrError(input)
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
steps = {
|
|
24
|
+
aLocation: {
|
|
25
|
+
gwta: `a ${STORAGE_LOCATION} at {where}`,
|
|
26
|
+
action: async ({ where }, vstep) => {
|
|
27
|
+
const location = vstep.source.name;
|
|
28
|
+
return OK;
|
|
35
29
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
build: async ({ name }, a, workspace) => {
|
|
42
|
-
workspace.getBuilder().addControl(name);
|
|
43
|
-
return { ...defs_1.OK };
|
|
44
|
-
},
|
|
30
|
+
},
|
|
31
|
+
anItem: {
|
|
32
|
+
gwta: `A ${STORAGE_ITEM} {name}`,
|
|
33
|
+
action: async ({ name }) => {
|
|
34
|
+
return OK;
|
|
45
35
|
},
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
build: async ({ name }, a, workspace) => {
|
|
37
|
+
workspace.getBuilder().addControl(name);
|
|
38
|
+
return { ...OK };
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
48
42
|
};
|
|
49
|
-
|
|
43
|
+
export default DomainStorage;
|
|
50
44
|
const MAPPED_MEDIA_TYPES = {
|
|
51
45
|
webm: 'video'
|
|
52
46
|
};
|
|
@@ -55,15 +49,13 @@ const MEDIA_TYPES = {
|
|
|
55
49
|
json: 'json',
|
|
56
50
|
'video': 'video/mp4'
|
|
57
51
|
};
|
|
58
|
-
function guessMediaExt(file) {
|
|
52
|
+
export function guessMediaExt(file) {
|
|
59
53
|
const ext = file.replace(/.*\./, '').toLowerCase();
|
|
60
54
|
return MAPPED_MEDIA_TYPES[ext] || ext;
|
|
61
55
|
}
|
|
62
|
-
|
|
63
|
-
function guessMediaType(file) {
|
|
56
|
+
export function guessMediaType(file) {
|
|
64
57
|
const ext = guessMediaExt(file);
|
|
65
58
|
const mediaType = MEDIA_TYPES[ext] || ext.toUpperCase().replace(/[^A-Z]/g, '');
|
|
66
59
|
return mediaType;
|
|
67
60
|
}
|
|
68
|
-
exports.guessMediaType = guessMediaType;
|
|
69
61
|
//# sourceMappingURL=domain-storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-storage.js","sourceRoot":"","sources":["../src/domain-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"domain-storage.js","sourceRoot":"","sources":["../src/domain-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,EAAE,EAAE,QAAQ,EAAoG,MAAM,gCAAgC,CAAC;AAC7L,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAKrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MA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C,IAAI,CAAC,CAAC;gBACxC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;YACnB,CAAC;SACF;KACF,CAAC;CACH,CAAC;AAEF,eAAe,aAAa,CAAC;AAE7B,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,OAAO;CACd,CAAA;AAED,MAAM,WAAW,GAA+B;IAC9C,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,WAAW;CACrB,CAAA;AA+BD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACnD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC/E,OAAmB,SAAS,CAAC;AAC/B,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const domain_storage_1 = __importDefault(require("./domain-storage"));
|
|
1
|
+
import DomainStorage from './domain-storage.js';
|
|
7
2
|
describe('domain storage', () => {
|
|
8
3
|
it('exists', async () => {
|
|
9
|
-
expect(
|
|
4
|
+
expect(DomainStorage).toBeDefined();
|
|
10
5
|
});
|
|
11
6
|
});
|
|
12
7
|
//# sourceMappingURL=domain-storage.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-storage.test.js","sourceRoot":"","sources":["../src/domain-storage.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"domain-storage.test.js","sourceRoot":"","sources":["../src/domain-storage.test.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QACtB,MAAM,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './build/domain-storage.js';
|
package/package.json
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haibun/domain-storage",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.13.13",
|
|
4
5
|
"description": "",
|
|
5
6
|
"author": "",
|
|
6
|
-
"main": "
|
|
7
|
+
"main": "index.js",
|
|
7
8
|
"files": [
|
|
8
9
|
"build/**"
|
|
9
10
|
],
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"@types/jest": "^29.2.4",
|
|
12
|
-
"@types/node": "^18.11.14",
|
|
13
|
-
"@typescript-eslint/eslint-plugin": "^4.13.0",
|
|
14
|
-
"@typescript-eslint/parser": "^4.13.0",
|
|
15
|
-
"eslint": "^7.2.0",
|
|
16
|
-
"eslint-config-airbnb-typescript": "^12.0.0",
|
|
17
|
-
"eslint-config-prettier": "^8.3.0",
|
|
18
|
-
"eslint-plugin-import": "^2.22.1",
|
|
19
|
-
"eslint-plugin-prefer-arrow": "^1.2.2",
|
|
20
|
-
"eslint-plugin-prettier": "^3.3.1",
|
|
21
|
-
"jest": "^29.3.1",
|
|
22
|
-
"prettier": "^2.3.1",
|
|
23
|
-
"ts-node": "^10.0.0",
|
|
24
|
-
"tslint": "^6.1.3"
|
|
25
|
-
},
|
|
11
|
+
"devDependencies": {},
|
|
26
12
|
"scripts": {
|
|
27
13
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
28
14
|
"lint": "eslint -c .eslintrc.json --ext .ts,.js src",
|
|
29
|
-
"test": "jest
|
|
30
|
-
"test-haibun": "build/cli.js test/projects/web",
|
|
15
|
+
"test": "jest",
|
|
31
16
|
"coverage": "jest --config jest.config.ts --coverage",
|
|
32
17
|
"test-watch": "jest --watch",
|
|
33
18
|
"build": "tsc -b .",
|
|
@@ -37,5 +22,9 @@
|
|
|
37
22
|
"prepublishOnly": "tsc -b .",
|
|
38
23
|
"preversion": "npm run lint",
|
|
39
24
|
"version": "npm run format && git add -A src"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@haibun/context": "1.13.13",
|
|
28
|
+
"@haibun/core": "1.13.13"
|
|
40
29
|
}
|
|
41
30
|
}
|
package/build/AStorage.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AStorage.d.ts","sourceRoot":"","sources":["../src/AStorage.ts"],"names":[],"mappings":";AAAA,OAAO,EAAW,QAAQ,EAAM,MAAM,EAAiB,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,8BAAsB,QAAS,SAAQ,QAAQ;IAC3C,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG;IACrD,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,WAA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