@sprucelabs/spruce-cli 14.29.0 → 14.29.4
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/CHANGELOG.md +32 -0
- package/build/__tests__/behavioral/events/CreatingAListener.test.d.ts +1 -0
- package/build/__tests__/behavioral/events/CreatingAListener.test.js +67 -24
- package/build/__tests__/behavioral/events/CreatingAListener.test.js.map +1 -1
- package/build/__tests__/behavioral/{ListeningToAnEventYouCreate.test.d.ts → events/ListeningToAnEventYouCreate.test.d.ts} +1 -1
- package/build/__tests__/behavioral/{ListeningToAnEventYouCreate.test.js → events/ListeningToAnEventYouCreate.test.js} +2 -2
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js.map +1 -0
- package/build/__tests__/implementation/LintService.test.d.ts +5 -0
- package/build/__tests__/implementation/LintService.test.js +130 -0
- package/build/__tests__/implementation/LintService.test.js.map +1 -0
- package/build/errors/SpruceError.js +8 -4
- package/build/errors/SpruceError.js.map +1 -1
- package/build/features/node/NodeFeature.js +1 -1
- package/build/features/node/NodeFeature.js.map +1 -1
- package/build/features/store/StoreFeature.js +10 -5
- package/build/features/store/StoreFeature.js.map +1 -1
- package/build/schemas/v2020_07_22/personWithToken.builder.js +1 -0
- package/build/schemas/v2020_07_22/personWithToken.builder.js.map +1 -1
- package/build/services/GameService.js +14 -10
- package/build/services/GameService.js.map +1 -1
- package/build/services/LintService.d.ts +2 -2
- package/build/services/LintService.js +30 -14
- package/build/services/LintService.js.map +1 -1
- package/build/services/ServiceFactory.js +8 -2
- package/build/services/ServiceFactory.js.map +1 -1
- package/package.json +34 -34
- package/src/__tests__/behavioral/events/CreatingAListener.test.ts +20 -0
- package/src/__tests__/behavioral/{ListeningToAnEventYouCreate.test.ts → events/ListeningToAnEventYouCreate.test.ts} +2 -2
- package/src/__tests__/implementation/LintService.test.ts +34 -0
- package/src/errors/SpruceError.ts +9 -5
- package/src/features/node/NodeFeature.ts +2 -1
- package/src/features/store/StoreFeature.ts +4 -1
- package/src/schemas/v2020_07_22/personWithToken.builder.ts +1 -0
- package/src/services/GameService.ts +1 -0
- package/src/services/LintService.ts +17 -5
- package/src/services/ServiceFactory.ts +2 -3
- package/build/__tests__/behavioral/ListeningToAnEventYouCreate.test.js.map +0 -1
- package/build/__tests__/behavioral/README.md +0 -8
- package/build/__tests__/implementation/README.md +0 -5
- package/build/components/README.md +0 -5
- package/src/__tests__/behavioral/README.md +0 -8
- package/src/__tests__/implementation/README.md +0 -5
- package/src/components/README.md +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors/SpruceError.ts"],"names":["SpruceError","options","message","code","args","length","join","friendlyMessage","originalError","stack","name","command","file","pattern","cmd","cwd","stderr","cleanStdErr","stdout","schemaId","destination","featureCode","fileName","testName","errorMessage","split","map","line","errors","responseErrors","errorMessages","err","push","fullyQualifiedEventName","brokenProperty","dependencies","d","hint","namesUtil","toPascal","schemaNamespace","fieldName","JSON","stringify","fieldOptions","namespace","replace","trim","AbstractSpruceError"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;IAGqBA,W;;;;;;;;;;;;;AACpB;AACA,+BAAiC;AAAA;;AAChC,UAAQC,OAAR,GAAoB,IAApB,CAAQA,OAAR;AACA,UAAIC,OAAJ;;AAEA,cAAQD,OAAR,aAAQA,OAAR,uBAAQA,OAAO,CAAEE,IAAjB;AACC,aAAK,iBAAL;AACC,cAAI,CAACF,OAAO,CAACG,IAAT,IAAiBH,OAAO,CAACG,IAAR,CAAaC,MAAb,KAAwB,CAA7C,EAAgD;AAC/CH,YAAAA,OAAO,qEAAP;AACA,WAFD,MAEO;AACNA,YAAAA,OAAO,gEAA+CD,OAAO,CAACG,IAAR,CAAaE,IAAb,CACrD,GADqD,CAA/C,MAAP;AAGA;;AACDJ,UAAAA,OAAO,IAAI,8BAAX;AACA;;AAED,aAAK,SAAL;AACCA,UAAAA,OAAO,4BAAG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AAjC,sBAAP;AACA;;AAED,aAAK,mBAAL;AACCR,UAAAA,OAAO,8BAAuBD,OAAO,CAAC4C,SAA/B,sBAAP;AACA;;AAED;AACC3C,UAAAA,OAAO,qHAAP;AAxPF;;AA2PA,aAAOA,OAAP;AACA;;;WAED,qBAAoBc,MAApB,EAAoC;AACnC,aAAOA,MAAM,CAAC8B,OAAP,CAAe,wCAAf,EAAyD,EAAzD,EAA6DC,IAA7D,EAAP;AACA;;;EAtQuCC,iB","sourcesContent":["import AbstractSpruceError from '@sprucelabs/error'\nimport { namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport upperFirst from 'lodash/upperFirst'\nimport ErrorOptions from '#spruce/errors/options.types'\n\nexport default class SpruceError extends AbstractSpruceError<ErrorOptions> {\n\t/** An easy to understand version of the errors */\n\tpublic friendlyMessage(): string {\n\t\tconst { options } = this\n\t\tlet message\n\n\t\tswitch (options?.code) {\n\t\t\tcase 'INVALID_COMMAND':\n\t\t\t\tif (!options.args || options.args.length === 0) {\n\t\t\t\t\tmessage = `Hey friend 👋.. I don't support the command you tried.`\n\t\t\t\t} else {\n\t\t\t\t\tmessage = `Hey friend 👋. I don't know the command: ${options.args.join(\n\t\t\t\t\t\t' '\n\t\t\t\t\t)}.`\n\t\t\t\t}\n\t\t\t\tmessage += ' Try running `spruce --help`'\n\t\t\t\tbreak\n\n\t\t\tcase 'GENERIC':\n\t\t\t\tmessage = options.friendlyMessage ?? 'Oh shoot! 🤔'\n\n\t\t\t\tif (options.originalError) {\n\t\t\t\t\tmessage += `\\n\\n${\n\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.name\n\t\t\t\t\t}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'NOT_IMPLEMENTED':\n\t\t\t\tmessage = ''\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'COMMAND_NOT_IMPLEMENTED':\n\t\t\t\tmessage = `${options.command} has not yet been implemented. ${\n\t\t\t\t\toptions.args ? `Args: ${options.args.join(', ')}` : ''\n\t\t\t\t}`\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_FAILED_TO_IMPORT':\n\t\t\t\tmessage = `Error importing \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BUILD_FAILED':\n\t\t\t\tmessage = `Build${\n\t\t\t\t\toptions.file ? `ing ${options.file}` : ''\n\t\t\t\t} failed. It looks like you're not running 'yarn watch'. Run it and then run 'spruce all:sync'.`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FAILED_TO_IMPORT':\n\t\t\t\tmessage =\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\t`Failed to import \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'LINT_FAILED':\n\t\t\t\tmessage = `Lint failed on pattern ${options.pattern}.`\n\n\t\t\t\tif (options.originalError) {\n\t\t\t\t\tmessage += `\\n\\nOriginal error:${\n\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.message\n\t\t\t\t\t}`\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'EXECUTING_COMMAND_FAILED':\n\t\t\t\tif (this.originalError && this.originalError.message) {\n\t\t\t\t\tmessage = this.originalError.message + '\\n\\n'\n\t\t\t\t} else {\n\t\t\t\t\tmessage = ''\n\t\t\t\t}\n\t\t\t\tmessage += `Executing command failed '${options.cmd}'.\\n\\n`\n\t\t\t\tif (options.cwd) {\n\t\t\t\t\tmessage += `cwd: ${options.cwd}\\n\\n`\n\t\t\t\t}\n\n\t\t\t\tif (options.stderr) {\n\t\t\t\t\tmessage += this.cleanStdErr(options.stderr) + '\\n\\n'\n\t\t\t\t}\n\n\t\t\t\tif (options.stdout) {\n\t\t\t\t\tmessage += options.stdout\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'CREATE_AUTOLOADER_FAILED':\n\t\t\t\tmessage = 'A Could not create an autoloader just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_EMPTY':\n\t\t\t\tmessage = 'A directory empty just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'FILE_EXISTS':\n\t\t\t\tmessage = 'A fail already exists.'\n\t\t\t\tbreak\n\n\t\t\tcase 'VSCODE_NOT_INSTALLED':\n\t\t\t\tmessage =\n\t\t\t\t\t\"vscode's 'code' is not installed.\\n\\nMac instructions: https://code.visualstudio.com/docs/setup/mac\\n\\nLinux instructions: https://code.visualstudio.com/docs/setup/linux\\n\\nWindows instructions: https://code.visualstudio.com/docs/setup/windows\"\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_EXISTS':\n\t\t\t\tmessage = `A schema called ${options.schemaId} already exists at ${options.destination}`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_ABORTED':\n\t\t\t\tmessage = 'Aborted! See ya later! ✌️'\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_FEATURE_CODE':\n\t\t\t\tmessage = `Oh no! I couldn't find a feature with the code '${options.featureCode}'.`\n\t\t\t\tbreak\n\n\t\t\tcase 'TEST_FAILED':\n\t\t\t\tmessage = `${options.fileName}\\n - ${\n\t\t\t\t\toptions.testName\n\t\t\t\t}\\n\\n${options.errorMessage\n\t\t\t\t\t.split('\\n')\n\t\t\t\t\t.map((line) => ` ${line}`)\n\t\t\t\t\t.join('\\n')}`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FEATURE_NOT_INSTALLED':\n\t\t\t\tmessage = `\\`${upperFirst(\n\t\t\t\t\toptions.featureCode\n\t\t\t\t)}\\` feature is not installed. Install it first, then try again.`\n\t\t\t\tbreak\n\n\t\t\tcase 'MERCURY_RESPONSE_ERROR': {\n\t\t\t\tconst errors = options.responseErrors\n\t\t\t\tmessage = `Got ${\n\t\t\t\t\terrors.length === 1 ? 'an error' : `${errors.length} errors`\n\t\t\t\t} from the server:\\n\\n`\n\n\t\t\t\tconst errorMessages: string[] = []\n\t\t\t\tfor (const err of errors) {\n\t\t\t\t\terrorMessages.push(err.message)\n\t\t\t\t}\n\n\t\t\t\tmessage += errorMessages.join('\\n')\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase 'INVALID_TEST_DIRECTORY':\n\t\t\t\tmessage = `You are missing dependencies I need to run tests. Try \\`spruce test.install\\` to reinstall.`\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_NOT_SKILL':\n\t\t\t\tmessage = 'The directory you are in is not a skill!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_REGISTERED':\n\t\t\t\tmessage = `Dang! I can't continue until you register your skill! Run \\`spruce login\\` and then \\`spruce register.skill\\` to get the ball rolling!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_ORGANIZATIONS_FOUND':\n\t\t\t\tmessage =\n\t\t\t\t\t\"It looks like you don't have any organizations setup yet. Try `spruce create.organization` first.\"\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_EVENT_CONTRACT':\n\t\t\t\tmessage = `The event named \\`${options.fullyQualifiedEventName}\\` is not valid. Check ${options.brokenProperty}. The original error is:\\n\\n${options.originalError?.message}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BOOT_ERROR':\n\t\t\t\tmessage = `Booting your skill failed: ${\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\toptions.originalError?.message ??\n\t\t\t\t\t'Not sure why, tho.'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPLOY_FAILED':\n\t\t\t\tmessage = 'Deploy halted!'\n\t\t\t\tbreak\n\n\t\t\tcase 'MISSING_DEPENDENCIES':\n\t\t\t\tmessage = `Looks like you're missing some dependencies:\\n\\n${options.dependencies\n\t\t\t\t\t.map((d) => `${d.name}: ${d.hint}`)\n\t\t\t\t\t.join('\\n')}`\n\t\t\t\tbreak\n\n\t\t\tcase 'STORE_EXISTS':\n\t\t\t\tmessage = 'A Store exists just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'NOT_LOGGED_IN':\n\t\t\t\tmessage = 'You have to be logged in to do that!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_FOUND':\n\t\t\t\tmessage = options.friendlyMessage ?? `I couldn't find that skill!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_SKILLS_REGISTERED':\n\t\t\t\tmessage = `Whoa! Looks like you haven't registered your skill yet! Try \\`spruce register\\` to get that done!`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_BLOCKED':\n\t\t\t\tmessage = `${options.command} is blocked! ${options.hint}`\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_VIEW_EXISTS':\n\t\t\t\tmessage = `A skill view controller already exists named ${options.name}!`\n\t\t\t\tbreak\n\n\t\t\tcase 'THEME_EXISTS':\n\t\t\t\tmessage = `Yikes! You can't create a new theme. One per skill for now.`\n\t\t\t\tbreak\n\n\t\t\tcase 'CACHE_NOT_ENABLED':\n\t\t\t\tmessage = \"Cache is not enabled, so it can't be disabled!\"\n\t\t\t\tbreak\n\n\t\t\tcase 'DOCKER_NOT_STARTED':\n\t\t\t\tmessage = 'Docker has not been started! Start it and try again!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_TEMPLATE_ITEM_BUILDING_FAILED':\n\t\t\t\tmessage = `Failed to build schema template item for '${namesUtil.toPascal(\n\t\t\t\t\toptions.schemaNamespace\n\t\t\t\t)}.${options.schemaId}'. The field I had an issue on was '${\n\t\t\t\t\toptions.fieldName\n\t\t\t\t}'. It's options are:\\n\\n${JSON.stringify(\n\t\t\t\t\toptions.fieldOptions\n\t\t\t\t)}.\\n\\nChances are you have a circular reference in your schemas. You'll need to extract shared fields to a new file and have your schemas mix those in, vs referencing eath other.`\n\t\t\t\tbreak\n\n\t\t\tcase 'ACTION_CANCELLED':\n\t\t\t\tmessage = 'A Action cancelled just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'TRANSPORT_ALREADY_EXISTS':\n\t\t\t\tmessage = `A transport named '${options.name}' already exists!`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPENDENCY_EXISTS':\n\t\t\t\tmessage = `You already have ${options.namespace} as a dependency!`\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tmessage = super.friendlyMessage()\n\t\t}\n\n\t\treturn message\n\t}\n\n\tprivate cleanStdErr(stderr: string) {\n\t\treturn stderr.replace('warning package.json: No license field', '').trim()\n\t}\n}\n"],"file":"SpruceError.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/errors/SpruceError.ts"],"names":["SpruceError","options","message","code","args","length","join","friendlyMessage","originalError","stack","name","command","file","pattern","cmd","cwd","stderr","cleanStdErr","stdout","schemaId","destination","featureCode","fileName","testName","errorMessage","split","map","line","errors","responseErrors","errorMessages","err","push","fullyQualifiedEventName","brokenProperty","dependencies","d","hint","namesUtil","toPascal","schemaNamespace","fieldName","JSON","stringify","fieldOptions","namespace","replace","trim","AbstractSpruceError"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;IAGqBA,W;;;;;;;;;;;;;AACpB;AACA,+BAAiC;AAAA;;AAChC,UAAQC,OAAR,GAAoB,IAApB,CAAQA,OAAR;AACA,UAAIC,OAAJ;;AAEA,cAAQD,OAAR,aAAQA,OAAR,uBAAQA,OAAO,CAAEE,IAAjB;AACC,aAAK,iBAAL;AACC,cAAI,CAACF,OAAO,CAACG,IAAT,IAAiBH,OAAO,CAACG,IAAR,CAAaC,MAAb,KAAwB,CAA7C,EAAgD;AAC/CH,YAAAA,OAAO,qEAAP;AACA,WAFD,MAEO;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hD,cAEFvC,OAAO,CAACkB,QAFN,iDAGNlB,OAAO,CAACwC,SAHF,qCAIoBC,IAAI,CAACC,SAAL,CAC1B1C,OAAO,CAAC2C,YADkB,CAJpB,sLAAP;AAOA;;AAED,aAAK,kBAAL;AACC1C,UAAAA,OAAO,GAAG,mCAAV;AACA;;AAED,aAAK,0BAAL;AACCA,UAAAA,OAAO,gCAAyBD,OAAO,CAACS,IAAjC,sBAAP;AACA;;AAED,aAAK,mBAAL;AACCR,UAAAA,OAAO,8BAAuBD,OAAO,CAAC4C,SAA/B,sBAAP;AACA;;AAED;AACC3C,UAAAA,OAAO,qHAAP;AA5PF;;AA+PA,aAAOA,OAAP;AACA;;;WAED,qBAAoBc,MAApB,EAAoC;AACnC,aAAOA,MAAM,CAAC8B,OAAP,CAAe,wCAAf,EAAyD,EAAzD,EAA6DC,IAA7D,EAAP;AACA;;;EA1QuCC,iB","sourcesContent":["import AbstractSpruceError from '@sprucelabs/error'\nimport { namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport upperFirst from 'lodash/upperFirst'\nimport ErrorOptions from '#spruce/errors/options.types'\n\nexport default class SpruceError extends AbstractSpruceError<ErrorOptions> {\n\t/** An easy to understand version of the errors */\n\tpublic friendlyMessage(): string {\n\t\tconst { options } = this\n\t\tlet message\n\n\t\tswitch (options?.code) {\n\t\t\tcase 'INVALID_COMMAND':\n\t\t\t\tif (!options.args || options.args.length === 0) {\n\t\t\t\t\tmessage = `Hey friend 👋.. I don't support the command you tried.`\n\t\t\t\t} else {\n\t\t\t\t\tmessage = `Hey friend 👋. I don't know the command: ${options.args.join(\n\t\t\t\t\t\t' '\n\t\t\t\t\t)}.`\n\t\t\t\t}\n\t\t\t\tmessage += ' Try running `spruce --help`'\n\t\t\t\tbreak\n\n\t\t\tcase 'GENERIC':\n\t\t\t\tmessage = options.friendlyMessage ?? 'Oh shoot! 🤔'\n\n\t\t\t\tif (options.originalError) {\n\t\t\t\t\tmessage += `\\n\\n${\n\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.name\n\t\t\t\t\t}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'NOT_IMPLEMENTED':\n\t\t\t\tmessage = ''\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'COMMAND_NOT_IMPLEMENTED':\n\t\t\t\tmessage = `${options.command} has not yet been implemented. ${\n\t\t\t\t\toptions.args ? `Args: ${options.args.join(', ')}` : ''\n\t\t\t\t}`\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_FAILED_TO_IMPORT':\n\t\t\t\tmessage = `Error importing \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BUILD_FAILED':\n\t\t\t\tmessage = `Build${\n\t\t\t\t\toptions.file ? `ing ${options.file}` : ''\n\t\t\t\t} failed. It looks like you're not running 'yarn watch'. Run it and then run 'spruce all:sync'.`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FAILED_TO_IMPORT':\n\t\t\t\tmessage =\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\t`Failed to import \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'LINT_FAILED':\n\t\t\t\tmessage = options.friendlyMessage\n\n\t\t\t\tif (!message) {\n\t\t\t\t\tmessage = `Lint failed on pattern ${options.pattern}.`\n\n\t\t\t\t\tif (options.originalError) {\n\t\t\t\t\t\tmessage += `\\n\\nOriginal error:${\n\t\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.message\n\t\t\t\t\t\t}`\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'EXECUTING_COMMAND_FAILED':\n\t\t\t\tif (this.originalError && this.originalError.message) {\n\t\t\t\t\tmessage = this.originalError.message + '\\n\\n'\n\t\t\t\t} else {\n\t\t\t\t\tmessage = ''\n\t\t\t\t}\n\t\t\t\tmessage += `Executing command failed '${options.cmd}'.\\n\\n`\n\t\t\t\tif (options.cwd) {\n\t\t\t\t\tmessage += `cwd: ${options.cwd}\\n\\n`\n\t\t\t\t}\n\n\t\t\t\tif (options.stderr) {\n\t\t\t\t\tmessage += this.cleanStdErr(options.stderr) + '\\n\\n'\n\t\t\t\t}\n\n\t\t\t\tif (options.stdout) {\n\t\t\t\t\tmessage += options.stdout\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'CREATE_AUTOLOADER_FAILED':\n\t\t\t\tmessage = 'A Could not create an autoloader just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_EMPTY':\n\t\t\t\tmessage = 'A directory empty just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'FILE_EXISTS':\n\t\t\t\tmessage = 'A fail already exists.'\n\t\t\t\tbreak\n\n\t\t\tcase 'VSCODE_NOT_INSTALLED':\n\t\t\t\tmessage =\n\t\t\t\t\t\"vscode's 'code' is not installed.\\n\\nMac instructions: https://code.visualstudio.com/docs/setup/mac\\n\\nLinux instructions: https://code.visualstudio.com/docs/setup/linux\\n\\nWindows instructions: https://code.visualstudio.com/docs/setup/windows\"\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_EXISTS':\n\t\t\t\tmessage = `A schema called ${options.schemaId} already exists at ${options.destination}`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_ABORTED':\n\t\t\t\tmessage = 'Aborted! See ya later! ✌️'\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_FEATURE_CODE':\n\t\t\t\tmessage = `Oh no! I couldn't find a feature with the code '${options.featureCode}'.`\n\t\t\t\tbreak\n\n\t\t\tcase 'TEST_FAILED':\n\t\t\t\tmessage = `${options.fileName}\\n - ${\n\t\t\t\t\toptions.testName\n\t\t\t\t}\\n\\n${options.errorMessage\n\t\t\t\t\t.split('\\n')\n\t\t\t\t\t.map((line) => ` ${line}`)\n\t\t\t\t\t.join('\\n')}`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FEATURE_NOT_INSTALLED':\n\t\t\t\tmessage = `\\`${upperFirst(\n\t\t\t\t\toptions.featureCode\n\t\t\t\t)}\\` feature is not installed. Install it first, then try again.`\n\t\t\t\tbreak\n\n\t\t\tcase 'MERCURY_RESPONSE_ERROR': {\n\t\t\t\tconst errors = options.responseErrors\n\t\t\t\tmessage = `Got ${\n\t\t\t\t\terrors.length === 1 ? 'an error' : `${errors.length} errors`\n\t\t\t\t} from the server:\\n\\n`\n\n\t\t\t\tconst errorMessages: string[] = []\n\t\t\t\tfor (const err of errors) {\n\t\t\t\t\terrorMessages.push(err.message)\n\t\t\t\t}\n\n\t\t\t\tmessage += errorMessages.join('\\n')\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase 'INVALID_TEST_DIRECTORY':\n\t\t\t\tmessage = `You are missing dependencies I need to run tests. Try \\`spruce test.install\\` to reinstall.`\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_NOT_SKILL':\n\t\t\t\tmessage = 'The directory you are in is not a skill!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_REGISTERED':\n\t\t\t\tmessage = `Dang! I can't continue until you register your skill! Run \\`spruce login\\` and then \\`spruce register.skill\\` to get the ball rolling!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_ORGANIZATIONS_FOUND':\n\t\t\t\tmessage =\n\t\t\t\t\t\"It looks like you don't have any organizations setup yet. Try `spruce create.organization` first.\"\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_EVENT_CONTRACT':\n\t\t\t\tmessage = `The event named \\`${options.fullyQualifiedEventName}\\` is not valid. Check ${options.brokenProperty}. The original error is:\\n\\n${options.originalError?.message}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BOOT_ERROR':\n\t\t\t\tmessage = `Booting your skill failed: ${\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\toptions.originalError?.message ??\n\t\t\t\t\t'Not sure why, tho.'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPLOY_FAILED':\n\t\t\t\tmessage = 'Deploy halted!'\n\t\t\t\tbreak\n\n\t\t\tcase 'MISSING_DEPENDENCIES':\n\t\t\t\tmessage = `Looks like you're missing some dependencies:\\n\\n${options.dependencies\n\t\t\t\t\t.map((d) => `${d.name}: ${d.hint}`)\n\t\t\t\t\t.join('\\n')}`\n\t\t\t\tbreak\n\n\t\t\tcase 'STORE_EXISTS':\n\t\t\t\tmessage = 'A Store exists just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'NOT_LOGGED_IN':\n\t\t\t\tmessage = 'You have to be logged in to do that!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_FOUND':\n\t\t\t\tmessage = options.friendlyMessage ?? `I couldn't find that skill!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_SKILLS_REGISTERED':\n\t\t\t\tmessage = `Whoa! Looks like you haven't registered your skill yet! Try \\`spruce register\\` to get that done!`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_BLOCKED':\n\t\t\t\tmessage = `${options.command} is blocked! ${options.hint}`\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_VIEW_EXISTS':\n\t\t\t\tmessage = `A skill view controller already exists named ${options.name}!`\n\t\t\t\tbreak\n\n\t\t\tcase 'THEME_EXISTS':\n\t\t\t\tmessage = `Yikes! You can't create a new theme. One per skill for now.`\n\t\t\t\tbreak\n\n\t\t\tcase 'CACHE_NOT_ENABLED':\n\t\t\t\tmessage = \"Cache is not enabled, so it can't be disabled!\"\n\t\t\t\tbreak\n\n\t\t\tcase 'DOCKER_NOT_STARTED':\n\t\t\t\tmessage = 'Docker has not been started! Start it and try again!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_TEMPLATE_ITEM_BUILDING_FAILED':\n\t\t\t\tmessage = `Failed to build schema template item for '${namesUtil.toPascal(\n\t\t\t\t\toptions.schemaNamespace\n\t\t\t\t)}.${options.schemaId}'. The field I had an issue on was '${\n\t\t\t\t\toptions.fieldName\n\t\t\t\t}'. It's options are:\\n\\n${JSON.stringify(\n\t\t\t\t\toptions.fieldOptions\n\t\t\t\t)}.\\n\\nChances are you have a circular reference in your schemas. You'll need to extract shared fields to a new file and have your schemas mix those in, vs referencing eath other.`\n\t\t\t\tbreak\n\n\t\t\tcase 'ACTION_CANCELLED':\n\t\t\t\tmessage = 'A Action cancelled just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'TRANSPORT_ALREADY_EXISTS':\n\t\t\t\tmessage = `A transport named '${options.name}' already exists!`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPENDENCY_EXISTS':\n\t\t\t\tmessage = `You already have ${options.namespace} as a dependency!`\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tmessage = super.friendlyMessage()\n\t\t}\n\n\t\treturn message\n\t}\n\n\tprivate cleanStdErr(stderr: string) {\n\t\treturn stderr.replace('warning package.json: No license field', '').trim()\n\t}\n}\n"],"file":"SpruceError.js"}
|
|
@@ -127,7 +127,7 @@ var NodeFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
127
127
|
return this.Service('command').execute('yarn clean.build');
|
|
128
128
|
|
|
129
129
|
case 4:
|
|
130
|
-
this.ui.startLoading('
|
|
130
|
+
this.ui.startLoading('Building for development...');
|
|
131
131
|
_context3.next = 7;
|
|
132
132
|
return this.Service('command').execute('yarn build.dev');
|
|
133
133
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/node/NodeFeature.ts"],"names":["NodeFeature","options","nodeFeatureOptionsSchema","universalDevDependencies","universalScripts","universalFileDescriptions","diskUtil","resolvePath","__dirname","doesFileExist","cwd","emitter","on","payload","featureCode","actionCode","handleUpgrade","ui","startLoading","Service","execute","summaryLines","errors","destination","resolveDestination","doesDirExist","createDir","files","name","path","action","Writer","writeNodeModule","written","push","installScripts","pkg","set","value","namesUtil","toKebab","description","unset","Store","setCurrentSkillsNamespace","scriptUpdater","ScriptUpdater","FromFeature","update","AbstractFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AACA;;AAEA;;AACA;;AAMA;;AACA;;AACA;;;;;;;;;;IAgBqBA,W;;;;;AAoBpB,uBAAmBC,OAAnB,EAA2C;AAAA;;AAAA;AAC1C,8BAAMA,OAAN;AAD0C,6FAjBhB,MAiBgB;AAAA,qGAhBrB,gBAgBqB;AAAA,oGAftB,EAesB;AAAA,qGAdA,EAcA;AAAA,sGAbpBC,8BAaoB;AAAA,gJAZVC,oCAYU;AAAA,kHATvCC,4BASuC;AAAA,6IALvCC,qCAKuC;AAAA,mGAFvBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAEuB;AAAA,+
|
|
1
|
+
{"version":3,"sources":["../../../src/features/node/NodeFeature.ts"],"names":["NodeFeature","options","nodeFeatureOptionsSchema","universalDevDependencies","universalScripts","universalFileDescriptions","diskUtil","resolvePath","__dirname","doesFileExist","cwd","emitter","on","payload","featureCode","actionCode","handleUpgrade","ui","startLoading","Service","execute","summaryLines","errors","destination","resolveDestination","doesDirExist","createDir","files","name","path","action","Writer","writeNodeModule","written","push","installScripts","pkg","set","value","namesUtil","toKebab","description","unset","Store","setCurrentSkillsNamespace","scriptUpdater","ScriptUpdater","FromFeature","update","AbstractFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AACA;;AAEA;;AACA;;AAMA;;AACA;;AACA;;;;;;;;;;IAgBqBA,W;;;;;AAoBpB,uBAAmBC,OAAnB,EAA2C;AAAA;;AAAA;AAC1C,8BA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ues } from '@sprucelabs/schema'\nimport { SpruceSchemas } from '@sprucelabs/spruce-core-schemas'\nimport { diskUtil, namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport nodeFeatureOptionsSchema from '#spruce/schemas/spruceCli/v2020_07_22/nodeFeatureOptions.schema'\nimport { FileDescription, GeneratedFile } from '../../types/cli.types'\nimport ScriptUpdater from '../../updaters/ScriptUpdater'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport {\n\tActionOptions,\n\tFeatureActionResponse,\n\tFeatureCode,\n} from '../features.types'\nimport universalDevDependencies from '../universalDevDependencies'\nimport universalFileDescriptions from '../universalFileDescriptions'\nimport universalScripts from '../universalScripts'\n\ntype OptionsSchema =\n\tSpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptionsSchema\ntype Options = SpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptions\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tnode: NodeFeature\n\t}\n\n\tinterface FeatureOptionsMap {\n\t\tnode: SchemaValues<OptionsSchema>\n\t}\n}\n\nexport default class NodeFeature<\n\tS extends OptionsSchema = OptionsSchema\n> extends AbstractFeature<S> {\n\tpublic code: FeatureCode = 'node'\n\tpublic nameReadable = 'nodejs support'\n\tpublic description = ''\n\tpublic dependencies: FeatureDependency[] = []\n\tpublic optionsSchema = nodeFeatureOptionsSchema as S\n\tpublic packageDependencies = [...universalDevDependencies]\n\n\tpublic scripts = {\n\t\t...universalScripts,\n\t}\n\n\tpublic readonly fileDescriptions: FileDescription[] = [\n\t\t...universalFileDescriptions,\n\t]\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic constructor(options: ActionOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on('feature.did-execute', async (payload) => {\n\t\t\tif (payload.featureCode === 'node' && payload.actionCode === 'upgrade') {\n\t\t\t\treturn this.handleUpgrade()\n\t\t\t}\n\n\t\t\treturn {}\n\t\t})\n\t}\n\n\tprivate async handleUpgrade(): Promise<FeatureActionResponse> {\n\t\ttry {\n\t\t\tthis.ui.startLoading('Cleaning build...')\n\t\t\tawait this.Service('command').execute('yarn clean.build')\n\n\t\t\tthis.ui.startLoading('Building for development...')\n\t\t\tawait this.Service('command').execute('yarn build.dev')\n\n\t\t\treturn {\n\t\t\t\tsummaryLines: [\n\t\t\t\t\t'Build cleared.',\n\t\t\t\t\t'Lint rules applied to source.',\n\t\t\t\t\t'Code rebuilt successfully.',\n\t\t\t\t],\n\t\t\t}\n\t\t} catch (err) {\n\t\t\treturn {\n\t\t\t\terrors: [err],\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async beforePackageInstall(options: Options) {\n\t\tconst destination = this.resolveDestination(options)\n\n\t\tif (!diskUtil.doesDirExist(destination)) {\n\t\t\tdiskUtil.createDir(destination)\n\t\t}\n\n\t\tconst files: GeneratedFile[] = [\n\t\t\t{\n\t\t\t\tname: 'package.json',\n\t\t\t\tpath: diskUtil.resolvePath(destination, 'package.json'),\n\t\t\t\taction: 'generated',\n\t\t\t},\n\t\t]\n\n\t\tawait this.Service('command', destination).execute('yarn init -y')\n\n\t\tconst written = await this.Writer('node').writeNodeModule(destination)\n\n\t\tfiles.push(...written)\n\n\t\tawait this.installScripts(destination)\n\n\t\treturn { files, cwd: destination }\n\t}\n\n\tprivate resolveDestination(options: Options) {\n\t\treturn diskUtil.resolvePath(this.cwd, options.destination ?? '')\n\t}\n\n\tpublic async afterPackageInstall(\n\t\toptions: S extends Schema ? SchemaValues<S> : undefined\n\t) {\n\t\tconst cwd = this.resolveDestination(options)\n\t\tconst pkg = this.Service('pkg', cwd)\n\n\t\tpkg.set({ path: 'name', value: namesUtil.toKebab(options.name) })\n\t\tpkg.set({ path: 'description', value: options.description })\n\t\tpkg.set({ path: 'version', value: '0.0.1' })\n\n\t\tpkg.unset('main')\n\t\tpkg.unset('license')\n\n\t\tawait this.Store('skill', { cwd }).setCurrentSkillsNamespace(options.name)\n\n\t\treturn {}\n\t}\n\n\tprivate async installScripts(destination = this.cwd) {\n\t\tconst scriptUpdater = ScriptUpdater.FromFeature(this, {\n\t\t\tcwd: destination,\n\t\t})\n\n\t\tawait scriptUpdater.update()\n\t}\n\n\tpublic isInstalled = async (): Promise<boolean> => {\n\t\treturn diskUtil.doesFileExist(\n\t\t\tdiskUtil.resolvePath(this.cwd, 'package.json')\n\t\t)\n\t}\n}\n"],"file":"NodeFeature.js"}
|
|
@@ -100,7 +100,7 @@ var StoreFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
100
100
|
key: "handleWillExecute",
|
|
101
101
|
value: function () {
|
|
102
102
|
var _handleWillExecute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(payload) {
|
|
103
|
-
var isInstalled;
|
|
103
|
+
var isInstalled, results;
|
|
104
104
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
105
105
|
while (1) {
|
|
106
106
|
switch (_context2.prev = _context2.next) {
|
|
@@ -112,7 +112,7 @@ var StoreFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
112
112
|
isInstalled = _context2.sent;
|
|
113
113
|
|
|
114
114
|
if (!(isInstalled && payload.featureCode === 'node' && payload.actionCode === 'upgrade')) {
|
|
115
|
-
_context2.next =
|
|
115
|
+
_context2.next = 9;
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -121,12 +121,17 @@ var StoreFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
121
121
|
headline: 'Resyncing data stores...'
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
_context2.next = 7;
|
|
125
|
+
return this.Action('store', 'sync').execute({});
|
|
125
126
|
|
|
126
|
-
case
|
|
127
|
+
case 7:
|
|
128
|
+
results = _context2.sent;
|
|
129
|
+
return _context2.abrupt("return", results);
|
|
130
|
+
|
|
131
|
+
case 9:
|
|
127
132
|
return _context2.abrupt("return", {});
|
|
128
133
|
|
|
129
|
-
case
|
|
134
|
+
case 10:
|
|
130
135
|
case "end":
|
|
131
136
|
return _context2.stop();
|
|
132
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/store/StoreFeature.ts"],"names":["StoreFeature","options","code","isRequired","name","isDev","diskUtil","resolvePath","__dirname","emitter","on","registerAbstractTestClassHandler","bind","handleWillExecute","abstractClasses","label","featureCode","payload","featureInstaller","isInstalled","actionCode","uiUtil","renderMasthead","ui","headline","Action","execute","Writer","writePlugin","cwd","files","AbstractFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;IAYqBA,Y;;;;;AAiBpB,wBAAmBC,OAAnB,EAA4C;AAAA;;AAAA;AAC3C,8BAAMA,OAAN;AAD2C,qGAhBtB,aAgBsB;AAAA,oGAfvB,4CAeuB;AAAA,6FAdjB,OAciB;AAAA,qGAbD,CAC1C;AACCC,MAAAA,IAAI,EAAE,OADP;AAECC,MAAAA,UAAU,EAAE;AAFb,KAD0C,CAaC;AAAA,4GAPf,CAC5B;AAAEC,MAAAA,IAAI,EAAE,wCAAR;AAAkDC,MAAAA,KAAK,EAAE;AAAzD,KAD4B,EAE5B;AAAED,MAAAA,IAAI,EAAE,gCAAR;AAA0CC,MAAAA,KAAK,EAAE;AAAjD,KAF4B,CAOe;AAAA,mGAFxBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAEwB;AAG3C,SAAK,MAAKC,OAAL,CAAaC,EAAb,CACJ,qCADI,EAEJ,MAAKC,gCAAL,CAAsCC,IAAtC,gDAFI,CAAL;AAIA,SAAK,MAAKH,OAAL,CAAaC,EAAb,CACJ,sBADI,EAEJ,MAAKG,iBAAL,CAAuBD,IAAvB,gDAFI,CAAL;AAP2C;AAW3C;;;;;4HAED;AAAA;AAAA;AAAA;AAAA;AAAA,iDACQ;AACNE,kBAAAA,eAAe,EAAE,CAChB;AACCV,oBAAAA,IAAI,EAAE,mBADP;AAECW,oBAAAA,KAAK,EAAE,mBAFR;AAGC,8BAAQ,iCAHT;AAICC,oBAAAA,WAAW,EAAE;AAJd,mBADgB;AADX,iBADR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;6GAaA,kBAAgCC,OAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAI2B,KAAKC,gBAAL,CAAsBC,WAAtB,CAAkC,OAAlC,CAJ3B;;AAAA;AAIOA,gBAAAA,WAJP;;AAAA,sBAOEA,WAAW,IACXF,OAAO,CAACD,WAAR,KAAwB,MADxB,IAEAC,OAAO,CAACG,UAAR,KAAuB,SATzB;AAAA;AAAA;AAAA;;AAWEC,+BAAOC,cAAP,CAAsB;AACrBC,kBAAAA,EAAE,EAAE,KAAKA,EADY;AAErBC,kBAAAA,QAAQ,EAAE;AAFW,iBAAtB;;AAXF,
|
|
1
|
+
{"version":3,"sources":["../../../src/features/store/StoreFeature.ts"],"names":["StoreFeature","options","code","isRequired","name","isDev","diskUtil","resolvePath","__dirname","emitter","on","registerAbstractTestClassHandler","bind","handleWillExecute","abstractClasses","label","featureCode","payload","featureInstaller","isInstalled","actionCode","uiUtil","renderMasthead","ui","headline","Action","execute","results","Writer","writePlugin","cwd","files","AbstractFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;IAYqBA,Y;;;;;AAiBpB,wBAAmBC,OAAnB,EAA4C;AAAA;;AAAA;AAC3C,8BAAMA,OAAN;AAD2C,qGAhBtB,aAgBsB;AAAA,oGAfvB,4CAeuB;AAAA,6FAdjB,OAciB;AAAA,qGAbD,CAC1C;AACCC,MAAAA,IAAI,EAAE,OADP;AAECC,MAAAA,UAAU,EAAE;AAFb,KAD0C,CAaC;AAAA,4GAPf,CAC5B;AAAEC,MAAAA,IAAI,EAAE,wCAAR;AAAkDC,MAAAA,KAAK,EAAE;AAAzD,KAD4B,EAE5B;AAAED,MAAAA,IAA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A,O;;;;;;;;;;;+GAwBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBACqB,KAAKC,MAAL,CAAY,OAAZ,EAAqBC,WAArB,CAAiC,KAAKC,GAAtC,CADrB;;AAAA;AACOC,gBAAAA,KADP;AAAA,kDAEQ;AACNA,kBAAAA,KAAK,EAALA;AADM,iBAFR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAnEyCC,4B","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport uiUtil from '../../utilities/ui.utility'\nimport AbstractFeature, {\n\tFeatureDependency,\n\tFeatureOptions,\n} from '../AbstractFeature'\nimport { FeatureCode } from '../features.types'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tstore: StoreFeature\n\t}\n}\n\nexport default class StoreFeature extends AbstractFeature {\n\tpublic nameReadable = 'Data Stores'\n\tpublic description = 'For working with remote places of storage.'\n\tpublic code: FeatureCode = 'store'\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{\n\t\t\tcode: 'skill',\n\t\t\tisRequired: true,\n\t\t},\n\t]\n\tpublic packageDependencies = [\n\t\t{ name: '@sprucelabs/spruce-store-plugin@latest', isDev: false },\n\t\t{ name: '@sprucelabs/data-stores@latest', isDev: false },\n\t]\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic constructor(options: FeatureOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on(\n\t\t\t'test.register-abstract-test-classes',\n\t\t\tthis.registerAbstractTestClassHandler.bind(this)\n\t\t)\n\t\tvoid this.emitter.on(\n\t\t\t'feature.will-execute',\n\t\t\tthis.handleWillExecute.bind(this)\n\t\t)\n\t}\n\n\tprivate async registerAbstractTestClassHandler() {\n\t\treturn {\n\t\t\tabstractClasses: [\n\t\t\t\t{\n\t\t\t\t\tname: 'AbstractStoreTest',\n\t\t\t\t\tlabel: 'AbstractStoreTest',\n\t\t\t\t\timport: '@sprucelabs/spruce-store-plugin',\n\t\t\t\t\tfeatureCode: 'store',\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n\n\tprivate async handleWillExecute(payload: {\n\t\tfeatureCode: string\n\t\tactionCode: string\n\t}) {\n\t\tconst isInstalled = await this.featureInstaller.isInstalled('store')\n\n\t\tif (\n\t\t\tisInstalled &&\n\t\t\tpayload.featureCode === 'node' &&\n\t\t\tpayload.actionCode === 'upgrade'\n\t\t) {\n\t\t\tuiUtil.renderMasthead({\n\t\t\t\tui: this.ui,\n\t\t\t\theadline: 'Resyncing data stores...',\n\t\t\t})\n\n\t\t\tconst results = await this.Action('store', 'sync').execute({})\n\n\t\t\treturn results\n\t\t}\n\n\t\treturn {}\n\t}\n\n\tpublic async afterPackageInstall() {\n\t\tconst files = await this.Writer('store').writePlugin(this.cwd)\n\t\treturn {\n\t\t\tfiles,\n\t\t}\n\t}\n}\n"],"file":"StoreFeature.js"}
|
|
@@ -11,6 +11,7 @@ var _schema = require("@sprucelabs/schema");
|
|
|
11
11
|
|
|
12
12
|
var _person = _interopRequireDefault(require("../../.spruce/schemas/spruce/v2020_07_22/person.schema"));
|
|
13
13
|
|
|
14
|
+
// eslint-disable-next-line spruce/prohibit-import-of-schema-in-builders
|
|
14
15
|
var _default = (0, _schema.buildSchema)({
|
|
15
16
|
id: 'personWithToken',
|
|
16
17
|
description: 'A stripped down cli user with token details for login',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/v2020_07_22/personWithToken.builder.ts"],"names":["id","description","fields","personSchema","casualName","token","type","isRequired","isLoggedIn","label"],"mappings":";;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/v2020_07_22/personWithToken.builder.ts"],"names":["id","description","fields","personSchema","casualName","token","type","isRequired","isLoggedIn","label"],"mappings":";;;;;;;;;AAAA;;AAEA;;AADA;eAGe,yBAAY;AAC1BA,EAAAA,EAAE,EAAE,iBADsB;AAE1BC,EAAAA,WAAW,EAAE,uDAFa;AAG1BC,EAAAA,MAAM,EAAE;AACPF,IAAAA,EAAE,EAAEG,mBAAaD,MAAb,CAAoBF,EADjB;AAEPI,IAAAA,UAAU,EAAED,mBAAaD,MAAb,CAAoBE,UAFzB;AAGPC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,IAAI,EAAE,MAAR;AAAgBC,MAAAA,UAAU,EAAE;AAA5B,KAHA;AAIPC,IAAAA,UAAU,EAAE;AACXF,MAAAA,IAAI,EAAE,SADK;AAEXG,MAAAA,KAAK,EAAE;AAFI;AAJL;AAHkB,CAAZ,C","sourcesContent":["import { buildSchema } from '@sprucelabs/schema'\n// eslint-disable-next-line spruce/prohibit-import-of-schema-in-builders\nimport personSchema from '#spruce/schemas/spruce/v2020_07_22/person.schema'\n\nexport default buildSchema({\n\tid: 'personWithToken',\n\tdescription: 'A stripped down cli user with token details for login',\n\tfields: {\n\t\tid: personSchema.fields.id,\n\t\tcasualName: personSchema.fields.casualName,\n\t\ttoken: { type: 'text', isRequired: true },\n\t\tisLoggedIn: {\n\t\t\ttype: 'boolean',\n\t\t\tlabel: 'Logged in',\n\t\t},\n\t},\n})\n"],"file":"personWithToken.builder.js"}
|
|
@@ -54,35 +54,39 @@ var GameService = /*#__PURE__*/function () {
|
|
|
54
54
|
case 0:
|
|
55
55
|
introductionSentences = _args.length > 0 && _args[0] !== undefined ? _args[0] : [];
|
|
56
56
|
sentencesToPlay = (0, _toConsumableArray2["default"])(introductionSentences);
|
|
57
|
+
_context.next = 4;
|
|
58
|
+
return this.ui.stopLoading();
|
|
59
|
+
|
|
60
|
+
case 4:
|
|
57
61
|
this.killed = false;
|
|
58
62
|
|
|
59
|
-
case
|
|
63
|
+
case 5:
|
|
60
64
|
if (!(sentencesToPlay.length > 0)) {
|
|
61
|
-
_context.next =
|
|
65
|
+
_context.next = 14;
|
|
62
66
|
break;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
next = sentencesToPlay.shift();
|
|
66
70
|
this.ui.renderLine(next);
|
|
67
|
-
_context.next =
|
|
71
|
+
_context.next = 10;
|
|
68
72
|
return new Promise(function (r) {
|
|
69
73
|
return setTimeout(r, 2000);
|
|
70
74
|
});
|
|
71
75
|
|
|
72
|
-
case
|
|
76
|
+
case 10:
|
|
73
77
|
if (!this.killed) {
|
|
74
|
-
_context.next =
|
|
78
|
+
_context.next = 12;
|
|
75
79
|
break;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
return _context.abrupt("return");
|
|
79
83
|
|
|
80
|
-
case
|
|
81
|
-
_context.next =
|
|
84
|
+
case 12:
|
|
85
|
+
_context.next = 5;
|
|
82
86
|
break;
|
|
83
87
|
|
|
84
|
-
case
|
|
85
|
-
_context.next =
|
|
88
|
+
case 14:
|
|
89
|
+
_context.next = 16;
|
|
86
90
|
return this.command.execute('node ./node_modules/.bin/js-tetris-cli', {
|
|
87
91
|
spawnOptions: {
|
|
88
92
|
stdio: [process.stdin, 'pipe', 'pipe']
|
|
@@ -110,7 +114,7 @@ var GameService = /*#__PURE__*/function () {
|
|
|
110
114
|
}
|
|
111
115
|
});
|
|
112
116
|
|
|
113
|
-
case
|
|
117
|
+
case 16:
|
|
114
118
|
case "end":
|
|
115
119
|
return _context.stop();
|
|
116
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/GameService.ts"],"names":["GameService","command","ui","cwd","diskUtil","resolvePath","__dirname","message","statusMessage","introductionSentences","sentencesToPlay","killed","length","next","shift","renderLine","Promise","r","setTimeout","execute","spawnOptions","stdio","process","stdin","onData","data","stdout","write","saveCursor","moveCursorTo","clearBelowCursor","restoreCursor","kill","clear"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;IAIqBA,W;AAMpB,uBAAmBC,OAAnB,EAA4CC,EAA5C,EAAmE;AAAA;AAAA;AAAA;AAAA;AAAA,qDAFlD,KAEkD;AAClE,SAAKD,OAAL,GAAeA,OAAf;AACA,SAAKC,EAAL,GAAUA,EAAV;AACA,SAAKD,OAAL,CAAaE,GAAb,GAAmBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,QAAhC,CAAnB;AACA;;;;WAED,0BAAwBC,OAAxB,EAAyC;AACxC,WAAKC,aAAL,GAAqBD,OAArB;AACA;;;;gGAED;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkBE,gBAAAA,qBAAlB,2DAAoD,EAApD;AACOC,gBAAAA,eADP,uCAC6BD,qBAD7B;
|
|
1
|
+
{"version":3,"sources":["../../src/services/GameService.ts"],"names":["GameService","command","ui","cwd","diskUtil","resolvePath","__dirname","message","statusMessage","introductionSentences","sentencesToPlay","stopLoading","killed","length","next","shift","renderLine","Promise","r","setTimeout","execute","spawnOptions","stdio","process","stdin","onData","data","stdout","write","saveCursor","moveCursorTo","clearBelowCursor","restoreCursor","kill","clear"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;IAIqBA,W;AAMpB,uBAAmBC,OAAnB,EAA4CC,EAA5C,EAAmE;AAAA;AAAA;AAAA;AAAA;AAAA,qDAFlD,KAEkD;AAClE,SAAKD,OAAL,GAAeA,OAAf;AACA,SAAKC,EAAL,GAAUA,EAAV;AACA,SAAKD,OAAL,CAAaE,GAAb,GAAmBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,QAAhC,CAAnB;AACA;;;;WAED,0BAAwBC,OAAxB,EAAyC;AACxC,WAAKC,aAAL,GAAqBD,OAArB;AACA;;;;gGAED;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkBE,gBAAAA,qBAAlB,2DAAoD,EAApD;AACOC,gBAAAA,eADP,uCAC6BD,qBAD7B;AAAA;AAAA,uBAEO,KAAKP,EAAL,CAAQS,WAAR,EAFP;;AAAA;AAGC,qBAAKC,MAAL,GAAc,KAAd;;AAHD;AAAA,sBAKQF,eAAe,CAACG,MAAhB,GAAyB,CALjC;AAAA;AAAA;AAA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diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport TerminalInterface from '../interfaces/TerminalInterface'\nimport CommandService from './CommandService'\n\nexport default class GameService {\n\tprivate command: CommandService\n\tprivate ui: TerminalInterface\n\tprivate statusMessage?: string\n\tprivate killed = false\n\n\tpublic constructor(command: CommandService, ui: TerminalInterface) {\n\t\tthis.command = command\n\t\tthis.ui = ui\n\t\tthis.command.cwd = diskUtil.resolvePath(__dirname, '../../')\n\t}\n\n\tpublic setStatusMessage(message: string) {\n\t\tthis.statusMessage = message\n\t}\n\n\tpublic async play(introductionSentences: string[] = []) {\n\t\tconst sentencesToPlay = [...introductionSentences]\n\t\tawait this.ui.stopLoading()\n\t\tthis.killed = false\n\n\t\twhile (sentencesToPlay.length > 0) {\n\t\t\tconst next = sentencesToPlay.shift() as string\n\t\t\tthis.ui.renderLine(next)\n\t\t\tawait new Promise((r) => setTimeout(r, 2000))\n\t\t\tif (this.killed) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tawait this.command.execute('node ./node_modules/.bin/js-tetris-cli', {\n\t\t\tspawnOptions: {\n\t\t\t\tstdio: [process.stdin, 'pipe', 'pipe'],\n\t\t\t},\n\t\t\tonData: (data: string) => {\n\t\t\t\tif (!this.killed) {\n\t\t\t\t\tprocess.stdout?.write(data)\n\t\t\t\t\tif (this.statusMessage) {\n\t\t\t\t\t\tthis.ui.saveCursor()\n\t\t\t\t\t\tthis.ui.moveCursorTo(0, 25)\n\t\t\t\t\t\tthis.ui.clearBelowCursor()\n\t\t\t\t\t\tprocess.stdout?.write(this.statusMessage)\n\t\t\t\t\t\tthis.ui.restoreCursor()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t}\n\n\tpublic kill() {\n\t\tthis.killed = true\n\t\tthis.command.kill()\n\t\tthis.ui.clear()\n\t}\n}\n"],"file":"GameService.js"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import CommandService from './CommandService';
|
|
2
2
|
export default class LintService {
|
|
3
3
|
cwd: string;
|
|
4
|
-
private
|
|
4
|
+
private getCommand;
|
|
5
5
|
private static isLintingEnabled;
|
|
6
6
|
static disableLinting(): void;
|
|
7
7
|
static enableLinting(): void;
|
|
8
|
-
constructor(cwd: string,
|
|
8
|
+
constructor(cwd: string, commandServiceFactory: () => CommandService);
|
|
9
9
|
fix: (pattern: string) => Promise<string[]>;
|
|
10
10
|
}
|
|
@@ -25,15 +25,15 @@ var _SpruceError = _interopRequireDefault(require("../errors/SpruceError"));
|
|
|
25
25
|
|
|
26
26
|
// import { ESLint } from 'eslint'
|
|
27
27
|
var LintService = /*#__PURE__*/function () {
|
|
28
|
-
function LintService(cwd,
|
|
28
|
+
function LintService(cwd, commandServiceFactory) {
|
|
29
29
|
var _this = this;
|
|
30
30
|
|
|
31
31
|
(0, _classCallCheck2["default"])(this, LintService);
|
|
32
32
|
(0, _defineProperty2["default"])(this, "cwd", void 0);
|
|
33
|
-
(0, _defineProperty2["default"])(this, "
|
|
33
|
+
(0, _defineProperty2["default"])(this, "getCommand", void 0);
|
|
34
34
|
(0, _defineProperty2["default"])(this, "fix", /*#__PURE__*/function () {
|
|
35
35
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(pattern) {
|
|
36
|
-
var fixedFiles, fixedPaths, script, _yield$_this$
|
|
36
|
+
var fixedFiles, fixedPaths, script, _yield$_this$getComma, stdout, i, fixedFile;
|
|
37
37
|
|
|
38
38
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
39
39
|
while (1) {
|
|
@@ -65,13 +65,13 @@ var LintService = /*#__PURE__*/function () {
|
|
|
65
65
|
// fixedFiles = await cli.lintFiles([pattern])
|
|
66
66
|
script = "\"(async function lint() { try { const { ESLint } = require('eslint'); const cli = new ESLint({ fix: true, cwd: '".concat(_this.cwd, "', }); const result = await cli.lintFiles(['").concat(pattern, "']); console.log(JSON.stringify(result)); } catch (err) { console.log(err.toString()); }})()\"");
|
|
67
67
|
_context.next = 10;
|
|
68
|
-
return _this.
|
|
68
|
+
return _this.getCommand().execute('node', {
|
|
69
69
|
args: ['-e', script]
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
case 10:
|
|
73
|
-
_yield$_this$
|
|
74
|
-
stdout = _yield$_this$
|
|
73
|
+
_yield$_this$getComma = _context.sent;
|
|
74
|
+
stdout = _yield$_this$getComma.stdout;
|
|
75
75
|
fixedFiles = JSON.parse(stdout);
|
|
76
76
|
_context.next = 18;
|
|
77
77
|
break;
|
|
@@ -87,7 +87,7 @@ var LintService = /*#__PURE__*/function () {
|
|
|
87
87
|
|
|
88
88
|
case 18:
|
|
89
89
|
if (!fixedFiles) {
|
|
90
|
-
_context.next =
|
|
90
|
+
_context.next = 33;
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -95,14 +95,14 @@ var LintService = /*#__PURE__*/function () {
|
|
|
95
95
|
|
|
96
96
|
case 20:
|
|
97
97
|
if (!(i < fixedFiles.length)) {
|
|
98
|
-
_context.next =
|
|
98
|
+
_context.next = 33;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
fixedFile = fixedFiles[i];
|
|
103
103
|
|
|
104
|
-
if (!(fixedFile && fixedFile.output)) {
|
|
105
|
-
_context.next =
|
|
104
|
+
if (!(fixedFile !== null && fixedFile !== void 0 && fixedFile.output)) {
|
|
105
|
+
_context.next = 28;
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -111,16 +111,32 @@ var LintService = /*#__PURE__*/function () {
|
|
|
111
111
|
|
|
112
112
|
case 25:
|
|
113
113
|
fixedPaths.push(fixedFile.filePath);
|
|
114
|
+
_context.next = 30;
|
|
115
|
+
break;
|
|
116
|
+
|
|
117
|
+
case 28:
|
|
118
|
+
if (!(fixedFile !== null && fixedFile !== void 0 && fixedFile.messages && (fixedFile === null || fixedFile === void 0 ? void 0 : fixedFile.errorCount) > 0)) {
|
|
119
|
+
_context.next = 30;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
114
122
|
|
|
115
|
-
|
|
123
|
+
throw new _SpruceError["default"]({
|
|
124
|
+
code: 'LINT_FAILED',
|
|
125
|
+
pattern: pattern,
|
|
126
|
+
friendlyMessage: "Lint error with '".concat(fixedFile.filePath, "':\n\n").concat(fixedFile.messages.map(function (m) {
|
|
127
|
+
return m === null || m === void 0 ? void 0 : m.message;
|
|
128
|
+
}).join('\n'))
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
case 30:
|
|
116
132
|
i += 1;
|
|
117
133
|
_context.next = 20;
|
|
118
134
|
break;
|
|
119
135
|
|
|
120
|
-
case
|
|
136
|
+
case 33:
|
|
121
137
|
return _context.abrupt("return", fixedPaths);
|
|
122
138
|
|
|
123
|
-
case
|
|
139
|
+
case 34:
|
|
124
140
|
case "end":
|
|
125
141
|
return _context.stop();
|
|
126
142
|
}
|
|
@@ -133,7 +149,7 @@ var LintService = /*#__PURE__*/function () {
|
|
|
133
149
|
};
|
|
134
150
|
}());
|
|
135
151
|
this.cwd = cwd;
|
|
136
|
-
this.
|
|
152
|
+
this.getCommand = commandServiceFactory;
|
|
137
153
|
}
|
|
138
154
|
|
|
139
155
|
(0, _createClass2["default"])(LintService, null, [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/LintService.ts"],"names":["LintService","cwd","
|
|
1
|
+
{"version":3,"sources":["../../src/services/LintService.ts"],"names":["LintService","cwd","commandServiceFactory","pattern","SchemaError","code","parameters","isLintingEnabled","fixedFiles","fixedPaths","script","getCommand","execute","args","stdout","JSON","parse","SpruceError","originalError","i","length","fixedFile","output","fs","writeFile","filePath","push","messages","errorCount","friendlyMessage","map","m","message","join"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAFA;IAKqBA,W;AAcpB,uBAAmBC,GAAnB,EAAgCC,qBAAhC,EAA6E;AAAA;;AAAA;AAAA;AAAA;AAAA;AA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AAAA;AAAA,uBAsCHC,oBAAGC,SAAH,CAAaH,SAAS,CAACI,QAAvB,EAAiCJ,SAAS,CAACC,MAA3C,CAtCG;;AAAA;AAuCTb,gBAAAA,UAAU,CAACiB,IAAX,CAAgBL,SAAS,CAACI,QAA1B;AAvCS;AAAA;;AAAA;AAAA,sBAwCCJ,SAAS,SAAT,IAAAA,SAAS,WAAT,IAAAA,SAAS,CAAEM,QAAX,IAAuB,CAAAN,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEO,UAAX,IAAwB,CAxChD;AAAA;AAAA;AAAA;;AAAA,sBAyCH,IAAIX,uBAAJ,CAAgB;AACrBZ,kBAAAA,IAAI,EAAE,aADe;AAErBF,kBAAAA,OAAO,EAAPA,OAFqB;AAGrB0B,kBAAAA,eAAe,6BACdR,SAAS,CAACI,QADI,mBAENJ,SAAS,CAACM,QAAV,CACPG,GADO,CACH,UAACC,CAAD;AAAA,2BAAYA,CAAZ,aAAYA,CAAZ,uBAAYA,CAAC,CAAEC,OAAf;AAAA,mBADG,EAEPC,IAFO,CAEF,IAFE,CAFM;AAHM,iBAAhB,CAzCG;;AAAA;AAkC4Bd,gBAAAA,CAAC,IAAI,CAlCjC;AAAA;AAAA;;AAAA;AAAA,iDAsDLV,UAtDK;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OALgE;;AAAA;AAAA;AAAA;AAAA;AAC5E,SAAKR,GAAL,GAAWA,GAAX;AACA,SAAKU,UAAL,GAAkBT,qBAAlB;AACA;;;;WAXD,0BAA+B;AAC9B,WAAKK,gBAAL,GAAwB,KAAxB;AACA;;;WAED,yBAA8B;AAC7B,WAAKA,gBAAL,GAAwB,IAAxB;AACA;;;;;;iCAZmBP,W,sBAIc,I","sourcesContent":["import { SchemaError } from '@sprucelabs/schema'\n// import { ESLint } from 'eslint'\nimport fs from 'fs-extra'\nimport SpruceError from '../errors/SpruceError'\nimport CommandService from './CommandService'\n\nexport default class LintService {\n\tpublic cwd: string\n\tprivate getCommand: () => CommandService\n\n\tprivate static isLintingEnabled = true\n\n\tpublic static disableLinting() {\n\t\tthis.isLintingEnabled = false\n\t}\n\n\tpublic static enableLinting() {\n\t\tthis.isLintingEnabled = true\n\t}\n\n\tpublic constructor(cwd: string, commandServiceFactory: () => CommandService) {\n\t\tthis.cwd = cwd\n\t\tthis.getCommand = commandServiceFactory\n\t}\n\n\tpublic fix = async (pattern: string): Promise<string[]> => {\n\t\tif (!pattern) {\n\t\t\tthrow new SchemaError({\n\t\t\t\tcode: 'MISSING_PARAMETERS',\n\t\t\t\tparameters: ['pattern'],\n\t\t\t})\n\t\t}\n\n\t\tif (!LintService.isLintingEnabled) {\n\t\t\treturn []\n\t\t}\n\n\t\tlet fixedFiles: any = {}\n\t\tconst fixedPaths: string[] = []\n\n\t\ttry {\n\t\t\t// const cli = new ESLint({ fix: true, cwd: this.cwd, cache: true })\n\t\t\t// fixedFiles = await cli.lintFiles([pattern])\n\t\t\tconst script = `\"(async function lint() { try { const { ESLint } = require('eslint'); const cli = new ESLint({ fix: true, cwd: '${this.cwd}', }); const result = await cli.lintFiles(['${pattern}']); console.log(JSON.stringify(result)); } catch (err) { console.log(err.toString()); }})()\"`\n\n\t\t\tconst { stdout } = await this.getCommand().execute('node', {\n\t\t\t\targs: ['-e', script],\n\t\t\t})\n\n\t\t\tfixedFiles = JSON.parse(stdout)\n\t\t} catch (err: any) {\n\t\t\tthrow new SpruceError({\n\t\t\t\tcode: 'LINT_FAILED',\n\t\t\t\tpattern,\n\t\t\t\toriginalError: err,\n\t\t\t})\n\t\t}\n\n\t\tif (fixedFiles) {\n\t\t\tfor (let i = 0; i < fixedFiles.length; i += 1) {\n\t\t\t\tconst fixedFile = fixedFiles[i]\n\n\t\t\t\tif (fixedFile?.output) {\n\t\t\t\t\tawait fs.writeFile(fixedFile.filePath, fixedFile.output)\n\t\t\t\t\tfixedPaths.push(fixedFile.filePath)\n\t\t\t\t} else if (fixedFile?.messages && fixedFile?.errorCount > 0) {\n\t\t\t\t\tthrow new SpruceError({\n\t\t\t\t\t\tcode: 'LINT_FAILED',\n\t\t\t\t\t\tpattern,\n\t\t\t\t\t\tfriendlyMessage: `Lint error with '${\n\t\t\t\t\t\t\tfixedFile.filePath\n\t\t\t\t\t\t}':\\n\\n${fixedFile.messages\n\t\t\t\t\t\t\t.map((m: any) => m?.message)\n\t\t\t\t\t\t\t.join('\\n')}`,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn fixedPaths\n\t}\n}\n"],"file":"LintService.js"}
|
|
@@ -55,6 +55,8 @@ var ServiceFactory = /*#__PURE__*/function () {
|
|
|
55
55
|
|
|
56
56
|
return Service;
|
|
57
57
|
}(function (cwd, type) {
|
|
58
|
+
var _this = this;
|
|
59
|
+
|
|
58
60
|
switch (type) {
|
|
59
61
|
case 'auth':
|
|
60
62
|
return new _AuthService["default"](new _spruceSkillUtils.EnvService(cwd), new _PkgService["default"](cwd));
|
|
@@ -75,7 +77,9 @@ var ServiceFactory = /*#__PURE__*/function () {
|
|
|
75
77
|
});
|
|
76
78
|
|
|
77
79
|
case 'lint':
|
|
78
|
-
return new _LintService["default"](cwd,
|
|
80
|
+
return new _LintService["default"](cwd, function () {
|
|
81
|
+
return _this.Service(cwd, 'command');
|
|
82
|
+
});
|
|
79
83
|
|
|
80
84
|
case 'command':
|
|
81
85
|
{
|
|
@@ -100,7 +104,9 @@ var ServiceFactory = /*#__PURE__*/function () {
|
|
|
100
104
|
case 'build':
|
|
101
105
|
{
|
|
102
106
|
var commandService = new _CommandService["default"](cwd);
|
|
103
|
-
return new _BuildService["default"](commandService, new _LintService["default"](cwd,
|
|
107
|
+
return new _BuildService["default"](commandService, new _LintService["default"](cwd, function () {
|
|
108
|
+
return _this.Service(cwd, 'command');
|
|
109
|
+
}));
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
case 'eventSettings':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/ServiceFactory.ts"],"names":["ServiceFactory","cwd","type","AuthService","EnvService","PkgService","VsCodeService","SchemaService","command","CommandService","LintService","Service","RemoteService","TypeCheckerService","buildImportService","SettingsService","DependencyService","commandService","BuildService","EventSettingsService","Error","ImportService"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;IAwBqBA,c;;;;;;;;;;;;;;;;;MACpB,UAAkCC,GAAlC,EAA+CC,IAA/C,EAAuE;AACtE,cAAQA,IAAR;AACC,aAAK,MAAL;AACC,iBAAO,IAAIC,uBAAJ,CACN,IAAIC,4BAAJ,CAAeH,GAAf,CADM,EAEN,IAAII,sBAAJ,CAAeJ,GAAf,CAFM,CAAP;;AAID,aAAK,KAAL;AACC,iBAAO,IAAII,sBAAJ,CAAeJ,GAAf,CAAP;;AACD,aAAK,KAAL;AACC,iBAAO,IAAIG,4BAAJ,CAAeH,GAAf,CAAP;;AACD,aAAK,QAAL;AACC,iBAAO,IAAIK,yBAAJ,CAAkBL,GAAlB,CAAP;;AACD,aAAK,QAAL;AACC,iBAAO,IAAIM,yBAAJ,CAAkB;AACxBN,YAAAA,GAAG,EAAHA,GADwB;AAExBO,YAAAA,OAAO,EAAE,IAAIC,0BAAJ,CAAmBR,GAAnB;AAFe,WAAlB,CAAP;;AAID,aAAK,MAAL;AACC,iBAAO,IAAIS,uBAAJ,
|
|
1
|
+
{"version":3,"sources":["../../src/services/ServiceFactory.ts"],"names":["ServiceFactory","cwd","type","AuthService","EnvService","PkgService","VsCodeService","SchemaService","command","CommandService","LintService","Service","RemoteService","TypeCheckerService","buildImportService","SettingsService","DependencyService","commandService","BuildService","EventSettingsService","Error","ImportService"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;IAwBqBA,c;;;;;;;;;;;;;;;;;MACpB,UAAkC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AMgB,cAAc,GAAG,IAAIR,0BAAJ,CAAmBR,GAAnB,CAAvB;AACA,mBAAO,IAAIiB,wBAAJ,CACND,cADM,EAEN,IAAIP,uBAAJ,CAAgBT,GAAhB,EAAqB;AAAA,qBAAM,KAAI,CAACU,OAAL,CAAaV,GAAb,EAAkB,SAAlB,CAAN;AAAA,aAArB,CAFM,CAAP;AAIA;;AACD,aAAK,eAAL;AACC,iBAAO,IAAIkB,gCAAJ,CACN,IAAIJ,iCAAJ,CAAoBd,GAApB,CADM,CAAP;;AAGD;AACC,gBAAM,IAAImB,KAAJ,qBAAsBlB,IAAtB,kBAAN;AAlDF;AAoDA,K;;;WAED,4BAA2BD,GAA3B,EAAuD;AACtD,aAAO,IAAIoB,yBAAJ,CAAkB;AACxBpB,QAAAA,GAAG,EAAHA,GADwB;AAExBO,QAAAA,OAAO,EAAE,IAAIC,0BAAJ,CAAmBR,GAAnB;AAFe,OAAlB,CAAP;AAIA","sourcesContent":["import { SettingsService, EnvService } from '@sprucelabs/spruce-skill-utils'\nimport EventSettingsService from '../features/event/services/EventSettingsService'\nimport RemoteService from '../features/event/services/RemoteService'\nimport { FeatureCode } from '../features/features.types'\nimport SchemaService from '../features/schema/services/SchemaService'\nimport VsCodeService from '../features/vscode/services/VsCodeService'\nimport AuthService from './AuthService'\nimport BuildService from './BuildService'\nimport CommandService from './CommandService'\nimport DependencyService from './DependencyService'\nimport ImportService from './ImportService'\nimport LintService from './LintService'\nimport PkgService from './PkgService'\nimport TypeCheckerService from './TypeCheckerService'\n\nexport interface ServiceMap {\n\tpkg: PkgService\n\tvsCode: VsCodeService\n\tschema: SchemaService\n\tlint: LintService\n\tcommand: CommandService\n\ttypeChecker: TypeCheckerService\n\timport: ImportService\n\tbuild: BuildService\n\tsettings: SettingsService\n\tenv: EnvService\n\tauth: AuthService\n\tremote: RemoteService\n\teventSettings: EventSettingsService\n\tdependency: DependencyService\n}\n\nexport type Service = keyof ServiceMap\n\nexport interface ServiceProvider {\n\tService<S extends Service>(type: S, cwd?: string): ServiceMap[S]\n}\nexport default class ServiceFactory {\n\tpublic Service<S extends Service>(cwd: string, type: S): ServiceMap[S] {\n\t\tswitch (type) {\n\t\t\tcase 'auth':\n\t\t\t\treturn new AuthService(\n\t\t\t\t\tnew EnvService(cwd),\n\t\t\t\t\tnew PkgService(cwd)\n\t\t\t\t) as ServiceMap[S]\n\t\t\tcase 'pkg':\n\t\t\t\treturn new PkgService(cwd) as ServiceMap[S]\n\t\t\tcase 'env':\n\t\t\t\treturn new EnvService(cwd) as ServiceMap[S]\n\t\t\tcase 'vsCode':\n\t\t\t\treturn new VsCodeService(cwd) as ServiceMap[S]\n\t\t\tcase 'schema':\n\t\t\t\treturn new SchemaService({\n\t\t\t\t\tcwd,\n\t\t\t\t\tcommand: new CommandService(cwd),\n\t\t\t\t}) as ServiceMap[S]\n\t\t\tcase 'lint':\n\t\t\t\treturn new LintService(cwd, () =>\n\t\t\t\t\tthis.Service(cwd, 'command')\n\t\t\t\t) as ServiceMap[S]\n\t\t\tcase 'command': {\n\t\t\t\treturn new CommandService(cwd) as ServiceMap[S]\n\t\t\t}\n\t\t\tcase 'remote':\n\t\t\t\treturn new RemoteService(new EnvService(cwd)) as ServiceMap[S]\n\t\t\tcase 'typeChecker':\n\t\t\t\treturn new TypeCheckerService(\n\t\t\t\t\tthis.buildImportService(cwd)\n\t\t\t\t) as ServiceMap[S]\n\t\t\tcase 'settings':\n\t\t\t\treturn new SettingsService<FeatureCode>(cwd) as ServiceMap[S]\n\t\t\tcase 'dependency':\n\t\t\t\treturn new DependencyService(\n\t\t\t\t\tnew SettingsService<FeatureCode>(cwd)\n\t\t\t\t) as ServiceMap[S]\n\t\t\tcase 'import':\n\t\t\t\treturn this.buildImportService(cwd) as ServiceMap[S]\n\t\t\tcase 'build': {\n\t\t\t\tconst commandService = new CommandService(cwd)\n\t\t\t\treturn new BuildService(\n\t\t\t\t\tcommandService,\n\t\t\t\t\tnew LintService(cwd, () => this.Service(cwd, 'command'))\n\t\t\t\t) as ServiceMap[S]\n\t\t\t}\n\t\t\tcase 'eventSettings':\n\t\t\t\treturn new EventSettingsService(\n\t\t\t\t\tnew SettingsService(cwd)\n\t\t\t\t) as ServiceMap[S]\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Service \"${type}\" not found`)\n\t\t}\n\t}\n\n\tprivate buildImportService(cwd: string): ImportService {\n\t\treturn new ImportService({\n\t\t\tcwd,\n\t\t\tcommand: new CommandService(cwd),\n\t\t})\n\t}\n}\n"],"file":"ServiceFactory.js"}
|