Documentation
¶
Overview ¶
Copyright © 2022 Websublime.dev organization@websublime.dev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Websublime.dev organization@websublime.dev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Websublime.dev organization@websublime.dev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Websublime.dev organization@websublime.dev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Websublime.dev organization@websublime.dev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- Variables
- func Contains(args []string, lookup string) bool
- func ErrorOut(message string, code ErrorType)
- func GetBeforeAndLastDiff(path string) (string, error)
- func GetBeforeDiff(path string) (string, error)
- func GetBeforeLastCommit(path string) (string, error)
- func GetBranchList(path string) (string, error)
- func GetCommitsCount(path string) (string, error)
- func GetDiffBetweenTags(path string) (string, error)
- func GetLastCommit(path string) (string, error)
- func GetMimeType(extension string) string
- func GetShortCommit(path string, hash string) (string, error)
- func InfoOut(message string)
- func InitGit(path string) (string, error)
- func PathWalk(root string) ([]string, error)
- func Present(args []string, lookup string) bool
- func ProcessString(str string, vars interface{}, delimLeft string, delimRight string) string
- func SuccessOut(message string)
- func WarningOut(message string)
- func YarnBuild(path string) (string, error)
- func YarnInstall(path string) (string, error)
- type EnvType
- type ErrorType
- type GitType
- type PackageType
- type TemplateType
- type Templates
Constants ¶
const ( ErrorUnknown ErrorType = "E_UNKNOWN" ErrorOpenFile ErrorType = "EOPEN_FILE" ErrorReadFile ErrorType = "EREAD_FILE" ErrorMissingFile ErrorType = "EMISSING_FILE" ErrorCmdExecution ErrorType = "ECMD_EXECUTION" ErrorMissingDirectory ErrorType = "EMISSING_DIRECTORY" ErrorCreateDirectory ErrorType = "ECREATE_DIRECTORY" ErrorCreateFile ErrorType = "ECREATE_FILE" ErrorPromptInvalid ErrorType = "EPROMPT_INVALID" ErrorInvalidAuthor ErrorType = "EAUTHOR_INVALID" ErrorInvalidTemplate ErrorType = "ETEMPLATE_INVALID" ErrorInvalidToken ErrorType = "ETOKEN_INVALID" ErrorInvalidFlag ErrorType = "EFLAG_INVALID" ErrorInvalidOrganization ErrorType = "EORGANIZATION_INVALID" ErrorInvalidWorkspace ErrorType = "EWORKSPACE_INVALID" ErrorInvalidGit ErrorType = "EGIT_INVALID" ErrorInvalidYarn ErrorType = "EYARN_INVALID" ErrorInvalidBuild ErrorType = "EBUILD_INVALID" ErrorInvalidCloudOperation ErrorType = "ECLOUD_OPERATION_INVALID" ErrorInvalidaIndentation ErrorType = "EINDENTATION_INVALID" ErrorInvalidTypescript ErrorType = "ETYPESCRIPT_INVALID" ErrorInvalidEnvironment ErrorType = "EENVIRONMENT_INVALID" CommandRoot string = "sublime" CommandFlagRoot string = "root" CommandFlagConfig string = "config" CommandFlagWorkspaceOrganization string = "organization" CommandFlagActionType string = "type" CommandFlagActionEnv string = "env" CommandRegister string = "register" CommandLogin string = "login" CommandWorkspace string = "workspace" CommandCreate string = "create" CommandAction string = "action" CommandStatus string = "status" MessageCommandConfigUsage string = "Config file (default is .sublime.json)." MessageCommandRootUsage string = "Project working dir, default to current dir." MessageCommandRootShort string = "CLI tool to manage monorepo packages." MessageCommandRootTokenExpire string = "Your token is expired. Start renew action." MessageErrorAuthorFileMissing string = "Author file not found. Please register first or login to cloud service." MessageErrorParseFile string = "Unable to parse file." MessageErrorIndentFile string = "Unable to indent file." MessageErrorWriteFile string = "Unable to write file" MessageErrorReadFile string = "Unable to read file" MessageErrorAuthorTokenMissing string = "Author is not authenticated. Please login first." // Register command MessageCommandRegisterShort string = "Register author on sublime cloud platform." MessageCommandRegisterLong string = `` /* 290-byte string literal not displayed */ MessageCommandRegisterNamePrompt string = "Please provide your name:" MessageCommandRegisterUsernamePrompt string = "Please provide your github username:" MessageCommandRegisterEmailPrompt string = "Please provide your email:" MessageCommandRegisterPasswordPrompt string = "Please provide a password:" MessageCommandRegisterProgressInit string = "Start registration process." MessageCommandRegisterProgressAuthor string = "Author registered. Init local config." MessageCommandRegisterLocalAuthor string = "Author local metadata saved." MessageCommandRegisterProgressDone string = "Almost done!" MessageCommandRegisterNextStep string = "" /* 156-byte string literal not displayed */ MessageErrorCommandExecution string = "Unable to execute command." MessageErrorCurrentDirectory string = "Unable to get current directory." MessageErrorHomeDirectory string = "Unable to get user home directory." MessageErrorCommandRegisterNamePrompt string = "Name provided is not valid." MessageErrorCommandRegisterUsernamePrompt string = "Username provided is not valid." MessageErrorCommandRegisterEmailPrompt string = "Email provided is not valid." MessageErrorCommandRegisterPasswordPrompt string = "Password provided is not valid." MessageErrorCommandRegisterHomeDir string = "Error creating data author directory." MessageErrorCommandRegisterReadTemplate string = "Unable to read template file." MessageErrorCommandRegisterWriteTemplate string = "Unable to write template file." // Login command MessageCommandLoginShort string = "Login author on sublime cloud platform." MessageCommandLoginLong string = `` /* 127-byte string literal not displayed */ MessageCommandLoginEmailPrompt string = "Login with your email:" MessageCommandLoginPasswordPrompt string = "Login with your password:" MessageCommandLoginProgressInit string = "Attempt to log you in on the cloud platform" MessageCommandLoginAuthor string = "Author loggedin. Init update author data." MessageCommandLoginSuccess string = "Author data update and loggedin." MessageErrorCommandLoginEmailPrompt string = "Email is not valid." MessageErrorCommandLoginPasswordPrompt string = "Password is not valid." // Workspace command MessageCommandWorkspaceShort string = "Create a workspace." MessageCommandWorkspaceLong string = `` /* 200-byte string literal not displayed */ MessageCommandWorkspaceOrganization string = "Github organization name [REQUIRED]" MessageCommandWorkspaceProgressInit string = "Starting creating monorepo structure" MessageCommandWorkspaceProgressWorkflows string = "Initialise monorepo workflows" MessageCommandWorkspaceProgressGit string = "Initialise git on workspace" MessageCommandWorkspaceProgressYarn string = "Initialise yarn on workspace" MessageCommandWorkspaceProgressVite string = "Starting building vite plugin" MessageCommandWorkspaceProgressCloud string = "Publish workspace on cloud platform" MessageCommandWorkspaceSuccess string = "Your workspace is ready. Create your first package." MessageCommandWorkspaceNamePrompt string = "Provide workspace name:" MessageCommandWorkspaceRepoPrompt string = "Provide short name repo [org/repo]:" MessageCommandWorkspaceDescriptionPrompt string = "Provide a workspace description:" MessageErrorCommandWorkspaceInvalidOrganization string = "Author not allowed in this domain/organization." MessageErrorCommandWorkspaceNamePrompt string = "Name provided is not valid." MessageErrorCommandWorkspaceRepoPrompt string = "Repo provided is not valid." MessageErrorCommandWorkspaceDescriptionPrompt string = "Description provided is not valid." MessageErrorCommandWorkspaceInvalidNamespace string = "Please provide a valid github organization name without @." MessageErrorCommandWorkspaceInvalidDirectory string = "Cannot create workspace folder." // Create command MessageCommandCreateShort string = "Create JS/TS packages" MessageCommandCreateLong string = "Create JS/TS packages based on templates provided by the CLI tool." MessageCommandCreateProgressInit string = "Starting creating package structure" MessageCommandCreateProgressUpdate string = "Updating monorepo files" MessageCommandCreateProgressYarn string = "Yarn linking and install packages" MessageCommandCreateProgressCloud string = "Creating package on cloud organisation" MessageCommandCreateSuccess string = "Your package is ready. Start working on it." MessageCommandCreateNamePrompt string = "Provide the package name:" MessageCommandCreateTypePrompt string = "Provide the package type:" MessageCommandCreateTemplatePrompt string = "Provide the template type:" MessageCommandCreateDescriptionPrompt string = "Provide package description:" MessageErrorCommandCreateNamePrompt string = "Name provided is not valid." MessageErrorCommandCreateTemplateInvalid string = "Template type is invalid." MessageErrorCommandCreateDescriptionPrompt string = "Description provided is not valid." // Action command MessageCommandActionShort string = "Github action command" MessageCommandActionLong string = "Action command is built to run on github workflows to create artifacts of the packages." MessageCommandActionTypeUnknown string = "The git type is not valid." MessageCommandActionNoPackages string = "No packages founded to build artifacts." MessageCommandActionFoundPackages string = "Founded %d package to build artifacts." MessageCommandActionUploadFile string = "File uploaded to %s with key: %s" MessageCommandActionArtifact string = "Artifact uploaded to bucket." MessageCommandActionVersionUpdate string = "Package %s updated to version: %s." MessageErrorCommandActionEnv string = "Action command can only run on CI environments." MessageErrorCommandActionNoCommits string = "No commits founded. Please commit first." // Status command MessageCommandStatusShort string = "Status about workspace" )
Variables ¶
var ( ApiUrl string = "" ApiKey string = "" ApiSecret string = "" )
https://github.com/supabase/supabase/discussions/2337
var TemplatesMap = []Templates{ { Template: Vue, Link: "git@github.com:websublime/sublime-vue-template.git", }, { Template: Lit, Link: "git@github.com:websublime/sublime-lit-template.git", }, { Template: Solid, Link: "git@github.com:websublime/sublime-solid-template.git", }, { Template: Typescript, Link: "git@github.com:websublime/sublime-typescript-template.git", }, }
Functions ¶
func GetBeforeAndLastDiff ¶
func GetBeforeDiff ¶
func GetBeforeLastCommit ¶
func GetBranchList ¶ added in v0.1.0
func GetCommitsCount ¶
func GetDiffBetweenTags ¶ added in v0.0.16
func GetLastCommit ¶
func ProcessString ¶
func SuccessOut ¶ added in v0.1.0
func SuccessOut(message string)
func WarningOut ¶ added in v0.1.0
func WarningOut(message string)
func YarnInstall ¶ added in v0.0.4
Types ¶
type PackageType ¶ added in v0.1.0
type PackageType string
const ( Library PackageType = "lib" Package PackageType = "pkg" )
type TemplateType ¶ added in v0.1.0
type TemplateType string
const ( Lit TemplateType = "lit" Solid TemplateType = "solid" Vue TemplateType = "vue" Typescript TemplateType = "typescript" )
type Templates ¶ added in v0.1.0
type Templates struct { Link string `json:"link"` Template TemplateType `json:"template"` }