@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.
Files changed (118) hide show
  1. package/build/addons/eq.addon.js +0 -1
  2. package/build/addons/escape.addon.js +0 -1
  3. package/build/addons/fieldDefinitionBodyPartial.addon.js +0 -1
  4. package/build/addons/fieldDefinitionOptions.addon.js +0 -1
  5. package/build/addons/fieldTypeEnum.addon.js +0 -1
  6. package/build/addons/fieldValue.addon.js +0 -1
  7. package/build/addons/gt.addon.js +0 -1
  8. package/build/addons/hasKeys.addon.js +0 -1
  9. package/build/addons/hasNoneCoreSchemaTemplateItems.addon.js +0 -1
  10. package/build/addons/importRelatedSchemas.addon.js +0 -1
  11. package/build/addons/isDefined.addon.js +0 -1
  12. package/build/addons/json.addon.js +0 -1
  13. package/build/addons/neq.addon.js +0 -1
  14. package/build/addons/operators.addon.js +0 -1
  15. package/build/addons/pascalCase.addon.js +0 -1
  16. package/build/addons/permissionContractBuilder.addon.js +0 -1
  17. package/build/addons/schemaBodyPartial.addon.js +0 -1
  18. package/build/addons/schemaNamespacePath.addon.js +0 -1
  19. package/build/addons/schemaValuesPartial.addon.js +0 -1
  20. package/build/addons/valueTypeGenerator.addon.js +0 -1
  21. package/build/addons/valueTypeLiteral.addon.js +0 -1
  22. package/build/addons/valueTypeMapper.addon.js +0 -1
  23. package/build/index.d.ts +1 -0
  24. package/build/index.js +0 -1
  25. package/build/templates/directories/skill/.eslintignore +3 -0
  26. package/build/templates/directories/skill/.eslintrc.js +3 -0
  27. package/build/templates/directories/skill/.gitignore +48 -0
  28. package/build/templates/directories/skill/.nvmrc +1 -0
  29. package/build/templates/directories/skill/README.md +4 -0
  30. package/build/templates/directories/skill/package.json.hbs +15 -0
  31. package/build/templates/directories/skill/src/.spruce/errors/options.types.ts +4 -0
  32. package/build/templates/directories/skill/src/.spruce/features/event.plugin.ts +1 -0
  33. package/build/templates/directories/skill/src/.spruce/skill.ts +9 -0
  34. package/build/templates/directories/skill/src/errors/SpruceError.ts.hbs +20 -0
  35. package/build/templates/directories/skill/src/index.ts +35 -0
  36. package/build/templates/directories/skill/tsconfig.json +40 -0
  37. package/build/templates/directories/vscode/.vscode/launch.json +58 -0
  38. package/build/templates/directories/vscode/.vscode/settings.json +70 -0
  39. package/build/templates/directories/vscode/.vscode/tasks.json +112 -0
  40. package/build/templates/typescript/conversation/conversation.plugin.ts.hbs +1 -0
  41. package/build/templates/typescript/conversation/conversation.topic.ts.hbs +19 -0
  42. package/build/templates/typescript/deploy/deploy.plugin.ts.hbs +1 -0
  43. package/build/templates/typescript/error/SpruceError.ts.hbs +31 -0
  44. package/build/templates/typescript/error/error.plugin.ts.hbs +79 -0
  45. package/build/templates/typescript/error/example.ts.hbs +10 -0
  46. package/build/templates/typescript/error/options.types.ts.hbs +12 -0
  47. package/build/templates/typescript/event/event.contract.ts.hbs +24 -0
  48. package/build/templates/typescript/event/event.options.ts.hbs +11 -0
  49. package/build/templates/typescript/event/events.contract.ts.hbs +24 -0
  50. package/build/templates/typescript/event/listener.ts.hbs +23 -0
  51. package/build/templates/typescript/event/listeners.ts.hbs +15 -0
  52. package/build/templates/typescript/event/payload.builder.ts.hbs +15 -0
  53. package/build/templates/typescript/log/transport.plugin.ts.hbs +14 -0
  54. package/build/templates/typescript/permissions/contract.builder.ts.hbs +36 -0
  55. package/build/templates/typescript/permissions/permission.plugin.ts.hbs +1 -0
  56. package/build/templates/typescript/permissions/permissions.ts.hbs +13 -0
  57. package/build/templates/typescript/permissions/permissions.types.ts.hbs +14 -0
  58. package/build/templates/typescript/polish/polish.ts.hbs +67 -0
  59. package/build/templates/typescript/sandbox/will-boot.listener.ts.hbs +109 -0
  60. package/build/templates/typescript/schema/builder.ts.hbs +24 -0
  61. package/build/templates/typescript/schema/core.schemas.types.ts.hbs +35 -0
  62. package/build/templates/typescript/schema/example.ts.hbs +20 -0
  63. package/build/templates/typescript/schema/fields/fieldClassMap.ts.hbs +16 -0
  64. package/build/templates/typescript/schema/fields/fields.types.ts.hbs +1 -0
  65. package/build/templates/typescript/schema/imported.schema.ts.hbs +1 -0
  66. package/build/templates/typescript/schema/partials/fieldDefinitionBody.ts.hbs +12 -0
  67. package/build/templates/typescript/schema/partials/schemaBody.ts.hbs +20 -0
  68. package/build/templates/typescript/schema/partials/schemaValues.ts.hbs +7 -0
  69. package/build/templates/typescript/schema/schema.plugin.ts.hbs +102 -0
  70. package/build/templates/typescript/schema/schema.ts.hbs +12 -0
  71. package/build/templates/typescript/schema/schemas.types.ts.hbs +42 -0
  72. package/build/templates/typescript/schema/valueTypes.ts.hbs +67 -0
  73. package/build/templates/typescript/store/Store.store.ts.hbs +95 -0
  74. package/build/templates/typescript/store/store.plugin.ts.hbs +1 -0
  75. package/build/templates/typescript/store/stores.ts.hbs +9 -0
  76. package/build/templates/typescript/store/stores.types.ts.hbs +17 -0
  77. package/build/templates/typescript/test/Test.test.ts.hbs +20 -0
  78. package/build/templates/typescript/view/View.svc.ts.hbs +18 -0
  79. package/build/templates/typescript/view/View.vc.ts.hbs +12 -0
  80. package/build/templates/typescript/view/skill.theme.ts.hbs +70 -0
  81. package/build/templates/typescript/view/view.plugin.ts.hbs +1 -0
  82. package/build/templates/typescript/view/views.ts.hbs +54 -0
  83. package/build/types/templates.types.js +1 -2
  84. package/build/utilities/DirectoryTemplateUtility.js +0 -1
  85. package/build/utilities/KeyGeneratorUtility.js +0 -1
  86. package/build/utilities/importExtractor.utility.js +0 -1
  87. package/build/utilities/templateImporter.utility.js +0 -1
  88. package/build/utilities/templateItem.utility.js +0 -1
  89. package/package.json +5 -5
  90. package/build/addons/eq.addon.js.map +0 -1
  91. package/build/addons/escape.addon.js.map +0 -1
  92. package/build/addons/fieldDefinitionBodyPartial.addon.js.map +0 -1
  93. package/build/addons/fieldDefinitionOptions.addon.js.map +0 -1
  94. package/build/addons/fieldTypeEnum.addon.js.map +0 -1
  95. package/build/addons/fieldValue.addon.js.map +0 -1
  96. package/build/addons/gt.addon.js.map +0 -1
  97. package/build/addons/hasKeys.addon.js.map +0 -1
  98. package/build/addons/hasNoneCoreSchemaTemplateItems.addon.js.map +0 -1
  99. package/build/addons/importRelatedSchemas.addon.js.map +0 -1
  100. package/build/addons/isDefined.addon.js.map +0 -1
  101. package/build/addons/json.addon.js.map +0 -1
  102. package/build/addons/neq.addon.js.map +0 -1
  103. package/build/addons/operators.addon.js.map +0 -1
  104. package/build/addons/pascalCase.addon.js.map +0 -1
  105. package/build/addons/permissionContractBuilder.addon.js.map +0 -1
  106. package/build/addons/schemaBodyPartial.addon.js.map +0 -1
  107. package/build/addons/schemaNamespacePath.addon.js.map +0 -1
  108. package/build/addons/schemaValuesPartial.addon.js.map +0 -1
  109. package/build/addons/valueTypeGenerator.addon.js.map +0 -1
  110. package/build/addons/valueTypeLiteral.addon.js.map +0 -1
  111. package/build/addons/valueTypeMapper.addon.js.map +0 -1
  112. package/build/index.js.map +0 -1
  113. package/build/types/templates.types.js.map +0 -1
  114. package/build/utilities/DirectoryTemplateUtility.js.map +0 -1
  115. package/build/utilities/KeyGeneratorUtility.js.map +0 -1
  116. package/build/utilities/importExtractor.utility.js.map +0 -1
  117. package/build/utilities/templateImporter.utility.js.map +0 -1
  118. package/build/utilities/templateItem.utility.js.map +0 -1
@@ -7,4 +7,3 @@ const handlebars_1 = __importDefault(require("handlebars"));
7
7
  handlebars_1.default.registerHelper('eq', (num, min) => {
8
8
  return num === min;
9
9
  });
10
- //# sourceMappingURL=eq.addon.js.map
@@ -8,4 +8,3 @@ const handlebars_1 = __importDefault(require("handlebars"));
8
8
  handlebars_1.default.registerHelper('escape', function (variable) {
9
9
  return variable && variable.replace && variable.replace(/(['])/g, '\\$1');
10
10
  });
11
- //# sourceMappingURL=escape.addon.js.map
@@ -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
@@ -71,4 +71,3 @@ handlebars_1.default.registerHelper('fieldDefinitionOptions', function (namespac
71
71
  template += '}';
72
72
  return template;
73
73
  });
74
- //# sourceMappingURL=fieldDefinitionOptions.addon.js.map
@@ -12,4 +12,3 @@ handlebars_1.default.registerHelper('fieldTypeEnum', function (fieldDefinitions)
12
12
  const { type } = fieldDefinitions;
13
13
  return `'${type}'`;
14
14
  });
15
- //# sourceMappingURL=fieldTypeEnum.addon.js.map
@@ -11,4 +11,3 @@ handlebars_1.default.registerHelper('fieldValue', function (fieldDefinitions, va
11
11
  }
12
12
  return value;
13
13
  });
14
- //# sourceMappingURL=fieldValue.addon.js.map
@@ -7,4 +7,3 @@ const handlebars_1 = __importDefault(require("handlebars"));
7
7
  handlebars_1.default.registerHelper('gt', (num, min) => {
8
8
  return num > min;
9
9
  });
10
- //# sourceMappingURL=gt.addon.js.map
@@ -7,4 +7,3 @@ const handlebars_1 = __importDefault(require("handlebars"));
7
7
  handlebars_1.default.registerHelper('hasKeys', function (value) {
8
8
  return typeof value === 'object' ? Object.keys(value).length > 0 : false;
9
9
  });
10
- //# sourceMappingURL=hasKeys.addon.js.map
@@ -9,4 +9,3 @@ handlebars_1.default.registerHelper('hasNonCoreSchemaTemplateItems', function (s
9
9
  return (schemaTemplateItems.filter((i) => i.namespace !== spruce_skill_utils_1.CORE_NAMESPACE).length >
10
10
  0);
11
11
  });
12
- //# sourceMappingURL=hasNoneCoreSchemaTemplateItems.addon.js.map
@@ -35,4 +35,3 @@ handlebars_1.default.registerHelper('importRelatedSchemas', function (schema, op
35
35
  });
36
36
  return (0, lodash_1.uniq)(imports).join('\n');
37
37
  });
38
- //# sourceMappingURL=importRelatedSchemas.addon.js.map
@@ -8,4 +8,3 @@ const handlebars_1 = __importDefault(require("handlebars"));
8
8
  handlebars_1.default.registerHelper('isDefined', function (value) {
9
9
  return value !== undefined;
10
10
  });
11
- //# sourceMappingURL=isDefined.addon.js.map
@@ -10,4 +10,3 @@ handlebars_1.default.registerHelper('json', function (arg1) {
10
10
  const value = JSON.stringify(arg1);
11
11
  return value;
12
12
  });
13
- //# sourceMappingURL=json.addon.js.map
@@ -7,4 +7,3 @@ const handlebars_1 = __importDefault(require("handlebars"));
7
7
  handlebars_1.default.registerHelper('neq', (val1, val2) => {
8
8
  return val1 !== val2;
9
9
  });
10
- //# sourceMappingURL=neq.addon.js.map
@@ -18,4 +18,3 @@ handlebars_1.default.registerHelper({
18
18
  return Array.prototype.slice.call(params, 0, -1).some(Boolean);
19
19
  },
20
20
  });
21
- //# sourceMappingURL=operators.addon.js.map
@@ -9,4 +9,3 @@ const lodash_1 = require("lodash");
9
9
  handlebars_1.default.registerHelper('pascalCase', (val) => {
10
10
  return (0, lodash_1.upperFirst)(val);
11
11
  });
12
- //# sourceMappingURL=pascalCase.addon.js.map
@@ -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
@@ -21,4 +21,3 @@ handlebars_1.default.registerHelper('schemaNamespacePath', function (options) {
21
21
  path += `.${schemaTemplateItem.namePascal}`;
22
22
  return path;
23
23
  });
24
- //# sourceMappingURL=schemaNamespacePath.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
@@ -35,4 +35,3 @@ handlebars_1.default.registerHelper('valueTypeLiteral', function (namespace, nam
35
35
  }
36
36
  return valueType;
37
37
  });
38
- //# sourceMappingURL=valueTypeLiteral.addon.js.map
@@ -12,4 +12,3 @@ handlebars_1.default.registerHelper('valueTypeMapper', function (typeMapper, ren
12
12
  return typeMapper;
13
13
  }
14
14
  });
15
- //# sourceMappingURL=valueTypeMapper.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,3 @@
1
+ build
2
+ esm
3
+ node_modules
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: 'spruce',
3
+ }
@@ -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,4 @@
1
+ # [Your Skill Name]
2
+
3
+ ## Useful links
4
+ * [Spruce Developer Documentation: https://developer.spruce.ai](https://developer.spruce.ai)
@@ -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,4 @@
1
+ type ErrorOptions = { code: 'NO_ERRORS_CREATED', friendlyMessage?: string }
2
+
3
+ export default ErrorOptions
4
+
@@ -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}}