@sprucelabs/spruce-templates 19.1.22 → 19.1.24
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/addons/eq.addon.js +0 -1
- package/build/addons/escape.addon.js +0 -1
- package/build/addons/fieldDefinitionBodyPartial.addon.js +0 -1
- package/build/addons/fieldDefinitionOptions.addon.js +0 -1
- package/build/addons/fieldTypeEnum.addon.js +0 -1
- package/build/addons/fieldValue.addon.js +0 -1
- package/build/addons/gt.addon.js +0 -1
- package/build/addons/hasKeys.addon.js +0 -1
- package/build/addons/hasNoneCoreSchemaTemplateItems.addon.js +0 -1
- package/build/addons/importRelatedSchemas.addon.js +0 -1
- package/build/addons/isDefined.addon.js +0 -1
- package/build/addons/json.addon.js +0 -1
- package/build/addons/neq.addon.js +0 -1
- package/build/addons/operators.addon.js +0 -1
- package/build/addons/pascalCase.addon.js +0 -1
- package/build/addons/permissionContractBuilder.addon.js +0 -1
- package/build/addons/schemaBodyPartial.addon.js +0 -1
- package/build/addons/schemaNamespacePath.addon.js +0 -1
- package/build/addons/schemaValuesPartial.addon.js +0 -1
- package/build/addons/valueTypeGenerator.addon.js +0 -1
- package/build/addons/valueTypeLiteral.addon.js +0 -1
- package/build/addons/valueTypeMapper.addon.js +0 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +0 -1
- package/build/templates/directories/skill/.eslintignore +3 -0
- package/build/templates/directories/skill/.eslintrc.js +3 -0
- package/build/templates/directories/skill/.gitignore +48 -0
- package/build/templates/directories/skill/.nvmrc +1 -0
- package/build/templates/directories/skill/README.md +4 -0
- package/build/templates/directories/skill/package.json.hbs +15 -0
- package/build/templates/directories/skill/src/.spruce/errors/options.types.ts +4 -0
- package/build/templates/directories/skill/src/.spruce/features/event.plugin.ts +1 -0
- package/build/templates/directories/skill/src/.spruce/skill.ts +9 -0
- package/build/templates/directories/skill/src/errors/SpruceError.ts.hbs +20 -0
- package/build/templates/directories/skill/src/index.ts +35 -0
- package/build/templates/directories/skill/tsconfig.json +40 -0
- package/build/templates/directories/vscode/.vscode/launch.json +58 -0
- package/build/templates/directories/vscode/.vscode/settings.json +70 -0
- package/build/templates/directories/vscode/.vscode/tasks.json +112 -0
- package/build/templates/typescript/conversation/conversation.plugin.ts.hbs +1 -0
- package/build/templates/typescript/conversation/conversation.topic.ts.hbs +19 -0
- package/build/templates/typescript/deploy/deploy.plugin.ts.hbs +1 -0
- package/build/templates/typescript/error/SpruceError.ts.hbs +31 -0
- package/build/templates/typescript/error/error.plugin.ts.hbs +79 -0
- package/build/templates/typescript/error/example.ts.hbs +10 -0
- package/build/templates/typescript/error/options.types.ts.hbs +12 -0
- package/build/templates/typescript/event/event.contract.ts.hbs +24 -0
- package/build/templates/typescript/event/event.options.ts.hbs +11 -0
- package/build/templates/typescript/event/events.contract.ts.hbs +24 -0
- package/build/templates/typescript/event/listener.ts.hbs +23 -0
- package/build/templates/typescript/event/listeners.ts.hbs +15 -0
- package/build/templates/typescript/event/payload.builder.ts.hbs +15 -0
- package/build/templates/typescript/log/transport.plugin.ts.hbs +14 -0
- package/build/templates/typescript/permissions/contract.builder.ts.hbs +36 -0
- package/build/templates/typescript/permissions/permission.plugin.ts.hbs +1 -0
- package/build/templates/typescript/permissions/permissions.ts.hbs +13 -0
- package/build/templates/typescript/permissions/permissions.types.ts.hbs +14 -0
- package/build/templates/typescript/polish/polish.ts.hbs +67 -0
- package/build/templates/typescript/sandbox/will-boot.listener.ts.hbs +109 -0
- package/build/templates/typescript/schema/builder.ts.hbs +24 -0
- package/build/templates/typescript/schema/core.schemas.types.ts.hbs +35 -0
- package/build/templates/typescript/schema/example.ts.hbs +20 -0
- package/build/templates/typescript/schema/fields/fieldClassMap.ts.hbs +16 -0
- package/build/templates/typescript/schema/fields/fields.types.ts.hbs +1 -0
- package/build/templates/typescript/schema/imported.schema.ts.hbs +1 -0
- package/build/templates/typescript/schema/partials/fieldDefinitionBody.ts.hbs +12 -0
- package/build/templates/typescript/schema/partials/schemaBody.ts.hbs +20 -0
- package/build/templates/typescript/schema/partials/schemaValues.ts.hbs +7 -0
- package/build/templates/typescript/schema/schema.plugin.ts.hbs +102 -0
- package/build/templates/typescript/schema/schema.ts.hbs +12 -0
- package/build/templates/typescript/schema/schemas.types.ts.hbs +42 -0
- package/build/templates/typescript/schema/valueTypes.ts.hbs +67 -0
- package/build/templates/typescript/store/Store.store.ts.hbs +95 -0
- package/build/templates/typescript/store/store.plugin.ts.hbs +1 -0
- package/build/templates/typescript/store/stores.ts.hbs +9 -0
- package/build/templates/typescript/store/stores.types.ts.hbs +17 -0
- package/build/templates/typescript/test/Test.test.ts.hbs +20 -0
- package/build/templates/typescript/view/View.svc.ts.hbs +18 -0
- package/build/templates/typescript/view/View.vc.ts.hbs +12 -0
- package/build/templates/typescript/view/skill.theme.ts.hbs +70 -0
- package/build/templates/typescript/view/view.plugin.ts.hbs +1 -0
- package/build/templates/typescript/view/views.ts.hbs +54 -0
- package/build/types/templates.types.js +1 -2
- package/build/utilities/DirectoryTemplateUtility.js +0 -1
- package/build/utilities/KeyGeneratorUtility.js +0 -1
- package/build/utilities/importExtractor.utility.js +0 -1
- package/build/utilities/templateImporter.utility.js +0 -1
- package/build/utilities/templateItem.utility.js +0 -1
- package/package.json +5 -5
- package/build/addons/eq.addon.js.map +0 -1
- package/build/addons/escape.addon.js.map +0 -1
- package/build/addons/fieldDefinitionBodyPartial.addon.js.map +0 -1
- package/build/addons/fieldDefinitionOptions.addon.js.map +0 -1
- package/build/addons/fieldTypeEnum.addon.js.map +0 -1
- package/build/addons/fieldValue.addon.js.map +0 -1
- package/build/addons/gt.addon.js.map +0 -1
- package/build/addons/hasKeys.addon.js.map +0 -1
- package/build/addons/hasNoneCoreSchemaTemplateItems.addon.js.map +0 -1
- package/build/addons/importRelatedSchemas.addon.js.map +0 -1
- package/build/addons/isDefined.addon.js.map +0 -1
- package/build/addons/json.addon.js.map +0 -1
- package/build/addons/neq.addon.js.map +0 -1
- package/build/addons/operators.addon.js.map +0 -1
- package/build/addons/pascalCase.addon.js.map +0 -1
- package/build/addons/permissionContractBuilder.addon.js.map +0 -1
- package/build/addons/schemaBodyPartial.addon.js.map +0 -1
- package/build/addons/schemaNamespacePath.addon.js.map +0 -1
- package/build/addons/schemaValuesPartial.addon.js.map +0 -1
- package/build/addons/valueTypeGenerator.addon.js.map +0 -1
- package/build/addons/valueTypeLiteral.addon.js.map +0 -1
- package/build/addons/valueTypeMapper.addon.js.map +0 -1
- package/build/index.js.map +0 -1
- package/build/types/templates.types.js.map +0 -1
- package/build/utilities/DirectoryTemplateUtility.js.map +0 -1
- package/build/utilities/KeyGeneratorUtility.js.map +0 -1
- package/build/utilities/importExtractor.utility.js.map +0 -1
- package/build/utilities/templateImporter.utility.js.map +0 -1
- package/build/utilities/templateItem.utility.js.map +0 -1
package/build/addons/eq.addon.js
CHANGED
|
@@ -11,4 +11,3 @@ const fieldPartial = fs_extra_1.default
|
|
|
11
11
|
.readFileSync(path_1.default.join(templatePath, 'schema/partials/fieldDefinitionBody.ts.hbs'))
|
|
12
12
|
.toString();
|
|
13
13
|
handlebars_1.default.registerPartial('fieldDefinitionBody', fieldPartial);
|
|
14
|
-
//# sourceMappingURL=fieldDefinitionBodyPartial.addon.js.map
|
package/build/addons/gt.addon.js
CHANGED
|
@@ -7,4 +7,3 @@ const handlebars_1 = __importDefault(require("handlebars"));
|
|
|
7
7
|
handlebars_1.default.registerHelper('permissionContractBuilder', function (permissionContract) {
|
|
8
8
|
return `buildPermissionContract(${JSON.stringify(permissionContract, null, 2)})`;
|
|
9
9
|
});
|
|
10
|
-
//# sourceMappingURL=permissionContractBuilder.addon.js.map
|
|
@@ -11,4 +11,3 @@ const schemaBodyPartial = fs_extra_1.default
|
|
|
11
11
|
.readFileSync(path_1.default.join(templatePath, 'schema/partials/schemaBody.ts.hbs'))
|
|
12
12
|
.toString();
|
|
13
13
|
handlebars_1.default.registerPartial('schemaBody', schemaBodyPartial);
|
|
14
|
-
//# sourceMappingURL=schemaBodyPartial.addon.js.map
|
|
@@ -11,4 +11,3 @@ const schemaValuesPartial = fs_extra_1.default
|
|
|
11
11
|
.readFileSync(path_1.default.join(templatePath, 'schema/partials/schemaValues.ts.hbs'))
|
|
12
12
|
.toString();
|
|
13
13
|
handlebars_1.default.registerPartial('schemaValues', schemaValuesPartial);
|
|
14
|
-
//# sourceMappingURL=schemaValuesPartial.addon.js.map
|
|
@@ -21,4 +21,3 @@ handlebars_1.default.registerHelper('valueTypeGenerator', function (fieldDefinit
|
|
|
21
21
|
}).replace('"{{TYPE_ENUM}}"', type);
|
|
22
22
|
return `${func}(${def}, TemplateRenderAs.${(0, lodash_1.upperFirst)(renderAs)}, "${match.importAs}")`;
|
|
23
23
|
});
|
|
24
|
-
//# sourceMappingURL=valueTypeGenerator.addon.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { PermissionContractMap } from '@sprucelabs/mercury-types';
|
|
|
3
3
|
import { Schema, SchemaTemplateItem, FieldTemplateItem } from '@sprucelabs/schema';
|
|
4
4
|
import { TemplateRenderAs } from '@sprucelabs/schema';
|
|
5
5
|
import handlebars from 'handlebars';
|
|
6
|
+
import { FieldDefinitions } from '#spruce/schemas/fields/fields.types';
|
|
6
7
|
import { DirectoryTemplateCode, DirectoryTemplateContextMap, ValueTypes, SchemaBuilderTemplateItem, ErrorOptions, ErrorTemplateItem, TestOptions, EventListenerOptions, EventContractTemplateItem, EventPayloadOptions, StoreTemplateOptions, StoreTemplateItem, ViewsOptions, ListenerTemplateItem } from './types/templates.types';
|
|
7
8
|
export declare const templates: {
|
|
8
9
|
schemasTypes(options: {
|
package/build/index.js
CHANGED
|
@@ -271,4 +271,3 @@ var importExtractor_utility_2 = require("./utilities/importExtractor.utility");
|
|
|
271
271
|
Object.defineProperty(exports, "importExtractorUtil", { enumerable: true, get: function () { return __importDefault(importExtractor_utility_2).default; } });
|
|
272
272
|
exports.default = handlebars_1.default;
|
|
273
273
|
__exportStar(require("./types/templates.types"), exports);
|
|
274
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
*.log
|
|
3
|
+
npm-debug.log*
|
|
4
|
+
yarn-debug.log*
|
|
5
|
+
yarn-error.log*
|
|
6
|
+
|
|
7
|
+
# Runtime data
|
|
8
|
+
pids
|
|
9
|
+
*.pid
|
|
10
|
+
*.seed
|
|
11
|
+
*.pid.lock
|
|
12
|
+
|
|
13
|
+
# Dependency directories
|
|
14
|
+
node_modules/
|
|
15
|
+
|
|
16
|
+
# Optional npm cache directory
|
|
17
|
+
.npm
|
|
18
|
+
|
|
19
|
+
# Optional eslint cache
|
|
20
|
+
.eslintcache
|
|
21
|
+
|
|
22
|
+
# Optional REPL history
|
|
23
|
+
.node_repl_history
|
|
24
|
+
|
|
25
|
+
# Output of 'npm pack'
|
|
26
|
+
*.tgz
|
|
27
|
+
|
|
28
|
+
# Yarn Integrity file
|
|
29
|
+
.yarn-integrity
|
|
30
|
+
|
|
31
|
+
# dotenv environment variables file
|
|
32
|
+
.env
|
|
33
|
+
.env.*
|
|
34
|
+
.env-*
|
|
35
|
+
|
|
36
|
+
# macOS files
|
|
37
|
+
.DS_Store
|
|
38
|
+
|
|
39
|
+
# Rejected "git apply" patch files
|
|
40
|
+
*.rej
|
|
41
|
+
|
|
42
|
+
/build/
|
|
43
|
+
esm/
|
|
44
|
+
|
|
45
|
+
tmp/
|
|
46
|
+
|
|
47
|
+
yarn.lock
|
|
48
|
+
package-lock.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lts/*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"description": "{{description}}",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"skill": {},
|
|
6
|
+
"homepage": "https://github.com/[YOUR REPO PATH]",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/[YOUR REPO PATH]/issues"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"scripts": {},
|
|
12
|
+
"dependencies": {},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { plugin as default } from '@sprucelabs/spruce-event-plugin'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import pathUtil from 'path'
|
|
2
|
+
import Skill from '@sprucelabs/spruce-skill-booter'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default new Skill({
|
|
6
|
+
rootDir: pathUtil.join(__dirname, '..', '..'),
|
|
7
|
+
activeDir: pathUtil.join(__dirname, '..'),
|
|
8
|
+
hashSpruceDir: pathUtil.join(__dirname, '..', '.spruce'),
|
|
9
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import AbstractSpruceError from '@sprucelabs/error'
|
|
2
|
+
import ErrorOptions from '#spruce/errors/options.types'
|
|
3
|
+
|
|
4
|
+
export default class SpruceError extends AbstractSpruceError<ErrorOptions> {
|
|
5
|
+
public friendlyMessage(): string {
|
|
6
|
+
const { options } = this
|
|
7
|
+
let message
|
|
8
|
+
|
|
9
|
+
switch (options?.code) {
|
|
10
|
+
default:
|
|
11
|
+
message = super.friendlyMessage()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const fullMessage = options.friendlyMessage
|
|
15
|
+
? options.friendlyMessage
|
|
16
|
+
: message
|
|
17
|
+
|
|
18
|
+
return fullMessage
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// AUTO-GENERATED. ALL CHANGES WILL BE OVERWRITTEN
|
|
2
|
+
import AbstractSpruceError from '@sprucelabs/error'
|
|
3
|
+
import {
|
|
4
|
+
HEALTH_DIVIDER,
|
|
5
|
+
ERROR_DIVIDER,
|
|
6
|
+
pluginUtil,
|
|
7
|
+
} from '@sprucelabs/spruce-skill-utils'
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
import skill from '#spruce/skill'
|
|
10
|
+
|
|
11
|
+
const isHealthCheck = !!process.argv.find((arg) => arg === '--health')
|
|
12
|
+
|
|
13
|
+
async function run() {
|
|
14
|
+
await pluginUtil.import([skill], skill.hashSpruceDir)
|
|
15
|
+
|
|
16
|
+
if (isHealthCheck) {
|
|
17
|
+
const health = await skill.checkHealth()
|
|
18
|
+
console.log(HEALTH_DIVIDER)
|
|
19
|
+
console.log(JSON.stringify(health))
|
|
20
|
+
console.log(HEALTH_DIVIDER)
|
|
21
|
+
} else {
|
|
22
|
+
await skill.execute()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
run()
|
|
27
|
+
.then(() => {})
|
|
28
|
+
.catch((err) => {
|
|
29
|
+
if (err instanceof AbstractSpruceError && process.env.IS_CLI) {
|
|
30
|
+
console.error(ERROR_DIVIDER + err.toJson() + ERROR_DIVIDER)
|
|
31
|
+
} else {
|
|
32
|
+
console.error(err.stack ?? err.message)
|
|
33
|
+
}
|
|
34
|
+
process.exit(1)
|
|
35
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"skipLibCheck": true,
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"target": "ES2017",
|
|
7
|
+
"lib": [
|
|
8
|
+
"DOM",
|
|
9
|
+
"es2017",
|
|
10
|
+
"ES2020"
|
|
11
|
+
],
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"allowJs": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"noImplicitReturns": true,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"sourceMap": false,
|
|
22
|
+
"outDir": "build",
|
|
23
|
+
"baseUrl": "src",
|
|
24
|
+
"experimentalDecorators": true,
|
|
25
|
+
"paths": {
|
|
26
|
+
"#spruce/*": [
|
|
27
|
+
".spruce/*"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"./src/*.ts",
|
|
33
|
+
"./src/**/*.ts",
|
|
34
|
+
"./src/.spruce/**/*"
|
|
35
|
+
],
|
|
36
|
+
"exclude": [
|
|
37
|
+
"build",
|
|
38
|
+
"esm"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { plugin as default } from '@sprucelabs/spruce-conversation-plugin'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TopicDefinition } from '@sprucelabs/spruce-conversation-plugin'
|
|
2
|
+
|
|
3
|
+
const topicDefinition: TopicDefinition = {
|
|
4
|
+
label: '{{nameReadable}}',
|
|
5
|
+
utterances: ['book appointment', 'Can i book my appointment?', 'book now', 'do you have any times available?', 'what is the wait time?'],
|
|
6
|
+
script: ['Sweet, lets book!', 'Lemme find your appointment!', async (options) => {
|
|
7
|
+
const confirm = await options.ui.confirm('Ok, you ready to do this?')
|
|
8
|
+
if (!confirm) {
|
|
9
|
+
await options.ui.renderLine('Ok, see you later!')
|
|
10
|
+
return {
|
|
11
|
+
transitionConversationTo: 'discovery'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return
|
|
16
|
+
}],
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default topicDefinition
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { plugin as default } from '@sprucelabs/spruce-deploy-plugin'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{{#if renderClassDefinition}}
|
|
2
|
+
import BaseSpruceError from '@sprucelabs/error'
|
|
3
|
+
import ErrorOptions from '#spruce/errors/options.types'
|
|
4
|
+
|
|
5
|
+
export default class SpruceError extends BaseSpruceError<ErrorOptions>{
|
|
6
|
+
|
|
7
|
+
/** an easy to understand version of the errors */
|
|
8
|
+
public friendlyMessage():string {
|
|
9
|
+
|
|
10
|
+
const { options } = this
|
|
11
|
+
let message
|
|
12
|
+
switch (options?.code) {
|
|
13
|
+
{{/if}}
|
|
14
|
+
{{#each errors}}
|
|
15
|
+
case '{{code}}':
|
|
16
|
+
message = '{{#if description}}{{{escape description}}}{{else}}A {{{escape nameReadable}}} just happened!{{/if}}'
|
|
17
|
+
break
|
|
18
|
+
{{/each}}
|
|
19
|
+
{{#if renderClassDefinition}}
|
|
20
|
+
default:
|
|
21
|
+
message = super.friendlyMessage()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const fullMessage = options.friendlyMessage
|
|
25
|
+
? options.friendlyMessage
|
|
26
|
+
: message
|
|
27
|
+
|
|
28
|
+
return fullMessage
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
{{/if}}
|