@sprucelabs/mercury-chunking-emitter 1.1.1 → 1.1.2
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/{src/.spruce/features/permission.plugin.ts → build/.spruce/features/permission.plugin.d.ts} +1 -1
- package/build/.spruce/features/permission.plugin.js +5 -0
- package/build/.spruce/permissions/permissions.types.d.ts +7 -0
- package/build/.spruce/permissions/permissions.types.js +3 -0
- package/build/.spruce/schemas/chunkingEmitter/v2023_10_21/chunkPaging.schema.d.ts +3 -0
- package/build/.spruce/schemas/chunkingEmitter/v2023_10_21/chunkPaging.schema.js +25 -0
- package/build/.spruce/schemas/fields/fieldClassMap.d.ts +2 -0
- package/build/.spruce/schemas/fields/fieldClassMap.js +4 -0
- package/{src/.spruce/schemas/fields/fields.types.ts → build/.spruce/schemas/fields/fields.types.d.ts} +1 -1
- package/build/.spruce/schemas/fields/fields.types.js +2 -0
- package/build/.spruce/schemas/schemas.types.d.ts +33 -0
- package/build/.spruce/schemas/schemas.types.js +4 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/choice.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/choice.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/choice.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/link.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/link.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/link.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/location.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/location.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/location.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/message.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/message.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/message.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/messageSource.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/messageSource.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/messageSource.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/messageTarget.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/messageTarget.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/messageTarget.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/organization.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/organization.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/organization.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/person.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/person.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/person.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/personLocation.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/personLocation.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/personLocation.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/personOrganization.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/personOrganization.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/personOrganization.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/role.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/role.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/role.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/sendMessage.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/sendMessage.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/sendMessage.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/skill.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/skill.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/skill.schema.js +5 -0
- package/{src/.spruce/schemas/spruce/v2020_07_22/skillCreator.schema.ts → build/.spruce/schemas/spruce/v2020_07_22/skillCreator.schema.d.ts} +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/skillCreator.schema.js +5 -0
- package/build/chunkingEmitter/ChunkingEmitter.d.ts +30 -0
- package/build/chunkingEmitter/ChunkingEmitter.js +71 -0
- package/build/chunkingEmitter/MockChunkingEmitter.d.ts +23 -0
- package/build/chunkingEmitter/MockChunkingEmitter.js +54 -0
- package/build/chunkingEmitter/chunkFieldDefinition.d.ts +2 -0
- package/build/chunkingEmitter/chunkFieldDefinition.js +17 -0
- package/build/esm/.spruce/schemas/chunkingEmitter/v2023_10_21/chunkPaging.schema.d.ts +3 -0
- package/build/esm/.spruce/schemas/chunkingEmitter/v2023_10_21/chunkPaging.schema.js +23 -0
- package/build/esm/.spruce/schemas/schemas.types.d.ts +33 -0
- package/build/esm/.spruce/schemas/schemas.types.js +3 -0
- package/build/esm/chunkingEmitter/ChunkingEmitter.d.ts +30 -0
- package/build/esm/chunkingEmitter/ChunkingEmitter.js +81 -0
- package/build/esm/chunkingEmitter/MockChunkingEmitter.d.ts +23 -0
- package/build/esm/chunkingEmitter/MockChunkingEmitter.js +62 -0
- package/build/esm/chunkingEmitter/chunkFieldDefinition.d.ts +2 -0
- package/build/esm/chunkingEmitter/chunkFieldDefinition.js +10 -0
- package/{src/index.ts → build/esm/index.d.ts} +3 -3
- package/build/esm/index.js +1 -0
- package/build/esm/schemas/v2023_10_21/chunkPaging.builder.d.ts +15 -0
- package/build/esm/schemas/v2023_10_21/chunkPaging.builder.js +15 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +8 -0
- package/build/schemas/v2023_10_21/chunkPaging.builder.d.ts +15 -0
- package/build/schemas/v2023_10_21/chunkPaging.builder.js +17 -0
- package/package.json +6 -1
- package/.circleci/config.yml +0 -71
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -3
- package/.githooks/pre-push +0 -17
- package/.nvmrc +0 -1
- package/.vscode/launch.json +0 -58
- package/.vscode/settings.json +0 -70
- package/.vscode/tasks.json +0 -112
- package/CHANGELOG.md +0 -25
- package/release.config.js +0 -7
- package/src/.spruce/permissions/permissions.types.ts +0 -9
- package/src/.spruce/schemas/chunkingEmitter/v2023_10_21/chunkPaging.schema.ts +0 -29
- package/src/.spruce/schemas/fields/fieldClassMap.ts +0 -6
- package/src/.spruce/schemas/schemas.types.ts +0 -52
- package/src/__tests__/behavioral/ChunkingEmitter.test.ts +0 -290
- package/src/__tests__/behavioral/TestingChunkingEmitter.test.ts +0 -174
- package/src/__tests__/support/AbstractChunkingEmitterTest.ts +0 -54
- package/src/chunkingEmitter/ChunkingEmitter.ts +0 -107
- package/src/chunkingEmitter/MockChunkingEmitter.ts +0 -101
- package/src/chunkingEmitter/chunkFieldDefinition.ts +0 -12
- package/src/schemas/v2023_10_21/chunkPaging.builder.ts +0 -16
- package/tsconfig.dist.json +0 -36
- package/tsconfig.json +0 -40
- /package/{src → build}/.spruce/settings.json +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { assertOptions } from '@sprucelabs/schema';
|
|
11
|
+
import { buildLog } from '@sprucelabs/spruce-skill-utils';
|
|
12
|
+
export default class ChunkingEmitterImpl {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.log = buildLog('ChunkingEmitter');
|
|
15
|
+
this.totalErrors = 0;
|
|
16
|
+
const { client, chunkSize } = assertOptions(options, ['client']);
|
|
17
|
+
this.client = client;
|
|
18
|
+
this.chunkSize = chunkSize !== null && chunkSize !== void 0 ? chunkSize : 10;
|
|
19
|
+
}
|
|
20
|
+
static Emitter(options) {
|
|
21
|
+
var _a;
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
assertOptions(options, ['client']);
|
|
24
|
+
return new ((_a = this.Class) !== null && _a !== void 0 ? _a : this)(options);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
emit(options) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const { eventName, items, payloadKey, target } = assertOptions(options, [
|
|
30
|
+
'eventName',
|
|
31
|
+
'items',
|
|
32
|
+
'payloadKey',
|
|
33
|
+
]);
|
|
34
|
+
this.totalErrors = 0;
|
|
35
|
+
const chunks = this.splitItemsIntoChunks(items);
|
|
36
|
+
let current = 0;
|
|
37
|
+
for (const chunk of chunks) {
|
|
38
|
+
try {
|
|
39
|
+
let targetAndPayload = {
|
|
40
|
+
payload: {
|
|
41
|
+
[payloadKey]: chunk,
|
|
42
|
+
chunk: {
|
|
43
|
+
current: current++,
|
|
44
|
+
total: chunks.length,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
if (target) {
|
|
49
|
+
targetAndPayload.target = target;
|
|
50
|
+
}
|
|
51
|
+
yield this.client.emitAndFlattenResponses(eventName, targetAndPayload);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.log.error('Failed to emit chunk', err);
|
|
55
|
+
this.totalErrors++;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static reset() {
|
|
61
|
+
this.Class = undefined;
|
|
62
|
+
}
|
|
63
|
+
splitItemsIntoChunks(items) {
|
|
64
|
+
const chunks = [];
|
|
65
|
+
let index = 0;
|
|
66
|
+
for (const item of items) {
|
|
67
|
+
if (!chunks[index]) {
|
|
68
|
+
chunks[index] = [];
|
|
69
|
+
}
|
|
70
|
+
if (chunks[index].length === this.chunkSize) {
|
|
71
|
+
index++;
|
|
72
|
+
chunks[index] = [];
|
|
73
|
+
}
|
|
74
|
+
chunks[index].push(item);
|
|
75
|
+
}
|
|
76
|
+
return chunks;
|
|
77
|
+
}
|
|
78
|
+
getTotalErrors() {
|
|
79
|
+
return this.totalErrors;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventName } from '@sprucelabs/mercury-types';
|
|
2
|
+
import { ChunkingEmitter } from './ChunkingEmitter';
|
|
3
|
+
export default class MockChunkingEmitter implements ChunkingEmitter {
|
|
4
|
+
private didEmit;
|
|
5
|
+
private emittedEventName?;
|
|
6
|
+
private emittedItems?;
|
|
7
|
+
private emittedPayloadKey?;
|
|
8
|
+
static lastInstance?: MockChunkingEmitter;
|
|
9
|
+
constructor();
|
|
10
|
+
static getLastInstance(): MockChunkingEmitter;
|
|
11
|
+
static reset(): void;
|
|
12
|
+
emit(options: {
|
|
13
|
+
eventName: EventName;
|
|
14
|
+
items: Record<string, unknown>[];
|
|
15
|
+
payloadKey: string;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
assertDidEmitPayloadKey(payloadKey: string): void;
|
|
18
|
+
getTotalErrors(): number;
|
|
19
|
+
assertEmittedItems(items: Record<string, any>[]): void;
|
|
20
|
+
assertDidEmit(): void;
|
|
21
|
+
assertDidEmitEventNamed(fqen: EventName): void;
|
|
22
|
+
assertEventHonorsChunkingSignature(fqen: EventName): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { MercuryTestClient } from '@sprucelabs/mercury-client';
|
|
11
|
+
import { assert } from '@sprucelabs/test-utils';
|
|
12
|
+
import { chunkFieldDefinition } from './chunkFieldDefinition.js';
|
|
13
|
+
export default class MockChunkingEmitter {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.didEmit = false;
|
|
16
|
+
MockChunkingEmitter.lastInstance = this;
|
|
17
|
+
}
|
|
18
|
+
static getLastInstance() {
|
|
19
|
+
assert.isTruthy(this.lastInstance, 'You have not constructed a ChunkingEmitter! Try ChunkingEmitterImpl.Emitter({})');
|
|
20
|
+
return this.lastInstance;
|
|
21
|
+
}
|
|
22
|
+
static reset() {
|
|
23
|
+
this.lastInstance = undefined;
|
|
24
|
+
}
|
|
25
|
+
emit(options) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const { eventName, items, payloadKey } = options;
|
|
28
|
+
this.didEmit = true;
|
|
29
|
+
this.emittedEventName = eventName;
|
|
30
|
+
this.emittedItems = items;
|
|
31
|
+
this.emittedPayloadKey = payloadKey;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
assertDidEmitPayloadKey(payloadKey) {
|
|
35
|
+
this.assertDidEmit();
|
|
36
|
+
assert.isEqual(this.emittedPayloadKey, payloadKey, `I expected chunkingEmitter.emit() with payloadKey '${payloadKey}'! But you emitted ${this.emittedPayloadKey || 'nothing'}`);
|
|
37
|
+
}
|
|
38
|
+
getTotalErrors() {
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
assertEmittedItems(items) {
|
|
42
|
+
this.assertDidEmit();
|
|
43
|
+
assert.isEqualDeep(this.emittedItems, items, 'You did not chunkingEmitter.emit(...) the expected items!!');
|
|
44
|
+
}
|
|
45
|
+
assertDidEmit() {
|
|
46
|
+
assert.isTrue(this.didEmit, `You did not ever call chunkingEmitter.emit(...). That is your next step!`);
|
|
47
|
+
}
|
|
48
|
+
assertDidEmitEventNamed(fqen) {
|
|
49
|
+
this.assertDidEmit();
|
|
50
|
+
assert.isEqual(this.emittedEventName, fqen, `I expected chunkingEmitter to emit '${fqen}'! But you emitted ${this.emittedEventName || 'nothing'}`);
|
|
51
|
+
}
|
|
52
|
+
assertEventHonorsChunkingSignature(fqen) {
|
|
53
|
+
var _a, _b, _c, _d, _e, _f;
|
|
54
|
+
const emitter = MercuryTestClient.getInternalEmitter();
|
|
55
|
+
const contract = emitter.getContract();
|
|
56
|
+
const payload = (_b = (_a = contract.eventSignatures[fqen]) === null || _a === void 0 ? void 0 : _a.emitPayloadSchema) === null || _b === void 0 ? void 0 : _b.fields;
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
const chunkField = (_f = (_e = (_d = (_c = payload === null || payload === void 0 ? void 0 : payload.payload) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.schema) === null || _e === void 0 ? void 0 : _e.fields) === null || _f === void 0 ? void 0 : _f.chunk;
|
|
59
|
+
assert.isTruthy(chunkField, 'Your event does not conform to the chunking signature. Please add a chunk field to your event payload. Add a field to your payload called chunk: chunkFieldDefinition()');
|
|
60
|
+
assert.isEqualDeep(chunkField, chunkFieldDefinition(), 'Your chunk field is there but not properly formed. Use chunkFieldDefinition() to define it.');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ChunkingEmitter } from './chunkingEmitter/ChunkingEmitter'
|
|
2
|
-
export default ChunkingEmitter
|
|
3
|
-
export { default as MockChunkingEmitter } from './chunkingEmitter/MockChunkingEmitter'
|
|
1
|
+
import { ChunkingEmitter } from './chunkingEmitter/ChunkingEmitter';
|
|
2
|
+
export default ChunkingEmitter;
|
|
3
|
+
export { default as MockChunkingEmitter } from './chunkingEmitter/MockChunkingEmitter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MockChunkingEmitter } from './chunkingEmitter/MockChunkingEmitter.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { buildSchema } from '@sprucelabs/schema';
|
|
2
|
+
export default buildSchema({
|
|
3
|
+
id: 'chunkPaging',
|
|
4
|
+
name: 'Chunk Paging',
|
|
5
|
+
fields: {
|
|
6
|
+
total: {
|
|
7
|
+
type: 'number',
|
|
8
|
+
isRequired: true,
|
|
9
|
+
},
|
|
10
|
+
current: {
|
|
11
|
+
type: 'number',
|
|
12
|
+
isRequired: true,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
exports.MockChunkingEmitter = void 0;
|
|
7
|
+
var MockChunkingEmitter_1 = require("./chunkingEmitter/MockChunkingEmitter");
|
|
8
|
+
Object.defineProperty(exports, "MockChunkingEmitter", { enumerable: true, get: function () { return __importDefault(MockChunkingEmitter_1).default; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
exports.default = (0, schema_1.buildSchema)({
|
|
5
|
+
id: 'chunkPaging',
|
|
6
|
+
name: 'Chunk Paging',
|
|
7
|
+
fields: {
|
|
8
|
+
total: {
|
|
9
|
+
type: 'number',
|
|
10
|
+
isRequired: true,
|
|
11
|
+
},
|
|
12
|
+
current: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
isRequired: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprucelabs/mercury-chunking-emitter",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"files": [
|
|
5
|
+
"build/**/*",
|
|
6
|
+
"!build/__tests__",
|
|
7
|
+
"!build/esm/__tests__"
|
|
8
|
+
],
|
|
4
9
|
"scripts": {
|
|
5
10
|
"build.ci": "yarn build.tsc && yarn build.resolve-paths && yarn lint",
|
|
6
11
|
"build.dev": "yarn build.tsc --sourceMap ; yarn resolve-paths.lint",
|
package/.circleci/config.yml
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
orbs:
|
|
3
|
-
spruce: sprucelabsai/orb@1
|
|
4
|
-
jobs:
|
|
5
|
-
test:
|
|
6
|
-
docker:
|
|
7
|
-
- image: cimg/node:lts
|
|
8
|
-
working_directory: /mnt/ramdisk
|
|
9
|
-
steps:
|
|
10
|
-
- add_ssh_keys:
|
|
11
|
-
fingerprints:
|
|
12
|
-
- "ec:9f:2e:aa:1f:c9:ab:49:57:8f:c0:cd:2e:5b:f3:b0"
|
|
13
|
-
- checkout
|
|
14
|
-
- spruce/check_and_skip_if_npm_publish
|
|
15
|
-
- spruce/create_env_from_base64_env
|
|
16
|
-
- spruce/install_rsync
|
|
17
|
-
- spruce/install_deps_build_ci_test
|
|
18
|
-
- spruce/exit_if_not_auto_upgrade
|
|
19
|
-
- spruce/merge_auto_upgrade
|
|
20
|
-
npm_publish:
|
|
21
|
-
docker:
|
|
22
|
-
- image: cimg/node:lts
|
|
23
|
-
working_directory: /mnt/ramdisk
|
|
24
|
-
steps:
|
|
25
|
-
- add_ssh_keys:
|
|
26
|
-
fingerprints:
|
|
27
|
-
- "ec:9f:2e:aa:1f:c9:ab:49:57:8f:c0:cd:2e:5b:f3:b0"
|
|
28
|
-
- checkout
|
|
29
|
-
- spruce/check_and_skip_if_npm_publish
|
|
30
|
-
- spruce/install_rsync
|
|
31
|
-
- spruce/install_deps_build_dist_release
|
|
32
|
-
upgrade:
|
|
33
|
-
docker:
|
|
34
|
-
- image: cimg/node:lts
|
|
35
|
-
working_directory: /mnt/ramdisk
|
|
36
|
-
steps:
|
|
37
|
-
- spruce/check_for_autoupgrade_dns
|
|
38
|
-
- add_ssh_keys:
|
|
39
|
-
fingerprints:
|
|
40
|
-
- "ec:9f:2e:aa:1f:c9:ab:49:57:8f:c0:cd:2e:5b:f3:b0"
|
|
41
|
-
- spruce/check_for_ssh_keys_env
|
|
42
|
-
- spruce/setup_ct_npm_cache
|
|
43
|
-
- checkout
|
|
44
|
-
- spruce/set_target_branch_env
|
|
45
|
-
- spruce/install_rsync
|
|
46
|
-
- spruce/install_cli
|
|
47
|
-
- spruce/upgrade_check_for_major
|
|
48
|
-
- spruce/check_for_newline_only_diff
|
|
49
|
-
- spruce/create_pr
|
|
50
|
-
workflows:
|
|
51
|
-
version: 2.1
|
|
52
|
-
do_build:
|
|
53
|
-
jobs:
|
|
54
|
-
- test:
|
|
55
|
-
context: public_package_publish
|
|
56
|
-
- npm_publish:
|
|
57
|
-
requires:
|
|
58
|
-
- test
|
|
59
|
-
context: public_package_publish
|
|
60
|
-
filters:
|
|
61
|
-
branches:
|
|
62
|
-
only:
|
|
63
|
-
- master
|
|
64
|
-
upgrade:
|
|
65
|
-
jobs:
|
|
66
|
-
- upgrade:
|
|
67
|
-
context: public_package_publish
|
|
68
|
-
filters:
|
|
69
|
-
branches:
|
|
70
|
-
only:
|
|
71
|
-
- never_run_only_for_cron
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
package/.githooks/pre-push
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
CMD="CI=true yarn fix.lint"
|
|
4
|
-
protected_branch='master'
|
|
5
|
-
|
|
6
|
-
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
|
7
|
-
|
|
8
|
-
eval $CMD
|
|
9
|
-
RESULT=$?
|
|
10
|
-
|
|
11
|
-
if [[ $current_branch = $protected_branch ]]; then
|
|
12
|
-
if [ $RESULT -ne 0 ]; then
|
|
13
|
-
echo "failed $CMD"
|
|
14
|
-
exit 1
|
|
15
|
-
fi
|
|
16
|
-
fi
|
|
17
|
-
exit 0
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
lts/*
|
package/.vscode/launch.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"type": "node",
|
|
6
|
-
"request": "attach",
|
|
7
|
-
"name": "attach.tests",
|
|
8
|
-
"port": 5200,
|
|
9
|
-
"restart": true,
|
|
10
|
-
"timeout": 10000
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "node",
|
|
14
|
-
"request": "launch",
|
|
15
|
-
"name": "test.file",
|
|
16
|
-
"runtimeExecutable": "node",
|
|
17
|
-
"runtimeArgs": [
|
|
18
|
-
"--inspect-brk",
|
|
19
|
-
"--trace-warnings",
|
|
20
|
-
"${workspaceFolder}/node_modules/.bin/jest",
|
|
21
|
-
"${fileBasenameNoExtension}",
|
|
22
|
-
"--detectOpenHandles"
|
|
23
|
-
],
|
|
24
|
-
"cwd": "${workspaceFolder}",
|
|
25
|
-
"console": "integratedTerminal",
|
|
26
|
-
"internalConsoleOptions": "neverOpen"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"type": "node",
|
|
30
|
-
"request": "launch",
|
|
31
|
-
"name": "test.all",
|
|
32
|
-
"runtimeExecutable": "node",
|
|
33
|
-
"runtimeArgs": [
|
|
34
|
-
"--inspect-brk",
|
|
35
|
-
"--trace-warnings",
|
|
36
|
-
"${workspaceFolder}/node_modules/.bin/jest"
|
|
37
|
-
],
|
|
38
|
-
"cwd": "${workspaceFolder}",
|
|
39
|
-
"console": "integratedTerminal",
|
|
40
|
-
"internalConsoleOptions": "neverOpen"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"type": "node",
|
|
44
|
-
"request": "launch",
|
|
45
|
-
"name": "boot",
|
|
46
|
-
"runtimeExecutable": "yarn",
|
|
47
|
-
"runtimeArgs": [
|
|
48
|
-
"run",
|
|
49
|
-
"--inspect-brk",
|
|
50
|
-
"--trace-warnings",
|
|
51
|
-
"boot"
|
|
52
|
-
],
|
|
53
|
-
"cwd": "${workspaceFolder}",
|
|
54
|
-
"console": "integratedTerminal",
|
|
55
|
-
"internalConsoleOptions": "neverOpen"
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
package/.vscode/settings.json
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"debug.node.autoAttach": "on",
|
|
3
|
-
"git.ignoreLimitWarning": true,
|
|
4
|
-
"javascript.validate.enable": false,
|
|
5
|
-
"editor.formatOnSave": true,
|
|
6
|
-
"files.watcherExclude": {
|
|
7
|
-
"**/.git/objects/**": true,
|
|
8
|
-
"**/.git/subtree-cache/**": true,
|
|
9
|
-
"**/build/**": true,
|
|
10
|
-
"**/node_modules/**": true,
|
|
11
|
-
},
|
|
12
|
-
"search.exclude": {
|
|
13
|
-
"**/build/**": true,
|
|
14
|
-
"**/node_modules/**": true,
|
|
15
|
-
"**/.next/**": true
|
|
16
|
-
},
|
|
17
|
-
"editor.maxTokenizationLineLength": 20000000,
|
|
18
|
-
"eslint.enable": true,
|
|
19
|
-
"eslint.validate": [
|
|
20
|
-
"javascript",
|
|
21
|
-
"javascriptreact",
|
|
22
|
-
"typescript",
|
|
23
|
-
"typescriptreact"
|
|
24
|
-
],
|
|
25
|
-
"[javascript]": {
|
|
26
|
-
"editor.formatOnSave": false
|
|
27
|
-
},
|
|
28
|
-
"[javascriptreact]": {
|
|
29
|
-
"editor.formatOnSave": false
|
|
30
|
-
},
|
|
31
|
-
"[typescript]": {
|
|
32
|
-
"editor.formatOnSave": false
|
|
33
|
-
},
|
|
34
|
-
"[typescriptreact]": {
|
|
35
|
-
"editor.formatOnSave": false
|
|
36
|
-
},
|
|
37
|
-
"[handlebars]": {
|
|
38
|
-
"editor.formatOnSave": false
|
|
39
|
-
},
|
|
40
|
-
"eslint.options": {
|
|
41
|
-
"extensions": [
|
|
42
|
-
".js",
|
|
43
|
-
".jsx",
|
|
44
|
-
".ts",
|
|
45
|
-
".tsx"
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
"typescript.tsdk": "node_modules/typescript/lib",
|
|
49
|
-
"editor.codeActionsOnSave": {
|
|
50
|
-
"source.fixAll.eslint": true
|
|
51
|
-
},
|
|
52
|
-
"cSpell.ignorePaths": [
|
|
53
|
-
"**/package-lock.json",
|
|
54
|
-
"**/node_modules/**",
|
|
55
|
-
"**/build/**",
|
|
56
|
-
"**/vscode-extension/**",
|
|
57
|
-
"**/.git/objects/**",
|
|
58
|
-
".vscode",
|
|
59
|
-
".spruce"
|
|
60
|
-
],
|
|
61
|
-
"cSpell.words": [
|
|
62
|
-
"arkit",
|
|
63
|
-
"autogenerated",
|
|
64
|
-
"scrollable",
|
|
65
|
-
"serializable"
|
|
66
|
-
],
|
|
67
|
-
"debug.javascript.unmapMissingSources": true,
|
|
68
|
-
"javascript.preferences.importModuleSpecifier": "relative",
|
|
69
|
-
"typescript.preferences.importModuleSpecifier": "relative"
|
|
70
|
-
}
|
package/.vscode/tasks.json
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0.0",
|
|
3
|
-
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"type": "npm",
|
|
6
|
-
"script": "watch.build.dev",
|
|
7
|
-
"group": "build",
|
|
8
|
-
"label": "watch.build.dev & problem.watcher",
|
|
9
|
-
"isBackground": true,
|
|
10
|
-
"runOptions": {
|
|
11
|
-
"runOn": "folderOpen"
|
|
12
|
-
},
|
|
13
|
-
"promptOnClose": false,
|
|
14
|
-
"presentation": {
|
|
15
|
-
"focus": false,
|
|
16
|
-
"reveal": "never"
|
|
17
|
-
},
|
|
18
|
-
"problemMatcher": {
|
|
19
|
-
"base": "$tsc-watch",
|
|
20
|
-
"applyTo": "allDocuments"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"label": "test.file",
|
|
25
|
-
"command": "spruce",
|
|
26
|
-
"args": [
|
|
27
|
-
"test",
|
|
28
|
-
"--inspect",
|
|
29
|
-
"5200",
|
|
30
|
-
"--pattern",
|
|
31
|
-
"${fileBasenameNoExtension}",
|
|
32
|
-
"--watchMode",
|
|
33
|
-
"standard"
|
|
34
|
-
],
|
|
35
|
-
"promptOnClose": false,
|
|
36
|
-
"group": {
|
|
37
|
-
"kind": "test",
|
|
38
|
-
"isDefault": true
|
|
39
|
-
},
|
|
40
|
-
"presentation": {
|
|
41
|
-
"reveal": "always",
|
|
42
|
-
"panel": "dedicated",
|
|
43
|
-
},
|
|
44
|
-
"problemMatcher": []
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"label": "test.reporter",
|
|
48
|
-
"command": "spruce",
|
|
49
|
-
"args": [
|
|
50
|
-
"test",
|
|
51
|
-
"--shouldHoldAtStart",
|
|
52
|
-
"true",
|
|
53
|
-
"--watchMode",
|
|
54
|
-
"smart"
|
|
55
|
-
],
|
|
56
|
-
"promptOnClose": false,
|
|
57
|
-
"group": "test",
|
|
58
|
-
"runOptions": {
|
|
59
|
-
"runOn": "folderOpen"
|
|
60
|
-
},
|
|
61
|
-
"presentation": {
|
|
62
|
-
"panel": "shared",
|
|
63
|
-
"focus": true,
|
|
64
|
-
"reveal": "always"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"label": "spruce",
|
|
69
|
-
"type": "shell",
|
|
70
|
-
"command": "spruce ${input:spruceCommand}",
|
|
71
|
-
"problemMatcher": [],
|
|
72
|
-
"presentation": {
|
|
73
|
-
"reveal": "always",
|
|
74
|
-
"focus": true,
|
|
75
|
-
"panel": "new",
|
|
76
|
-
"clear": false
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"label": "shell",
|
|
81
|
-
"type": "shell",
|
|
82
|
-
"command": "${input:command} ${input:optionsCommand}",
|
|
83
|
-
"problemMatcher": [],
|
|
84
|
-
"presentation": {
|
|
85
|
-
"reveal": "always",
|
|
86
|
-
"focus": true,
|
|
87
|
-
"panel": "new",
|
|
88
|
-
"clear": false
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"inputs": [
|
|
93
|
-
{
|
|
94
|
-
"id": "spruceCommand",
|
|
95
|
-
"description": "spruce command",
|
|
96
|
-
"default": "create.test",
|
|
97
|
-
"type": "promptString"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"id": "command",
|
|
101
|
-
"description": "command",
|
|
102
|
-
"default": "yarn",
|
|
103
|
-
"type": "promptString"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"id": "optionsCommand",
|
|
107
|
-
"description": "optionsCommand",
|
|
108
|
-
"default": "add",
|
|
109
|
-
"type": "promptString"
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# [1.1.0](https://github.com/sprucelabsai-community/spruce-chunking-emitter/compare/v1.0.5...v1.1.0) (2023-10-21)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Features
|
|
5
|
-
|
|
6
|
-
* mock chunk fix ([1fdee23](https://github.com/sprucelabsai-community/spruce-chunking-emitter/commit/1fdee23))
|
|
7
|
-
|
|
8
|
-
## [1.0.5](https://github.com/sprucelabsai-community/spruce-chunking-emitter/compare/v1.0.4...v1.0.5) (2023-10-21)
|
|
9
|
-
|
|
10
|
-
## [1.0.4](https://github.com/sprucelabsai-community/spruce-chunking-emitter/compare/v1.0.3...v1.0.4) (2023-10-21)
|
|
11
|
-
|
|
12
|
-
## [1.0.3](https://github.com/sprucelabsai-community/spruce-chunking-emitter/compare/v1.0.2...v1.0.3) (2023-10-21)
|
|
13
|
-
|
|
14
|
-
## [1.0.2](https://github.com/sprucelabsai-community/spruce-chunking-emitter/compare/v1.0.1...v1.0.2) (2023-10-21)
|
|
15
|
-
|
|
16
|
-
## [1.0.1](https://github.com/sprucelabsai-community/spruce-chunking-emitter/compare/v1.0.0...v1.0.1) (2023-10-21)
|
|
17
|
-
|
|
18
|
-
# 1.0.0 (2023-10-21)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Features
|
|
22
|
-
|
|
23
|
-
* can pass target ([9dfe34a](https://github.com/sprucelabsai-community/spruce-chunking-emitter/commit/9dfe34a))
|
|
24
|
-
* initial commit ([1197525](https://github.com/sprucelabsai-community/spruce-chunking-emitter/commit/1197525))
|
|
25
|
-
* mock chunking emitter ([b076ad1](https://github.com/sprucelabsai-community/spruce-chunking-emitter/commit/b076ad1))
|