├── .github └── workflows │ └── nodejs.yml ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── vsc-base.org ├── .env ├── .vsc-script │ ├── ttttest.vsc-script.ts │ ├── ys.vsc-script.error-log.js │ └── ys.vsc-script.ts ├── .vscodeignore ├── LICENSE ├── README.MD ├── package-lock.json ├── package.json ├── public │ ├── .htaccess │ ├── favicon.ico │ ├── favicon │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── manifest.json │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png │ ├── index.html │ └── manifest.json ├── src │ ├── App │ │ ├── App.module.scss │ │ └── App.tsx │ ├── allAnnotations │ │ ├── AllAnnotations.tsx │ │ ├── annotations │ │ │ ├── AddFileContentAnnotatedCode.tsx │ │ │ ├── AddLeadingLocalDashAnnotatedCode.tsx │ │ │ ├── AddSelectionAnnotatedCode.tsx │ │ │ ├── AddSelectionFromRangeAnnotatedCode.tsx │ │ │ ├── AppendLineToDocumentAnnotatedCode.tsx │ │ │ ├── AppendToDocumentAnnotatedCode.tsx │ │ │ ├── AskAnnotatedCode.tsx │ │ │ ├── AwaitResultAnnotatedCode.tsx │ │ │ ├── CleanPathAnnotatedCode.tsx │ │ │ ├── CopyAnnotatedCode.tsx │ │ │ ├── CreateSelectionAnnotatedCode.tsx │ │ │ ├── CreateVscodeRangeAndPositionAnnotatedCode.tsx │ │ │ ├── DoesExistsAnnotatedCode.tsx │ │ │ ├── EmptyDirAnnotatedCode.tsx │ │ │ ├── EscapeHtmlAnnotatedCode.tsx │ │ │ ├── ExecFromPathAnnotatedCode.tsx │ │ │ ├── FindFilePathsAnnotatedCode.tsx │ │ │ ├── FindFilePathsFromBaseAnnotatedCode.tsx │ │ │ ├── FindRelativeFilePathsAnnotatedCode.tsx │ │ │ ├── GetAbsolutePathFromRelativePathAnnotatedCode.tsx │ │ │ ├── GetActiveDocumentAnnotatedCode.tsx │ │ │ ├── GetActiveEditorAnnotatedCode.tsx │ │ │ ├── GetActiveTerminalAnnotatedCode.tsx │ │ │ ├── GetConfigAnnotatedCode.tsx │ │ │ ├── GetDirAnnotatedCode.tsx │ │ │ ├── GetDocumentContentAnnotatedCode.tsx │ │ │ ├── GetDocumentPathAnnotatedCode.tsx │ │ │ ├── GetErrorInfoAnnotatedCode.tsx │ │ │ ├── GetFileContentAnnotatedCode.tsx │ │ │ ├── GetFullDocumentRangeAnnotatedCode.tsx │ │ │ ├── GetJSONCircularReplacerAnnotatedCode.tsx │ │ │ ├── GetJsonContentAnnotatedCode.tsx │ │ │ ├── GetJsonPartsAnnotatedCode.tsx │ │ │ ├── GetLineStreamReaderAnnotatedCode.tsx │ │ │ ├── GetPackageDependenciesAnnotatedCode.tsx │ │ │ ├── GetPackageFilePathsAnnotatedCode.tsx │ │ │ ├── GetReadStreamAnnotatedCode.tsx │ │ │ ├── GetRelativePathAnnotatedCode.tsx │ │ │ ├── GetRootPackageJsonAnnotatedCode.tsx │ │ │ ├── GetRootPathAnnotatedCode.tsx │ │ │ ├── GetSubrelativePathFromAbsoluteRootPathAnnotatedCode.tsx │ │ │ ├── GetTimeStampAnnotatedCode.tsx │ │ │ ├── GetVscDefaultModuleMapAnnotatedCode.tsx │ │ │ ├── InitWebviewAnnotatedCode.tsx │ │ │ ├── InsertAfterAnnotatedCode.tsx │ │ │ ├── InsertAtAnnotatedCode.tsx │ │ │ ├── InsertAtRangeAnnotatedCode.tsx │ │ │ ├── InsertBeforeAnnotatedCode.tsx │ │ │ ├── IsAbsolutePathAnnotatedCode.tsx │ │ │ ├── IsDirAnnotatedCode.tsx │ │ │ ├── IsSubPathAnnotatedCode.tsx │ │ │ ├── JoinPathsAnnotatedCode.tsx │ │ │ ├── KeyValueReplacerAnnotatedCode.tsx │ │ │ ├── MakeDirAnnotatedCode.tsx │ │ │ ├── MaxDepthReplacerAnnotatedCode.tsx │ │ │ ├── MoveAnnotatedCode.tsx │ │ │ ├── NewDocumentAnnotatedCode.tsx │ │ │ ├── ObjectWalkerAnnotatedCode.tsx │ │ │ ├── OpenAnnotatedCode.tsx │ │ │ ├── PathAsUnixAnnotatedCode.tsx │ │ │ ├── PickAnnotatedCode.tsx │ │ │ ├── PrependLineToDocumentAnnotatedCode.tsx │ │ │ ├── PrependToDocumentAnnotatedCode.tsx │ │ │ ├── RemoveAnnotatedCode.tsx │ │ │ ├── RenameAnnotatedCode.tsx │ │ │ ├── SaveAllAnnotatedCode.tsx │ │ │ ├── SaveDocumentAnnotatedCode.tsx │ │ │ ├── SaveFileContentAnnotatedCode.tsx │ │ │ ├── ScaffoldTemplateAnnotatedCode.tsx │ │ │ ├── SetDocumentContentAnnotatedCode.tsx │ │ │ ├── SetSelectionAnnotatedCode.tsx │ │ │ ├── SetSelectionFromRangeAnnotatedCode.tsx │ │ │ ├── SetSelectionsAnnotatedCode.tsx │ │ │ ├── SetSelectionsFromRangesAnnotatedCode.tsx │ │ │ ├── SetupWebviewConnectionAnnotatedCode.tsx │ │ │ ├── SharedPathAnnotatedCode.tsx │ │ │ ├── ShowErrorMessageAnnotatedCode.tsx │ │ │ ├── ShowMessageAnnotatedCode.tsx │ │ │ ├── SleepAnnotatedCode.tsx │ │ │ ├── SplitPathAnnotatedCode.tsx │ │ │ ├── StartWebviewAnnotatedCode.tsx │ │ │ ├── SubtractPathAnnotatedCode.tsx │ │ │ ├── ToCamelcaseAnnotatedCode.tsx │ │ │ ├── ToJSONStringAnnotatedCode.tsx │ │ │ ├── ToKebabCaseAnnotatedCode.tsx │ │ │ ├── ToPascalCaseAnnotatedCode.tsx │ │ │ ├── ToSnakeCaseAnnotatedCode.tsx │ │ │ ├── ToTitleCaseAnnotatedCode.tsx │ │ │ ├── TrimDashesAnnotatedCode.tsx │ │ │ ├── TrimLeadingDashAnnotatedCode.tsx │ │ │ ├── TsAddEnumMemberAnnotatedCode.tsx │ │ │ ├── TsAddInterfaceMemberAnnotatedCode.tsx │ │ │ ├── TsAddVariableObjectPropertyAnnotatedCode.tsx │ │ │ ├── TsCreateNodeVisitorAnnotatedCode.tsx │ │ │ ├── TsCreateProgramAnnotatedCode.tsx │ │ │ ├── TsCreateRemoveNodesTransformerAnnotatedCode.tsx │ │ │ ├── TsCreateSourceFileAnnotatedCode.tsx │ │ │ ├── TsCreateTransformerAnnotatedCode.tsx │ │ │ ├── TsDefaultCompilerOptionsAnnotatedCode.tsx │ │ │ ├── TsFindAllNodePositionsFromContentAnnotatedCode.tsx │ │ │ ├── TsFindAncestorAnnotatedCode.tsx │ │ │ ├── TsFindChildAnnotatedCode.tsx │ │ │ ├── TsFindGrandChildAnnotatedCode.tsx │ │ │ ├── TsFindNodePositionFromContentAnnotatedCode.tsx │ │ │ ├── TsGetLocalModulesAnnotatedCode.tsx │ │ │ ├── TsGetParsedChildrenAnnotatedCode.tsx │ │ │ ├── TsHasAncestorAnnotatedCode.tsx │ │ │ ├── TsHasAncestorsAnnotatedCode.tsx │ │ │ ├── TsHasChildAnnotatedCode.tsx │ │ │ ├── TsHasChildrenAnnotatedCode.tsx │ │ │ ├── TsHasGrandChildAnnotatedCode.tsx │ │ │ ├── TsHasGrandChildrenAnnotatedCode.tsx │ │ │ ├── TsInsertEnumMemberAnnotatedCode.tsx │ │ │ ├── TsInsertImportAnnotatedCode.tsx │ │ │ ├── TsInsertInterfaceMemberAnnotatedCode.tsx │ │ │ ├── TsInsertVariableObjectPropertyAnnotatedCode.tsx │ │ │ ├── TsInsetImportAnnotatedCode.tsx │ │ │ ├── TsIsCallAnnotatedCode.tsx │ │ │ ├── TsIsEnumAnnotatedCode.tsx │ │ │ ├── TsIsEnumMemberAnnotatedCode.tsx │ │ │ ├── TsIsFunctionAnnotatedCode.tsx │ │ │ ├── TsIsIdentifierAnnotatedCode.tsx │ │ │ ├── TsIsImportAnnotatedCode.tsx │ │ │ ├── TsIsInterfaceAnnotatedCode.tsx │ │ │ ├── TsIsNodeAnnotatedCode.tsx │ │ │ ├── TsIsObjectPropertyAnnotatedCode.tsx │ │ │ ├── TsIsTypeRefAnnotatedCode.tsx │ │ │ ├── TsIsValueAnnotatedCode.tsx │ │ │ ├── TsIsVariableAnnotatedCode.tsx │ │ │ ├── TsIsVariableListAnnotatedCode.tsx │ │ │ ├── TsLoadModuleAnnotatedCode.tsx │ │ │ ├── TsLoadModuleSourceCodeAnnotatedCode.tsx │ │ │ ├── TsMatchCallAnnotatedCode.tsx │ │ │ ├── TsMatchEnumAnnotatedCode.tsx │ │ │ ├── TsMatchEnumMemberAnnotatedCode.tsx │ │ │ ├── TsMatchFunctionAnnotatedCode.tsx │ │ │ ├── TsMatchIdentifierAnnotatedCode.tsx │ │ │ ├── TsMatchImportAnnotatedCode.tsx │ │ │ ├── TsMatchInterfaceAnnotatedCode.tsx │ │ │ ├── TsMatchNodeAnnotatedCode.tsx │ │ │ ├── TsMatchObjectPropertyAnnotatedCode.tsx │ │ │ ├── TsMatchTypeRefAnnotatedCode.tsx │ │ │ ├── TsMatchValueNodeAnnotatedCode.tsx │ │ │ ├── TsMatchVariableAnnotatedCode.tsx │ │ │ ├── TsMatchVariableListAnnotatedCode.tsx │ │ │ ├── TsReplaceAllAnnotatedCode.tsx │ │ │ ├── TsReplaceAnnotatedCode.tsx │ │ │ ├── TsRewriteTranpiledCodeWithVscBaseModulesAnnotatedCode.tsx │ │ │ ├── TsRewriteTranspiledCodeWithVscBaseModulesAnnotatedCode.tsx │ │ │ ├── TsTransformAnnotatedCode.tsx │ │ │ ├── TsTransformNodeAnnotatedCode.tsx │ │ │ ├── TsTranspileAnnotatedCode.tsx │ │ │ ├── TsVisitWithTransformersAnnotatedCode.tsx │ │ │ ├── VerifyModuleMethodsAnnotatedCode.tsx │ │ │ ├── WebviewHTMLTemplateAnnotatedCode.tsx │ │ │ ├── WebviewStyleTemplateAnnotatedCode.tsx │ │ │ └── WriteToTerminalAnnotatedCode.tsx │ │ └── vsc-base-raw.ts │ ├── allScripts │ │ ├── AllScripts.tsx │ │ └── scripts │ │ │ ├── NameAllScripts.tsx │ │ │ └── OrganizeImports.tsx │ ├── components │ │ ├── AnnotatedCode │ │ │ ├── AnnotatedCode.module.scss │ │ │ └── AnnotatedCode.tsx │ │ ├── Header │ │ │ ├── Header.module.scss │ │ │ └── Header.tsx │ │ ├── HighlightedCode │ │ │ ├── HighlightedCode.module.scss │ │ │ └── HighlightedCode.tsx │ │ ├── MethodTest │ │ │ ├── MethodTest.module.scss │ │ │ └── MethodTest.tsx │ │ └── MethodTestPrinter │ │ │ ├── MethodTestPrinter.module.scss │ │ │ └── MethodTestPrinter.tsx │ ├── images │ │ ├── github.svg │ │ ├── logo-gray.png │ │ ├── logo-white.png │ │ ├── logo.png │ │ └── logo.psd │ ├── index.tsx │ ├── pages │ │ ├── home │ │ │ ├── Home.module.scss │ │ │ └── Home.tsx │ │ └── scripts │ │ │ ├── Scripts.module.scss │ │ │ └── Scripts.tsx │ ├── react-app-env.d.ts │ ├── serviceWorker.ts │ ├── style │ │ ├── index.scss │ │ ├── mixins.scss │ │ ├── prism.css │ │ └── variables.scss │ └── test │ │ └── vsc-base.test.ts ├── tsconfig.json ├── tsconfig.paths.json └── yarn.lock ├── vsc-base ├── CHANGES.md ├── LICENSE ├── README.md ├── out │ ├── vsc-base-raw.d.ts │ ├── vsc-base-raw.js │ ├── vsc-base-raw.js.map │ ├── vsc-base-system.d.ts │ ├── vsc-base-system.js │ ├── vsc-base-system.js.map │ ├── vsc-base-typescript-base.d.ts │ ├── vsc-base-typescript-base.js │ ├── vsc-base-typescript-base.js.map │ ├── vsc-base-typescript-match.d.ts │ ├── vsc-base-typescript-match.js │ ├── vsc-base-typescript-match.js.map │ ├── vsc-base-typescript-module-load.d.ts │ ├── vsc-base-typescript-module-load.js │ ├── vsc-base-typescript-module-load.js.map │ ├── vsc-base-typescript-top-level-transform.d.ts │ ├── vsc-base-typescript-top-level-transform.js │ ├── vsc-base-typescript-top-level-transform.js.map │ ├── vsc-base-typescript-transform.d.ts │ ├── vsc-base-typescript-transform.js │ ├── vsc-base-typescript-transform.js.map │ ├── vsc-base-vscTemplate.d.ts │ ├── vsc-base-vscTemplate.js │ ├── vsc-base-vscTemplate.js.map │ ├── vsc-base-vscode-webview.d.ts │ ├── vsc-base-vscode-webview.js │ ├── vsc-base-vscode-webview.js.map │ ├── vsc-base-vscode.d.ts │ ├── vsc-base-vscode.js │ ├── vsc-base-vscode.js.map │ ├── vsc-base.d.ts │ ├── vsc-base.js │ └── vsc-base.js.map ├── package-lock.json ├── package.json ├── src │ ├── vsc-base-raw.ts │ ├── vsc-base-system.ts │ ├── vsc-base-typescript-base.ts │ ├── vsc-base-typescript-match.ts │ ├── vsc-base-typescript-module-load.ts │ ├── vsc-base-typescript-top-level-transform.ts │ ├── vsc-base-typescript-transform.ts │ ├── vsc-base-vscTemplate.ts │ ├── vsc-base-vscode-webview.ts │ ├── vsc-base-vscode.ts │ └── vsc-base.ts ├── tsconfig.json ├── tslint.json └── yarn.lock ├── vsc-organize-imports ├── .vscode │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── images │ └── vsc-scaffolding.gif ├── out │ ├── CleanCode.js │ ├── CleanCode.js.map │ ├── OrganizeImports.js │ ├── OrganizeImports.js.map │ ├── Scaffolding.js │ ├── Scaffolding.js.map │ ├── SortImports.js │ ├── SortImports.js.map │ ├── TemplateTypes.js │ ├── TemplateTypes.js.map │ ├── cleaners │ │ ├── SortImports.js │ │ └── SortImports.js.map │ ├── extension.js │ ├── extension.js.map │ └── test │ │ ├── extension.test.js │ │ ├── extension.test.js.map │ │ ├── index.js │ │ └── index.js.map ├── package-lock.json ├── package.json ├── src │ ├── OrganizeImports.ts │ ├── SortImports.ts │ ├── examples.json │ ├── extension.ts │ ├── temp.vsc-tempate.js │ └── test │ │ ├── extension.test.ts │ │ └── index.ts ├── tsconfig.json ├── tslint.json ├── vsc-base-icon.png ├── vsc-extension-quickstart.md └── vsc-organize-imports-0.1.9.vsix ├── vsc-rename-files ├── .vscode │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── out │ ├── RenameFiles.js │ ├── RenameFiles.js.map │ ├── extension.js │ └── extension.js.map ├── package-lock.json ├── package.json ├── src │ ├── RenameFiles.ts │ └── extension.ts ├── tsconfig.json ├── tslint.json ├── vsc-base-icon.png ├── vsc-extension-quickstart.md └── vsc-rename-files-2.1.1.vsix ├── vsc-scaffolding ├── .vsc-templates │ ├── Component.vsc-template.js │ └── ComponentTSPath.vsc-template.ts ├── .vscode │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── images │ └── vsc-scaffolding.gif ├── out │ ├── Scaffolding.js │ ├── Scaffolding.js.map │ ├── TemplateTypes.js │ ├── TemplateTypes.js.map │ ├── extension.js │ ├── extension.js.map │ └── test │ │ ├── extension.test.js │ │ ├── extension.test.js.map │ │ ├── index.js │ │ └── index.js.map ├── package-lock.json ├── package.json ├── src │ ├── Scaffolding.ts │ ├── extension.ts │ ├── temp.vsc-tempate.js │ └── test │ │ ├── extension.test.ts │ │ └── index.ts ├── tsconfig.json ├── tslint.json ├── vsc-base-icon.png ├── vsc-extension-quickstart.md └── vsc-scaffolding-0.1.14.vsix └── vsc-script ├── .vsc-script ├── Add-Script-Names.vsc-script.ts ├── AddVscDef.vsc-script.ts ├── PPFILES.txt ├── createTransformerMathcer.vsc-script.ts ├── del-method │ └── add-variable-object-property.vsc-script.ts ├── examples │ ├── find-unused-style-vars.vsc-script.ts │ └── rename-style-vars.vsc-script.ts ├── findDependenciesTransformer.vsc-script.ts ├── findRel.vsc-script.ts ├── getConst.vsc-script.ts ├── maxDepthReplacerTest.vsc-script.ts ├── onSaveEx.vsc-script-onsave-.ts ├── script.vsc-script.ts ├── sortImports.vsc-script.ts ├── test.vsc-script-onsave-.ts ├── test.vsc-script.ts ├── tests │ ├── rangeFinderTest.vsc-script.ts │ ├── test-tsInsertImport.vsc-script.ts │ ├── test-util │ │ └── with__import.ts │ ├── webviews │ │ ├── test-webview.html │ │ ├── webview-test1.vsc-script.ts │ │ ├── webview-test2.vsc-script.ts │ │ ├── webview-test3.vsc-script.tsx │ │ └── webview-test4.vsc-script.ts │ └── with__import.vsc-script.ts ├── tsReplaceTest.vsc-script.ts ├── tsTransformerPattern.vsc-script.ts ├── tsTransformerTest.vsc-script.ts ├── tsTranspileTransformTest.vsc-script.ts └── vsc-compiling │ ├── ---VSC-Project-SORT---.vsc-script.ts │ ├── ---compile-VSC-Project---.vsc-script.ts │ ├── VSC-Project-Analysis.vsc-script.ts │ ├── updateSCriptAndScaff.vsc-script.ts │ └── vcs-base-util │ └── mapping.ts ├── .vsc-temples ├── Component.vsc-template.js ├── ComponentAcyncTS.vsc-template.ts ├── ComponentTS.vsc-template.ts └── app-controller.vsc-script.ts ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── out ├── .vsc-script │ ├── rangeFinderTest.vsc-script.js │ └── rangeFinderTest.vsc-script.js.map ├── Script.js ├── Script.js.map ├── extension.js ├── extension.js.map ├── src │ ├── Script.js │ ├── Script.js.map │ ├── extension.js │ ├── extension.js.map │ ├── test │ │ ├── index.js │ │ ├── index.js.map │ │ ├── vsc-base.test.js │ │ └── vsc-base.test.js.map │ └── vsc-base-development │ │ ├── vsc-base-raw.js │ │ ├── vsc-base-raw.js.map │ │ ├── vsc-base-system.js │ │ ├── vsc-base-system.js.map │ │ ├── vsc-base-typescript.js │ │ ├── vsc-base-typescript.js.map │ │ ├── vsc-base-vscTemplate.js │ │ ├── vsc-base-vscTemplate.js.map │ │ ├── vsc-base-vscode.js │ │ ├── vsc-base-vscode.js.map │ │ ├── vsc-base.js │ │ └── vsc-base.js.map ├── test │ ├── compiled-tests │ │ ├── vsc-base-raw.test.js │ │ ├── vsc-base-raw.test.js.map │ │ ├── vsc-base-system.test.js │ │ ├── vsc-base-system.test.js.map │ │ ├── vsc-base-typescript-base.test.js │ │ ├── vsc-base-typescript-base.test.js.map │ │ ├── vsc-base-typescript-match.test.js │ │ ├── vsc-base-typescript-match.test.js.map │ │ ├── vsc-base-typescript-module-load.test.js │ │ ├── vsc-base-typescript-module-load.test.js.map │ │ ├── vsc-base-typescript-top-level-transform.test.js │ │ ├── vsc-base-typescript-top-level-transform.test.js.map │ │ ├── vsc-base-typescript-transform.test.js │ │ ├── vsc-base-typescript-transform.test.js.map │ │ ├── vsc-base-vscTemplate.test.js │ │ ├── vsc-base-vscTemplate.test.js.map │ │ ├── vsc-base-vscode-webview.test.js │ │ ├── vsc-base-vscode-webview.test.js.map │ │ ├── vsc-base-vscode.test.js │ │ └── vsc-base-vscode.test.js.map │ ├── index.js │ ├── index.js.map │ ├── typescript-base │ │ ├── -test-typescript-base.vsc-script.js │ │ └── -test-typescript-base.vsc-script.js.map │ ├── vsc-base-raw.test.js │ ├── vsc-base-raw.test.js.map │ ├── vsc-base.test.js │ └── vsc-base.test.js.map ├── vsc-base-development │ ├── vsc-base-raw.js │ ├── vsc-base-raw.js.map │ ├── vsc-base-system.js │ ├── vsc-base-system.js.map │ ├── vsc-base-typescript-base.js │ ├── vsc-base-typescript-base.js.map │ ├── vsc-base-typescript-match.js │ ├── vsc-base-typescript-match.js.map │ ├── vsc-base-typescript-module-load.js │ ├── vsc-base-typescript-module-load.js.map │ ├── vsc-base-typescript-top-level-transform.js │ ├── vsc-base-typescript-top-level-transform.js.map │ ├── vsc-base-typescript-transform.js │ ├── vsc-base-typescript-transform.js.map │ ├── vsc-base-typescript.js │ ├── vsc-base-typescript.js.map │ ├── vsc-base-vscTemplate.js │ ├── vsc-base-vscTemplate.js.map │ ├── vsc-base-vscode-webview-libs.js │ ├── vsc-base-vscode-webview-libs.js.map │ ├── vsc-base-vscode-webview.js │ ├── vsc-base-vscode-webview.js.map │ ├── vsc-base-vscode.js │ ├── vsc-base-vscode.js.map │ ├── vsc-base.js │ └── vsc-base.js.map ├── webview-test1.vsc-script.js ├── webview-test1.vsc-script.js.map ├── webview-test2.vsc-script.js └── webview-test2.vsc-script.js.map ├── package-lock.json ├── package.json ├── src ├── Script.ts ├── extension.ts ├── test │ ├── compiled-tests │ │ ├── vsc-base-raw.test.ts │ │ ├── vsc-base-system.test.ts │ │ ├── vsc-base-typescript-base.test.ts │ │ ├── vsc-base-typescript-match.test.ts │ │ ├── vsc-base-typescript-module-load.test.ts │ │ ├── vsc-base-typescript-top-level-transform.test.ts │ │ ├── vsc-base-typescript-transform.test.ts │ │ ├── vsc-base-vscTemplate.test.ts │ │ ├── vsc-base-vscode-webview.test.ts │ │ └── vsc-base-vscode.test.ts │ └── index.ts └── vsc-base-development │ ├── vsc-base-raw.ts │ ├── vsc-base-system.ts │ ├── vsc-base-typescript-base.ts │ ├── vsc-base-typescript-match.ts │ ├── vsc-base-typescript-module-load.ts │ ├── vsc-base-typescript-top-level-transform.ts │ ├── vsc-base-typescript-transform.ts │ ├── vsc-base-vscTemplate.ts │ ├── vsc-base-vscode-webview.ts │ ├── vsc-base-vscode.ts │ └── vsc-base.ts ├── tsconfig.json ├── tslint.json ├── vsc-base-icon.png ├── vsc-extension-quickstart.md ├── vsc-script-0.6.7.vsix └── webpack.config.js /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | strategy: 11 | matrix: 12 | node-version: [8.x, 10.x, 12.x] 13 | 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - name: npm install, build, and test 21 | run: | 22 | npm ci 23 | npm run build --if-present 24 | npm test 25 | env: 26 | CI: true 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # vscode 9 | .vscode-test 10 | 11 | # Runtime data 12 | pids 13 | *.pid 14 | *.seed 15 | *.pid.lock 16 | 17 | # Directory for instrumented libs generated by jscoverage/JSCover 18 | lib-cov 19 | 20 | # Coverage directory used by tools like istanbul 21 | coverage 22 | 23 | # nyc test coverage 24 | .nyc_output 25 | 26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 27 | .grunt 28 | 29 | # Bower dependency directory (https://bower.io/) 30 | bower_components 31 | 32 | # node-waf configuration 33 | .lock-wscript 34 | 35 | # Compiled binary addons (https://nodejs.org/api/addons.html) 36 | build/Release 37 | 38 | # Dependency directories 39 | node_modules/ 40 | jspm_packages/ 41 | 42 | # TypeScript v1 declaration files 43 | typings/ 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | 63 | # next.js build output 64 | .next 65 | 66 | # Webstorm 67 | .idea 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The vsc-base project 2 | 3 | This is a mono-respo for: 4 | 5 | - vsc-base (npm module) 6 | - vsc-script (vscode extension) 7 | - vsc-scaffolding (vscode extension) 8 | - vsc-base.org (documentation wesite) 9 | 10 | All documentation is on [vsc-base.org](http:///vsc-base.org) 11 | 12 | Release note is on the gihub wiki [vsc-base Release note](https://github.com/alfnielsen/vsc-base/wiki/Release-notes) 13 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1 3 | } 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "vsc-organize-imports": { 3 | "orderSpecifiers": true, 4 | "orderSpecifiersAsSingleLine": true, 5 | "baseUrl": "src", 6 | "emptyLinesAfterImports": 1, 7 | "emptyLinesBetweenFilledGroups": 1, 8 | "groups": [ 9 | { 10 | "groups": [ 11 | "global" 12 | ], 13 | "sortBy": "path", 14 | "emptyLines": true 15 | }, 16 | { 17 | "groups": [ 18 | "absolute" 19 | ], 20 | "sortBy": "path", 21 | "emptyLines": true 22 | }, 23 | { 24 | "groups": [ 25 | "relative" 26 | ], 27 | "sortBy": "path", 28 | "emptyLines": true 29 | }, 30 | { 31 | "groups": [ 32 | "globalDirect", 33 | "absoluteDirect", 34 | "relativeDirect" 35 | ], 36 | "sortBy": "path", 37 | "emptyLines": true 38 | } 39 | ] 40 | }, 41 | "dependencies": {} 42 | } 43 | -------------------------------------------------------------------------------- /vsc-base.org/.env: -------------------------------------------------------------------------------- 1 | NODE_PATH=./src -------------------------------------------------------------------------------- /vsc-base.org/.vsc-script/ys.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: ys.vsc-script 2 | import * as vsc from 'vsc-base' 3 | 4 | export async function run(path: string) { 5 | const rootPath = vsc.getRootPath() 6 | vsc.showMessage(rootPath); 7 | await vsc.cpExecFromPath('ys', rootPath); 8 | //await vsc.fsExec('yarn start') 9 | } -------------------------------------------------------------------------------- /vsc-base.org/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/tslint.json 9 | **/*.map 10 | **/*.ts -------------------------------------------------------------------------------- /vsc-base.org/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vsc-base.org", 3 | "version": "0.1.0", 4 | "dependencies": { 5 | "@types/prismjs": "^1.16.0", 6 | "@types/react-copy-to-clipboard": "^4.3.0", 7 | "@types/react-router": "^5.1.3", 8 | "@types/react-router-dom": "^5.1.2", 9 | "classnames": "^2.2.6", 10 | "node-sass": "^4.13.0", 11 | "prismjs": "^1.24.0", 12 | "react": "^16.12.0", 13 | "react-animate-height": "^2.0.17", 14 | "react-copy-to-clipboard": "^5.0.2", 15 | "react-dom": "^16.12.0", 16 | "react-router": "^5.1.2", 17 | "react-router-dom": "^5.1.2", 18 | "react-router-hash-link": "^1.2.2", 19 | "react-scripts": "3.2.0", 20 | "react-syntax-highlighter": "^11.0.2", 21 | "typescript": "^3.7.2", 22 | "use-react-router": "^1.0.7", 23 | "vscode": "^1.1.36" 24 | }, 25 | "scripts": { 26 | "start": "react-scripts start", 27 | "build": "react-scripts build", 28 | "test": "react-scripts test", 29 | "eject": "react-scripts eject" 30 | }, 31 | "eslintConfig": { 32 | "extends": "react-app" 33 | }, 34 | "browserslist": [ 35 | ">0.2%", 36 | "not dead", 37 | "not ie <= 11", 38 | "not op_mini all" 39 | ], 40 | "devDependencies": { 41 | "@types/classnames": "^2.2.9", 42 | "@types/fs-extra": "^8.0.1", 43 | "@types/jest": "24.0.23", 44 | "@types/mocha": "^5.2.7", 45 | "@types/node": "12.12.9", 46 | "@types/react": "16.9.11", 47 | "@types/react-dom": "16.9.4", 48 | "@types/react-syntax-highlighter": "^11.0.2", 49 | "fs-extra": "^8.1.0" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vsc-base.org/public/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine on 2 | RewriteCond %{REQUEST_FILENAME} !-f 3 | RewriteCond %{REQUEST_FILENAME} !-d 4 | RewriteRule ^(.*)$ /?path=$1 [NC,L,QSA] -------------------------------------------------------------------------------- /vsc-base.org/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon.ico -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/android-icon-144x144.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/android-icon-192x192.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/android-icon-36x36.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/android-icon-48x48.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/android-icon-72x72.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/android-icon-96x96.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-114x114.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-120x120.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-144x144.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-152x152.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-180x180.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-57x57.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-60x60.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-72x72.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-76x76.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon-precomposed.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/apple-icon.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/favicon-96x96.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/favicon.ico -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/ms-icon-144x144.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/ms-icon-150x150.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/ms-icon-310x310.png -------------------------------------------------------------------------------- /vsc-base.org/public/favicon/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/public/favicon/ms-icon-70x70.png -------------------------------------------------------------------------------- /vsc-base.org/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /vsc-base.org/src/App/App.module.scss: -------------------------------------------------------------------------------- 1 | @import 'style/variables.scss'; 2 | 3 | .App { 4 | display: flex; 5 | flex-direction: column; 6 | width: 100vw; 7 | height: 100vh; 8 | } 9 | .decsription { 10 | padding: 30px; 11 | } 12 | 13 | .annotatedCode { 14 | display: block; 15 | background: $dark; 16 | color: #fff; 17 | padding: 10px 30px; 18 | } 19 | 20 | .titleNote { 21 | font-size: 12px; 22 | } 23 | .warning { 24 | background: #f99; 25 | padding: 5px; 26 | margin-bottom: 40px; 27 | } 28 | -------------------------------------------------------------------------------- /vsc-base.org/src/App/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | import { Route, Switch } from 'react-router' 3 | import useReactRouter from 'use-react-router' 4 | import AllAnnotations from 'allAnnotations/AllAnnotations' 5 | import Header from 'components/Header/Header' 6 | import HighlightedCode from 'components/HighlightedCode/HighlightedCode' 7 | import Home from '../pages/home/Home' 8 | import Scripts from '../pages/scripts/Scripts' 9 | import styles from './App.module.scss' 10 | 11 | const App = () => { 12 | return ( 13 |
14 |
15 | 16 | 17 | 18 | 19 |
20 | ) 21 | } 22 | export default App 23 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/AddFileContentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const AddFileContentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Append content to a file 17 |

18 |

19 | See fs docs for appendFile 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.saveFileContent(path, source)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param path,content 28 | * @vscType System 29 | * @dependencyExternal fs 30 | * @returns Promise 31 | */ 32 | export const addFileContent = async ( 33 | path: string, 34 | content: string, 35 | options?: fs.WriteFileOptions 36 | ): Promise => \{ 37 | await fs.appendFile(path, content, options) 38 | }`} 39 | /> 40 | ) 41 | } 42 | 43 | export default AddFileContentAnnotatedCode 44 | 45 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/AddLeadingLocalDashAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const AddLeadingLocalDashAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | Add './' to start of path 21 |

22 | 23 | } 24 | 25 | test={ 26 | { 31 | const res = vsc.addLeadingLocalDash(args.path) 32 | setResult(res) 33 | }} 34 | /> 35 | } 36 | 37 | codeOneLineEx={`const path = vsc.addLeadingLocalDash(path)`} 38 | codeEx={``} 39 | code={`/** 40 | * @param path 41 | * @vscType Raw 42 | * @returns string 43 | */ 44 | export const addLeadingLocalDash = (path: string): string => \{ 45 | return './' + path 46 | }`} 47 | /> 48 | ) 49 | } 50 | 51 | export default AddLeadingLocalDashAnnotatedCode 52 | 53 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/AddSelectionAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const AddSelectionAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Add a Selection for an TextEditor (Current document) 17 |

18 |

19 | returns true on success 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const success = vsc.addSelection(range)`} 25 | codeEx={``} 26 | code={`/** 27 | * @vscType Vscode 28 | * @returns boolean 29 | */ 30 | export const addSelection = ( 31 | start: number, 32 | end: number = start, 33 | editor?: vscode.TextEditor, 34 | ): boolean => \{ 35 | if (!editor) \{ 36 | editor = vsc.getActiveEditor() 37 | } 38 | if (!editor) \{ 39 | return false; 40 | } 41 | const source = editor.document.getText() 42 | const selection = vsc.createSelection(source, start, end) 43 | editor.selections = [selection, ...editor.selections] 44 | //editor.selections.push(selection) 45 | return true 46 | }`} 47 | /> 48 | ) 49 | } 50 | 51 | export default AddSelectionAnnotatedCode 52 | 53 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/AddSelectionFromRangeAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const AddSelectionFromRangeAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Add a Selection for an TextEditor (Current document) 17 |

18 |

19 | returns true on success 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const success = vsc.addSelectionFromRange(range)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param range,editor 28 | * @vscType Vscode 29 | * @returns boolean 30 | */ 31 | export const addSelectionFromRange = ( 32 | range: vscode.Range, 33 | editor?: vscode.TextEditor, 34 | ): boolean => \{ 35 | if (!editor) \{ 36 | editor = vsc.getActiveEditor() 37 | } 38 | if (!editor) \{ 39 | return false; 40 | } 41 | editor.selections = [new vscode.Selection(range.start, range.end), ...editor.selections] 42 | return true 43 | }`} 44 | /> 45 | ) 46 | } 47 | 48 | export default AddSelectionFromRangeAnnotatedCode 49 | 50 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/AppendLineToDocumentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const AppendLineToDocumentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Append new line content in the end of the (open) document 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const success = vsc.appendLineToDocument(content)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param content,editor 25 | * @dependencyInternal appendToActiveDocument 26 | * @vscType Vscode 27 | * @returns boolean 28 | */ 29 | export const appendLineToDocument = ( 30 | content: string, 31 | editor?: vscode.TextEditor 32 | ): boolean => \{ 33 | return vsc.appendToDocument('\\n' + content, editor) 34 | }`} 35 | /> 36 | ) 37 | } 38 | 39 | export default AppendLineToDocumentAnnotatedCode 40 | 41 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/AskAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const AskAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Prompt user for a question 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const answer = await vsc.ask(question, defaultValue)`} 22 | codeEx={` 23 | const answer = await ask('Where to move file?', currentFilePath)`} 24 | code={`/** 25 | * @param question string,defaultValue string 26 | * @dependencyExternal vscode 27 | * @vscType Vscode 28 | * @returns Promise 29 | */ 30 | export const ask = async ( 31 | question: string, 32 | defaultValue: string 33 | ): Promise => 34 | await vscode.window.showInputBox(\{ 35 | prompt: question, 36 | value: defaultValue 37 | })`} 38 | /> 39 | ) 40 | } 41 | 42 | export default AskAnnotatedCode 43 | 44 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/AwaitResultAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const AwaitResultAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Ensure that a method result that optional can be a promise is awaited. 17 |

18 |

19 | (Responses from methods loaded with vsc.tsLoadModule can be optional async!) 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.awaitResult(result)`} 25 | codeEx={` 26 | const verifiedModule = vsc.verifyModuleMethods( 27 | _module, 28 | ['run'] 29 | ) 30 | let result = verifiedModule.run() 31 | result = await vsc.awaitResult(result)`} 32 | code={`/** 33 | * @vscType ts 34 | * @returns Promise 35 | */ 36 | export const awaitResult = async (result: any): Promise => \{ 37 | if (result instanceof Promise) \{ 38 | return result 39 | } else \{ 40 | return Promise.resolve(result) 41 | } 42 | }`} 43 | /> 44 | ) 45 | } 46 | 47 | export default AwaitResultAnnotatedCode 48 | 49 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/CopyAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const CopyAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Copy file/folder 17 |

18 |

19 | See fs-extra docs for copy 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.copy(oldPath, newPath)`} 25 | codeEx={``} 26 | code={`/** 27 | * @vscType System 28 | * @dependencyExternal fs 29 | * @returns Promise 30 | */ 31 | export const copy = async ( 32 | path: string, 33 | newPath: string, 34 | options?: fs.CopyOptions 35 | ): Promise => \{ 36 | await fs.copy(path, newPath, options) 37 | }`} 38 | /> 39 | ) 40 | } 41 | 42 | export default CopyAnnotatedCode 43 | 44 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/CreateSelectionAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const CreateSelectionAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Create a vscode.Selection \ 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const selection = vsc.createSelection(start, end)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param range,editor 25 | * @vscType Vscode 26 | * @returns vscode.Selection 27 | */ 28 | export const createSelection = ( 29 | source: string, 30 | start: number, 31 | end: number = start, 32 | trimSpaces = true 33 | ): vscode.Selection => \{ 34 | const complexRangeObject = vsc.createVscodeRangeAndPosition(source, start, end, trimSpaces) 35 | const selection = new vscode.Selection(complexRangeObject.startPosition, complexRangeObject.endPosition) 36 | return selection 37 | }`} 38 | /> 39 | ) 40 | } 41 | 42 | export default CreateSelectionAnnotatedCode 43 | 44 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/DoesExistsAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const DoesExistsAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Does the folder/file exist 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const exist = vsc.doesExists(path)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param path string 25 | * @dependencyExternal fs 26 | * @vscType System 27 | * @returns boolean 28 | */ 29 | export const doesExists = (path: string): boolean => \{ 30 | return fs.existsSync(path) 31 | }`} 32 | /> 33 | ) 34 | } 35 | 36 | export default DoesExistsAnnotatedCode 37 | 38 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/EmptyDirAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const EmptyDirAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | emptyDir folder 17 |

18 |

19 | See fs-extra docs for emptyDir 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.remove(path)`} 25 | codeEx={``} 26 | code={`/** 27 | * @vscType System 28 | * @dependencyExternal fs 29 | * @returns Promise 30 | */ 31 | export const emptyDir = async (path: string): Promise => \{ 32 | await fs.emptyDir(path) 33 | }`} 34 | /> 35 | ) 36 | } 37 | 38 | export default EmptyDirAnnotatedCode 39 | 40 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetActiveDocumentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetActiveDocumentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get open vscode.TextDocument 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const document = vsc.getActiveDocument()`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyExternal vscode 25 | * @vscType Vscode 26 | * @returns vscode.TextDocument | undefined 27 | */ 28 | export const getActiveDocument = ( 29 | editor?: vscode.TextEditor 30 | ): vscode.TextDocument | undefined => \{ 31 | if (!editor) \{ 32 | editor = vsc.getActiveEditor() 33 | } 34 | const document = editor && editor.document 35 | return document 36 | }`} 37 | /> 38 | ) 39 | } 40 | 41 | export default GetActiveDocumentAnnotatedCode 42 | 43 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetActiveEditorAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetActiveEditorAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get vscode.window.activeTextEditor 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const editor = vsc.getActiveEditor()`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyExternal vscode 25 | * @vscType Vscode 26 | * @returns vscode.TextEditor | undefined 27 | */ 28 | export const getActiveEditor = (): vscode.TextEditor | undefined => \{ 29 | return vscode.window.activeTextEditor 30 | }`} 31 | /> 32 | ) 33 | } 34 | 35 | export default GetActiveEditorAnnotatedCode 36 | 37 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetActiveTerminalAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetActiveTerminalAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get vscode.window.activeTerminal 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const editor = vsc.getActiveTerminal()`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyExternal vscode 25 | * @vscType Vscode 26 | * @returns vscode.TextEditor | undefined 27 | */ 28 | export const getActiveTerminal = (): vscode.Terminal | undefined => \{ 29 | return vscode.window.activeTerminal 30 | }`} 31 | /> 32 | ) 33 | } 34 | 35 | export default GetActiveTerminalAnnotatedCode 36 | 37 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetConfigAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetConfigAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get vscode project config 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const myOption = vsc.getConfig(projectName, optionName, defaultValue)`} 22 | codeEx={` 23 | const myOption = vsc.getConfig('myExtension', 'doThisThing', false)`} 24 | code={`/** 25 | * @dependencyExternal vscode 26 | * @vscType System 27 | * @returns T 28 | */ 29 | export const getConfig = ( 30 | projectName: string, 31 | property: string, 32 | defaultValue: T 33 | ): T => \{ 34 | return vscode.workspace 35 | .getConfiguration(projectName) 36 | .get(property, defaultValue) 37 | }`} 38 | /> 39 | ) 40 | } 41 | 42 | export default GetConfigAnnotatedCode 43 | 44 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetDirAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetDirAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get dir from path 17 |

18 |

19 | (If path is a dir return it) 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const dir = vsc.getDir(path)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param path 28 | * @dependencyInternal isDir, splitPath 29 | * @vscType System 30 | * @returns string 31 | */ 32 | export const getDir = (path: string) => \{ 33 | const _isDir = vsc.isDir(path) 34 | if (_isDir) \{ 35 | return path 36 | } 37 | const [dir] = vsc.splitPath(path) 38 | return dir 39 | }`} 40 | /> 41 | ) 42 | } 43 | 44 | export default GetDirAnnotatedCode 45 | 46 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetDocumentContentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetDocumentContentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get current open file's content. 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const content = vsc.getDocumentContent()`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyInternal getActiveDocument 25 | * @vscType Vscode 26 | * @returns string | undefined 27 | */ 28 | export const getDocumentContent = ( 29 | document?: vscode.TextDocument 30 | ): string | undefined => \{ 31 | if (!document) \{ 32 | document = vsc.getActiveDocument() 33 | } 34 | return (document && document.getText()) || undefined 35 | }`} 36 | /> 37 | ) 38 | } 39 | 40 | export default GetDocumentContentAnnotatedCode 41 | 42 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetDocumentPathAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetDocumentPathAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get current open file path or undefined if nothing is open. 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const path = vsc.getDocumentPath()`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyInternal getActiveDocument 25 | * @vscType Vscode 26 | * @returns string | undefined 27 | */ 28 | export const getDocumentPath = ( 29 | document?: vscode.TextDocument 30 | ): string | undefined => \{ 31 | if (!document) \{ 32 | document = vsc.getActiveDocument() 33 | } 34 | return (document && document.fileName) || undefined 35 | }`} 36 | /> 37 | ) 38 | } 39 | 40 | export default GetDocumentPathAnnotatedCode 41 | 42 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetFileContentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetFileContentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get file source 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const source = vsc.getFileContent(path)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param path 25 | * @dependencyExternal fs 26 | * @vscType System 27 | * @returns Promise 28 | */ 29 | export const getFileContent = async ( 30 | path: string, 31 | encoding = 'utf8' 32 | ): Promise => 33 | await fs.readFile(path, encoding)`} 34 | /> 35 | ) 36 | } 37 | 38 | export default GetFileContentAnnotatedCode 39 | 40 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetFullDocumentRangeAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetFullDocumentRangeAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get a vscode.Range for the entire document 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const fullRange = vsc.getFullDocumentRange(document)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param document 25 | * @dependencyExternal vscode 26 | * @vscType Vscode 27 | * @returns boolean 28 | */ 29 | export const getFullDocumentRange = ( 30 | document: vscode.TextDocument 31 | ): vscode.Range => \{ 32 | const startPosition = new vscode.Position(0, 0) 33 | const endPosition = new vscode.Position(document.lineCount, 0) 34 | const fullRange = new vscode.Range(startPosition, endPosition) 35 | return fullRange 36 | }`} 37 | /> 38 | ) 39 | } 40 | 41 | export default GetFullDocumentRangeAnnotatedCode 42 | 43 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetJsonContentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetJsonContentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get file source as json 17 |

18 |

19 | (return null on invalid json) 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const json = await vsc.getJsonContent(path)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param path 28 | * @dependencyExternal fs 29 | * @vscType System 30 | * @returns unknown 31 | */ 32 | export const getJsonContent = async ( 33 | path: string, 34 | throws = false 35 | ): Promise => await fs.readJson(path, \{ throws })`} 36 | /> 37 | ) 38 | } 39 | 40 | export default GetJsonContentAnnotatedCode 41 | 42 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetPackageFilePathsAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetPackageFilePathsAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Find package.json file paths in project. / 17 | Take an optional 'exclude' which is an exclude pattern for the underlying findFilePaths 18 |

19 |

20 | It can be used to control which package.json files should be included. 21 |

22 | 23 | } 24 | 25 | codeOneLineEx={`const packageFilePaths = await vsc.getPackageFilePaths()`} 26 | codeEx={``} 27 | code={`/** 28 | * @dependencyInternal findFilePaths 29 | * @vscType System 30 | * @returns Promise 31 | */ 32 | export const getPackageFilePaths = async ( 33 | exclude = '**/\{node_modules,.vscode-test}/**' 34 | ): Promise => \{ 35 | const packageFiles = await vsc.findFilePaths('**/package.json', exclude) 36 | return packageFiles 37 | }`} 38 | /> 39 | ) 40 | } 41 | 42 | export default GetPackageFilePathsAnnotatedCode 43 | 44 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetRootPackageJsonAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetRootPackageJsonAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get json from package.json in the project root. 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const packageJson = await vsc.getRootPackageJson(rootPath)`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyInternal findFilePaths 25 | * @vscType System 26 | * @returns Promise 27 | */ 28 | export const getRootPackageJson = async ( 29 | rootPath: string 30 | ): Promise => \{ 31 | const packageJsonPath = vsc.joinPaths(rootPath, 'package.json') 32 | const packageJson = await vsc.getJsonContent(packageJsonPath) 33 | return packageJson 34 | }`} 35 | /> 36 | ) 37 | } 38 | 39 | export default GetRootPackageJsonAnnotatedCode 40 | 41 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetRootPathAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const GetRootPathAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Get project root for a path or undefined if no project was found. 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const rootPath = vsc.getRootPath()`} 22 | codeEx={``} 23 | code={`/** 24 | * @param path 25 | * @dependencyExternal vscode 26 | * @dependencyInternal pathAsUnix 27 | * @vscType Vscode 28 | * @returns string | undefined 29 | */ 30 | export const getRootPath = (path: string): string | undefined => \{ 31 | const uri = vscode.Uri.file(path) 32 | const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri) 33 | if (!workspaceFolder) \{ 34 | return undefined 35 | } 36 | let rootPath = workspaceFolder.uri.fsPath 37 | rootPath = vsc.pathAsUnix(rootPath) 38 | return rootPath 39 | }`} 40 | /> 41 | ) 42 | } 43 | 44 | export default GetRootPathAnnotatedCode 45 | 46 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/GetTimeStampAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const GetTimestampAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | return ISO timestamp 21 |

22 | 23 | } 24 | 25 | test={ 26 | { 31 | const res = vsc.getTimestamp() 32 | setResult(res) 33 | }} 34 | /> 35 | } 36 | 37 | codeOneLineEx={`const timestamp = vsc.getTimestamp()`} 38 | codeEx={``} 39 | code={`/** 40 | * @vscType Raw 41 | * @returns string 42 | */ 43 | export const getTimestamp = (): string => \{ 44 | return new Date().toISOString() 45 | }`} 46 | /> 47 | ) 48 | } 49 | 50 | export default GetTimestampAnnotatedCode 51 | 52 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/InsertAtAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const InsertAtAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Insert content at position (start and optional end position) 17 | Return true on success, false if the document or textEditor was not open/correct 18 |

19 | 20 | } 21 | 22 | codeOneLineEx={`const success = vsc.insertAt(content, start, end)`} 23 | codeEx={``} 24 | code={`/** 25 | * @param content,range,editor 26 | * @dependencyExternal vscode 27 | * @vscType Vscode 28 | * @returns boolean 29 | */ 30 | export const insertAt = ( 31 | content: string, 32 | start: number, 33 | end: number = start, 34 | editor?: vscode.TextEditor, 35 | trimSpaces = false 36 | ): boolean => \{ 37 | if (editor === undefined) \{ 38 | editor = vsc.getActiveEditor() 39 | } 40 | if (editor === undefined) \{ 41 | return false 42 | } 43 | const source = editor.document.getText(); 44 | const pos = vsc.createVscodeRangeAndPosition(source, start, end, trimSpaces) 45 | vsc.insertAtRange(content, pos.range, editor) 46 | return true 47 | }`} 48 | /> 49 | ) 50 | } 51 | 52 | export default InsertAtAnnotatedCode 53 | 54 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/IsDirAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const IsDirAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Test is a path is directory 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const isDir = vsc.isDir(path)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param path 25 | * @dependencyExternal fs 26 | * @vscType System 27 | * @returns boolean 28 | */ 29 | export const isDir = (path: string): boolean => \{ 30 | return fs.statSync(path).isDirectory() 31 | }`} 32 | /> 33 | ) 34 | } 35 | 36 | export default IsDirAnnotatedCode 37 | 38 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/JoinPathsAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const JoinPathsAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | Joins to paths. 21 |

22 | 23 | } 24 | 25 | test={ 26 | { 32 | const res = vsc.joinPaths(args.path1, args.path2) 33 | setResult(res) 34 | }} 35 | /> 36 | } 37 | 38 | codeOneLineEx={`const newPath = vsc.joinPaths(path1, path2)`} 39 | codeEx={``} 40 | code={`/** 41 | * @param path1,path2 42 | * @dependencyInternal trimDashes 43 | * @vscType Raw 44 | * @returns string 45 | */ 46 | export const joinPaths = (path1: string, path2: string): string => \{ 47 | path1 = vsc.trimDashes(path1) 48 | path2 = vsc.trimDashes(path2) 49 | const result = path1 + '/' + path2 50 | return result 51 | }`} 52 | /> 53 | ) 54 | } 55 | 56 | export default JoinPathsAnnotatedCode 57 | 58 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/MakeDirAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const MakeDirAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Make a folder 17 |

18 |

19 | See fs docs for mkdir 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.makeDir(path)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param folderPath 28 | * @vscType System 29 | * @dependencyExternal fs 30 | * @returns Promise 31 | */ 32 | export const makeDir = async (folderPath: string): Promise => \{ 33 | try \{ 34 | await fs.mkdir(folderPath) 35 | } catch (e) \{ 36 | throw e 37 | } 38 | }`} 39 | /> 40 | ) 41 | } 42 | 43 | export default MakeDirAnnotatedCode 44 | 45 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/MoveAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const MoveAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Move a file or folder 17 |

18 |

19 | See fs-extra docs for move 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.move(oldPath, newPath)`} 25 | codeEx={``} 26 | code={`/** 27 | * @vscType System 28 | * @dependencyExternal fs 29 | * @returns Promise 30 | */ 31 | export const move = async ( 32 | path: string, 33 | newPath: string, 34 | options?: fs.MoveOptions 35 | ): Promise => \{ 36 | if (options) \{ 37 | await fs.move(path, newPath, options) 38 | } else \{ 39 | await fs.move(path, newPath) 40 | } 41 | }`} 42 | /> 43 | ) 44 | } 45 | 46 | export default MoveAnnotatedCode 47 | 48 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/NewDocumentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const NewDocumentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Open a new document (untitled and not saved). 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const path = vsc.newDocument(content)`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyInternal getActiveDocument 25 | * @vscType Vscode 26 | * @returns Promise 27 | */ 28 | export const newDocument = async ( 29 | content?: string, 30 | language: string = 'typescript' 31 | ): Promise => \{ 32 | const document = await vscode.workspace.openTextDocument(\{ language, content }) 33 | await vscode.window.showTextDocument(document) 34 | return document 35 | }`} 36 | /> 37 | ) 38 | } 39 | 40 | export default NewDocumentAnnotatedCode 41 | 42 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/OpenAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const OpenAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Open a file in vscode. 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const editor = await vc.open(path)`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyExternal vscode 25 | * @vscType Vscode 26 | * @returns Promise 27 | */ 28 | export const open = async ( 29 | path: string, 30 | column?: vscode.ViewColumn | undefined, 31 | preserveFocus?: boolean | undefined 32 | ): Promise => \{ 33 | const uri = vscode.Uri.parse('file:' + path); 34 | try \{ 35 | const doc = await vscode.workspace.openTextDocument(uri); 36 | const editor = await vscode.window.showTextDocument(doc, column, preserveFocus) 37 | return editor 38 | } catch (e) \{ 39 | return undefined 40 | } 41 | }`} 42 | /> 43 | ) 44 | } 45 | 46 | export default OpenAnnotatedCode 47 | 48 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/PathAsUnixAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const PathAsUnixAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | Replace all '\\' with '/' 21 |

22 |

23 | (Convert all path this way to make them system safe - work both on unix/linux/mac and windows) 24 |

25 | 26 | } 27 | 28 | test={ 29 | { 34 | const res = vsc.pathAsUnix(args.path) 35 | setResult(res) 36 | }} 37 | /> 38 | } 39 | 40 | codeOneLineEx={`const safePath = vsc.pathAsUnix(path)`} 41 | codeEx={``} 42 | code={`/** 43 | * @param path 44 | * @vscType Raw 45 | * @returns string 46 | */ 47 | export const pathAsUnix = (path: string): string => \{ 48 | return path.replace(/\\\\/g, '/') 49 | }`} 50 | /> 51 | ) 52 | } 53 | 54 | export default PathAsUnixAnnotatedCode 55 | 56 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/PickAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const PickAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Prompt user for a question with a list of answers 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const answer = await vsc.pick(answers)`} 22 | codeEx={` 23 | const list = ['yes', 'no'] 24 | const answer = await vsc.pick(list)`} 25 | code={`/** 26 | * @param path string[] 27 | * @dependencyExternal vscode 28 | * @vscType Vscode 29 | * @returns Promise 30 | */ 31 | export const pick = async (answerList: string[]): Promise => 32 | await vscode.window.showQuickPick(answerList)`} 33 | /> 34 | ) 35 | } 36 | 37 | export default PickAnnotatedCode 38 | 39 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/PrependLineToDocumentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const PrependLineToDocumentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Prepend new line content in the start of the (open) document 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const success = vsc.prependLineToDocument(content)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param content,document,editor 25 | * @vscType Vscode 26 | * @returns boolean 27 | */ 28 | export const prependLineToDocument = ( 29 | content: string, 30 | editor?: vscode.TextEditor 31 | ): boolean => \{ 32 | return vsc.prependToDocument(content + '\\n', editor) 33 | }`} 34 | /> 35 | ) 36 | } 37 | 38 | export default PrependLineToDocumentAnnotatedCode 39 | 40 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/PrependToDocumentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const PrependToDocumentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Prepend new content in the end of the open document. 17 | Return true on success, false if the document or textEditor was not open/correct 18 |

19 | 20 | } 21 | 22 | codeOneLineEx={`vsc.prependToDocument(editor, document, content)`} 23 | codeEx={``} 24 | code={`/** 25 | * @param content,editor 26 | * @dependencyExternal vscode 27 | * @vscType Vscode 28 | * @returns boolean 29 | */ 30 | export const prependToDocument = ( 31 | content: string, 32 | editor?: vscode.TextEditor 33 | ): boolean => \{ 34 | const startPosition = new vscode.Position(0, 0) 35 | const endPosition = new vscode.Position(0, 0) 36 | const startRange = new vscode.Range(startPosition, endPosition) 37 | return insertAtRange(content, startRange, editor); 38 | }`} 39 | /> 40 | ) 41 | } 42 | 43 | export default PrependToDocumentAnnotatedCode 44 | 45 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/RemoveAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const RemoveAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Remove file/folder 17 |

18 |

19 | See fs-extra docs for remove 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.remove(path)`} 25 | codeEx={``} 26 | code={`/** 27 | * @vscType System 28 | * @dependencyExternal fs 29 | * @returns Promise 30 | */ 31 | export const remove = async (path: string): Promise => \{ 32 | await fs.remove(path) 33 | }`} 34 | /> 35 | ) 36 | } 37 | 38 | export default RemoveAnnotatedCode 39 | 40 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/RenameAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const RenameAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Rename a file or folder 17 |

18 |

19 | See fs docs for rename 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.move(oldPath, newPath)`} 25 | codeEx={``} 26 | code={`/** 27 | * @vscType System 28 | * @dependencyExternal fs 29 | * @returns Promise 30 | */ 31 | export const rename = async ( 32 | path: string, 33 | newPath: string, 34 | ): Promise => \{ 35 | await fs.rename(path, newPath) 36 | }`} 37 | /> 38 | ) 39 | } 40 | 41 | export default RenameAnnotatedCode 42 | 43 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SaveAllAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const SaveAllAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Save All files 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`await vsc.saveAll()`} 22 | codeEx={``} 23 | code={`/** 24 | * @dependencyExternal vscode 25 | * @vscType Vscode 26 | * @returns Promise 27 | */ 28 | export const saveAll = async (): Promise => \{ 29 | await vscode.workspace.saveAll(false) 30 | }`} 31 | /> 32 | ) 33 | } 34 | 35 | export default SaveAllAnnotatedCode 36 | 37 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SaveDocumentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const SaveDocumentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Save active open file. 17 |

18 |

19 | Return true for success, and false if there was no open document 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const success = await vsc.saveDocument(content)`} 25 | codeEx={``} 26 | code={`/** 27 | * @dependencyInternal getActiveDocument 28 | * @vscType Vscode 29 | * @returns Promise 30 | */ 31 | export const saveDocument = async ( 32 | document?: vscode.TextDocument, 33 | ): Promise => \{ 34 | if (!document) \{ 35 | document = vsc.getActiveDocument() 36 | } 37 | if (document) \{ 38 | await document.save() 39 | return true 40 | } 41 | return Promise.resolve(false) 42 | }`} 43 | /> 44 | ) 45 | } 46 | 47 | export default SaveDocumentAnnotatedCode 48 | 49 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SaveFileContentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const SaveFileContentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Save file 17 |

18 |

19 | See fs docs for writeFile 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`await vsc.saveFileContent(path, source)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param path,content 28 | * @vscType System 29 | * @dependencyExternal fs 30 | * @returns Promise 31 | */ 32 | export const saveFileContent = async ( 33 | path: string, 34 | content: string, 35 | options?: fs.WriteFileOptions 36 | ): Promise => \{ 37 | await fs.writeFile(path, content, options) 38 | }`} 39 | /> 40 | ) 41 | } 42 | 43 | export default SaveFileContentAnnotatedCode 44 | 45 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SetDocumentContentAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const SetDocumentContentAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Set current open file's content. 17 |

18 |

19 | Return true if success, and false if there was no active TextEditor or open Document. 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const success = vsc.setDocumentContent(content)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param content,editor 28 | * @dependencyInternal insertAtRange 29 | * @dependencyExternal vscode 30 | * @vscType Vscode 31 | * @returns boolean 32 | */ 33 | export const setDocumentContent = ( 34 | content: string, 35 | editor?: vscode.TextEditor, 36 | ): boolean => \{ 37 | if (editor === undefined) \{ 38 | editor = vsc.getActiveEditor() 39 | } 40 | if (editor === undefined) \{ 41 | return false 42 | } 43 | const fullRange = vsc.getFullDocumentRange(editor.document) 44 | return insertAtRange(content, fullRange, editor); 45 | }`} 46 | /> 47 | ) 48 | } 49 | 50 | export default SetDocumentContentAnnotatedCode 51 | 52 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SetSelectionFromRangeAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const SetSelectionFromRangeAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Set Selection for an TextEditor (Current document) 17 |

18 |

19 | Clear other selections 20 |

21 |

22 | returns true on success 23 |

24 | 25 | } 26 | 27 | codeOneLineEx={`const success = vsc.setSelectionFromRange(range)`} 28 | codeEx={``} 29 | code={`/** 30 | * @param range,editor 31 | * @vscType Vscode 32 | * @returns boolean 33 | */ 34 | export const setSelectionFromRange = ( 35 | range: vscode.Range, 36 | editor?: vscode.TextEditor, 37 | ): boolean => \{ 38 | if (!editor) \{ 39 | editor = vsc.getActiveEditor() 40 | } 41 | if (!editor) \{ 42 | return false; 43 | } 44 | editor.selections = [] // clear selections 45 | editor.selection = new vscode.Selection(range.start, range.end) 46 | return true 47 | }`} 48 | /> 49 | ) 50 | } 51 | 52 | export default SetSelectionFromRangeAnnotatedCode 53 | 54 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SetSelectionsFromRangesAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const SetSelectionsFromRangesAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Set Selections for an TextEditor (Current document) 17 |

18 |

19 | Clear other selections 20 |

21 |

22 | returns true on success 23 |

24 | 25 | } 26 | 27 | codeOneLineEx={`const success = vsc.setSelectionsFromRanges(ranges)`} 28 | codeEx={``} 29 | code={`/** 30 | * @param range,editor 31 | * @vscType Vscode 32 | * @returns boolean 33 | */ 34 | export const setSelectionsFromRanges = ( 35 | range: vscode.Range[], 36 | editor?: vscode.TextEditor, 37 | ): boolean => \{ 38 | if (!editor) \{ 39 | editor = vsc.getActiveEditor() 40 | } 41 | if (!editor) \{ 42 | return false; 43 | } 44 | editor.selections = range.map(range => new vscode.Selection(range.start, range.end)) 45 | return true 46 | }`} 47 | /> 48 | ) 49 | } 50 | 51 | export default SetSelectionsFromRangesAnnotatedCode 52 | 53 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/ShowErrorMessageAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const ShowErrorMessageAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Show error message to user 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`vsc.showErrorMessage(message)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param message 25 | * @dependencyExternal vscode 26 | * @vscType Vscode 27 | * @returns Promise 28 | */ 29 | export const showErrorMessage = async (message: string): Promise => \{ 30 | await vscode.window.showErrorMessage(message) 31 | }`} 32 | /> 33 | ) 34 | } 35 | 36 | export default ShowErrorMessageAnnotatedCode 37 | 38 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/ShowMessageAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const ShowMessageAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Show message to user 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`vsc.showMessage(message)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param message 25 | * @dependencyExternal vscode 26 | * @vscType Vscode 27 | * @returns Promise 28 | */ 29 | export const showMessage = async (message: string): Promise => \{ 30 | await vscode.window.showInformationMessage(message) 31 | }`} 32 | /> 33 | ) 34 | } 35 | 36 | export default ShowMessageAnnotatedCode 37 | 38 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SleepAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const SleepAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | await wrap for setTimeout. 21 |

22 |

23 | Mostly used for debug async. 24 |

25 | 26 | } 27 | 28 | test={ 29 | { 34 | setResult('Start sleep...'+args.ms) 35 | const ms = parseInt(args.ms) 36 | vsc.sleep(ms).then(()=>{ 37 | setResult('Done sleeping') 38 | }) 39 | }} 40 | /> 41 | } 42 | 43 | codeOneLineEx={`await vsc.sleep(2000)`} 44 | codeEx={``} 45 | code={`/** 46 | * @param ms 47 | * @vscType Raw 48 | * @async async 49 | * @returns Promise 50 | */ 51 | export const sleep = async (ms: number): Promise => \{ 52 | return new Promise(resolve => setTimeout(resolve, ms)) 53 | }`} 54 | /> 55 | ) 56 | } 57 | 58 | export default SleepAnnotatedCode 59 | 60 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/SplitPathAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const SplitPathAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | Split filePath into dir and file 21 |

22 | 23 | } 24 | 25 | test={ 26 | { 31 | const res = vsc.splitPath(args.path) 32 | setResult(JSON.stringify(res)) 33 | }} 34 | /> 35 | } 36 | 37 | codeOneLineEx={`const [dir, file] = vsc.splitPath(filePath)`} 38 | codeEx={``} 39 | code={`/** 40 | * @param path 41 | * @dependencyInternal pathAsUnix 42 | * @vscType Raw 43 | * @returns [string, string] 44 | */ 45 | export const splitPath = (path: string): [string, string] => \{ 46 | path = vsc.pathAsUnix(path) 47 | const splits = path.split('/') 48 | const name = splits.pop() || '' 49 | const dir = splits.join('/') 50 | return [dir, name] 51 | }`} 52 | /> 53 | ) 54 | } 55 | 56 | export default SplitPathAnnotatedCode 57 | 58 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/ToJSONStringAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const ToJSONStringAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Stringify an object. 17 |

18 |

19 | Uses JSON.stringify and the circular ref safe replacer (see vsc.getJSONCircularReplacer) 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const objString = vsc.toJSONString(someObject);`} 25 | codeEx={``} 26 | code={`/** 27 | * @param obj,replacer,space 28 | * @vscType Raw 29 | * @debugTool Primary a debugging method. 30 | * @returns string 31 | */ 32 | export const toJSONString = (obj: any, replacer = vsc.getJSONCircularReplacer(), space = 2, maxDepth: number = -1): string => \{ 33 | if (maxDepth >= 0) \{ 34 | let maxDepthObj = vsc.maxDepthReplacer(obj, maxDepth); 35 | return JSON.stringify(maxDepthObj, replacer, space) 36 | } 37 | return JSON.stringify(obj, replacer, space) 38 | }`} 39 | /> 40 | ) 41 | } 42 | 43 | export default ToJSONStringAnnotatedCode 44 | 45 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TrimDashesAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const TrimDashesAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | Remove '/' from start and end of path 21 |

22 | 23 | } 24 | 25 | test={ 26 | { 31 | const res = vsc.trimDashes(args.path) 32 | setResult(res) 33 | }} 34 | /> 35 | } 36 | 37 | codeOneLineEx={`const path = vsc.trimDashes(foundPath)`} 38 | codeEx={``} 39 | code={`/** 40 | * @param path 41 | * @vscType Raw 42 | * @returns string 43 | */ 44 | export const trimDashes = (path: string): string => \{ 45 | return path.replace(/(^\\/|\\/\$)/g, '') 46 | }`} 47 | /> 48 | ) 49 | } 50 | 51 | export default TrimDashesAnnotatedCode 52 | 53 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TrimLeadingDashAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | import * as vsc from '../vsc-base-raw' 6 | 7 | import MethodTest from 'components/MethodTest/MethodTest' 8 | 9 | 10 | const TrimLeadingDashAnnotatedCode = ({ open = false }: {open?: boolean}) => { 11 | return ( 12 | 18 |

19 | 20 | Remove '/' from start of path 21 |

22 | 23 | } 24 | 25 | test={ 26 | { 31 | const res = vsc.trimLeadingDash(args.path) 32 | setResult(res) 33 | }} 34 | /> 35 | } 36 | 37 | codeOneLineEx={`const path = vsc.trimLeadingDash(foundPath)`} 38 | codeEx={``} 39 | code={`/** 40 | * @param path 41 | * @vscType Raw 42 | * @returns string 43 | */ 44 | export const trimLeadingDash = (path: string): string => \{ 45 | return path.replace(/^\\//, '') 46 | }`} 47 | /> 48 | ) 49 | } 50 | 51 | export default TrimLeadingDashAnnotatedCode 52 | 53 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsCreateSourceFileAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsCreateSourceFileAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Create a ts.SourceFile 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const sourceFile = vsc.tsCreateSourceFile(code)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param content,sourceFileName 25 | * @experimental This method can easily change, because ts api is in experimental state. 26 | * @vscType ts 27 | */ 28 | export const tsCreateSourceFile = ( 29 | content: string, 30 | sourceFileName = \`sourcefile_\$\{(new Date().getTime())}\` 31 | ): ts.SourceFile => \{ 32 | let sourceFile = ts.createSourceFile( 33 | sourceFileName, 34 | content, 35 | ts.ScriptTarget.ES2015, 36 | /*setParentNodes */ true 37 | ); 38 | return sourceFile; 39 | }`} 40 | /> 41 | ) 42 | } 43 | 44 | export default TsCreateSourceFileAnnotatedCode 45 | 46 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsDefaultCompilerOptionsAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsDefaultCompilerOptionsAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | vsc-base's internal default ts compiler options 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const compilerOptions = vsc.TsDefaultCompilerOptions`} 22 | codeEx={``} 23 | code={`/** 24 | * @internal internal 25 | * @experimental This method can easily change, because ts api is in experimental state. 26 | * @vscType ts 27 | */ 28 | export const TsDefaultCompilerOptions: Readonly = (\{ 29 | module: ts.ModuleKind.CommonJS, 30 | target: ts.ScriptTarget.ES2016, 31 | libs: ['es6', "esnext", "dom"], 32 | jsx: ts.JsxEmit.React 33 | })`} 34 | /> 35 | ) 36 | } 37 | 38 | export default TsDefaultCompilerOptionsAnnotatedCode 39 | 40 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsGetParsedChildrenAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsGetParsedChildrenAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | ts.Node's getChildren and getChildrenCount uses tokens not parsed nodes. 17 |

18 |

19 | So this method uses ts' forEachChild to collect the parsed nodes. 20 |

21 |

22 | Normally used in custom transformer methods (vsc.tsCreateTransformer) 23 |

24 | 25 | } 26 | 27 | codeOneLineEx={`const children = vsc.tsGetParsedChildren(node)`} 28 | codeEx={``} 29 | code={`/** 30 | * @params node 31 | * @experimental This method can easily change, because ts api is in experimental state. 32 | * @vscType ts 33 | */ 34 | export const tsGetParsedChildren = (node: ts.Node): ts.Node[] => \{ 35 | let children: ts.Node[] = [] 36 | node.forEachChild(c => \{ children.push(c) }); 37 | return children 38 | }`} 39 | /> 40 | ) 41 | } 42 | 43 | export default TsGetParsedChildrenAnnotatedCode 44 | 45 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsHasAncestorAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsHasAncestorAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Test if it has a parent or ancestor (parent's parent) that matches conditions in a callback 17 |

18 |

19 | Using tsFindAncestor 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const hasAncestor = vsc.tsHasAncestor(node, ancestorNodeTestCallback)`} 25 | codeEx={` 26 | // find a function with name 'someCaller' 27 | const hasAncestor = vsc.tsHasAncestor( 28 | node, 29 | (childNode) => vsc.tsIsFunction( 30 | childNode, 31 | \{ 32 | name:/^someCaller\$/ 33 | } 34 | ) 35 | )`} 36 | code={`/** 37 | * @vscType ts 38 | * @returns boolean 39 | */ 40 | export const tsHasAncestor = (node: ts.Node, callback: (ancestor: ts.Node, depth: number) => boolean): boolean => \{ 41 | return !!vsc.tsFindAncestor(node, callback) 42 | }`} 43 | /> 44 | ) 45 | } 46 | 47 | export default TsHasAncestorAnnotatedCode 48 | 49 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsHasChildAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsHasChildAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Test if direct parsedChild that matches conditions in a callback 17 |

18 |

19 | Using tsFind 20 |

21 |

22 | See also tsHasGrandChild 23 |

24 | 25 | } 26 | 27 | codeOneLineEx={`const child = vsc.tsHasChild(node, childNodeTestCallback })`} 28 | codeEx={` 29 | const hasChild = vsc.tsHasChild( 30 | node, 31 | (childNode) => vsc.tsIsVariable( 32 | childNode, 33 | \{ 34 | name:/^varName\$/, 35 | isConst: true 36 | } 37 | ) 38 | )`} 39 | code={`/** 40 | * @vscType ts 41 | * @returns boolean 42 | */ 43 | export const tsHasChild = (node: ts.Node, callback: (child: ts.Node) => boolean): boolean => \{ 44 | return !!vsc.tsFindChild(node, callback); 45 | }`} 46 | /> 47 | ) 48 | } 49 | 50 | export default TsHasChildAnnotatedCode 51 | 52 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsHasGrandChildAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsHasGrandChildAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Test if it has a child or grandChild (child's child) that matches conditions in a callback 17 |

18 |

19 | Using tsFindGrandchild 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const found = vsc.tsFindGrandChild(node, childNodeTestCallback)`} 25 | codeEx={` 26 | // find a variable any where within the parent node, that is a const and has a staring name of: varName 27 | const found = vsc.tsHasGrandChild( 28 | node, 29 | (childNode) => vsc.tsIsVariable( 30 | childNode, 31 | \{ 32 | name:/^varName/, 33 | isConst: true 34 | } 35 | ) 36 | )`} 37 | code={`/** 38 | * @vscType ts 39 | * @returns boolean 40 | */ 41 | export const tsHasGrandChild = (node: ts.Node, callback: (child: ts.Node, depth: number) => boolean): boolean => \{ 42 | return !!vsc.tsFindGrandChild(node, callback); 43 | }`} 44 | /> 45 | ) 46 | } 47 | 48 | export default TsHasGrandChildAnnotatedCode 49 | 50 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsIsIdentifierAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsIsIdentifierAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Test is a node is a variable declaration (node: ts.VariableDeclaration) 17 |

18 |

19 | Uses tsMatchIdentifier 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const isIdentifierNode = vsc.tsIsIdentifier(node, options)`} 25 | codeEx={` 26 | const isIdentifierNode = vsc.tsIsIdentifier( 27 | node, 28 | \{ 29 | name: /^myCaller\$/ 30 | } 31 | )`} 32 | code={`/** 33 | * @vscType ts 34 | * @returns boolean 35 | */ 36 | export const tsIsIdentifier: (node: ts.Node | undefined, options?: \{ 37 | name?: RegExp | string 38 | hasParent?: (parent: ts.Node) => boolean 39 | hasAncestor?: (parent: ts.Node, depth: number) => boolean 40 | hasAncestors?: ((parent: ts.Node, depth: number) => boolean)[] 41 | }) => boolean = (node, options) => \{ 42 | return !!vsc.tsMatchIdentifier(node, options) 43 | }`} 44 | /> 45 | ) 46 | } 47 | 48 | export default TsIsIdentifierAnnotatedCode 49 | 50 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsLoadModuleSourceCodeAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsLoadModuleSourceCodeAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Pre method for tsLoadModule. 17 |

18 |

19 | (This methods load the ts source, transpile it to js and replace all 'require' instance) 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const sourceJs = await vsc.tsLoadModuleSourceCode(path)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param path,compilerOptions,moduleMap default = vsc.getVscDefaultModuleMap() 28 | * @vscType System 29 | * @returns Promise 30 | */ 31 | export const tsLoadModuleSourceCode = async ( 32 | path: string, 33 | compilerOptions: ts.CompilerOptions = vsc.TsDefaultCompilerOptions 34 | ): Promise => \{ 35 | const scriptFileTs = await vsc.getFileContent(path) 36 | let sourceJs = vsc.tsTranspile(scriptFileTs, compilerOptions) 37 | sourceJs = vsc.tsRewriteTranspiledCodeWithVscBaseModules(sourceJs) 38 | return sourceJs 39 | }`} 40 | /> 41 | ) 42 | } 43 | 44 | export default TsLoadModuleSourceCodeAnnotatedCode 45 | 46 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsTransformNodeAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsTransformNodeAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Transform a ts.Node 17 |

18 |

19 | (default node-type is ts.Sourcefile) 20 |

21 | 22 | } 23 | 24 | codeOneLineEx={`const result = vsc.tsTransformNode(sourceFile, transformers, compilerOptions)`} 25 | codeEx={``} 26 | code={`/** 27 | * @param sourceFile,transformers,compilerOptions 28 | * @internal internal 29 | * @experimental This method can easily change, because ts api is in experimental state. 30 | * @vscType ts 31 | */ 32 | export const tsTransformNode = ( 33 | sourceFile: T, 34 | transformers: ts.TransformerFactory[], 35 | compilerOptions: ts.CompilerOptions = vsc.TsDefaultCompilerOptions 36 | ) => \{ 37 | return ts.transform(sourceFile, transformers, compilerOptions) 38 | }`} 39 | /> 40 | ) 41 | } 42 | 43 | export default TsTransformNodeAnnotatedCode 44 | 45 | -------------------------------------------------------------------------------- /vsc-base.org/src/allAnnotations/annotations/TsTranspileAnnotatedCode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AnnotatedCode from 'components/AnnotatedCode/AnnotatedCode' 3 | 4 | 5 | 6 | const TsTranspileAnnotatedCode = ({ open = false }: {open?: boolean}) => { 7 | return ( 8 | 14 |

15 | 16 | Transpile ts source to js 17 |

18 | 19 | } 20 | 21 | codeOneLineEx={`const sourceJs = vsc.tsTranspile(sourceTs)`} 22 | codeEx={``} 23 | code={`/** 24 | * @param sourceTs,compilerOptions 25 | * @vscType System 26 | * @returns string 27 | */ 28 | export const tsTranspile = (sourceTs: string, 29 | compilerOptions: ts.CompilerOptions = vsc.TsDefaultCompilerOptions 30 | ) => \{ 31 | const transpiledOutput = ts.transpileModule(sourceTs, \{ compilerOptions }) 32 | let sourceJs = transpiledOutput.outputText 33 | return sourceJs; 34 | }`} 35 | /> 36 | ) 37 | } 38 | 39 | export default TsTranspileAnnotatedCode 40 | 41 | -------------------------------------------------------------------------------- /vsc-base.org/src/allScripts/AllScripts.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import NameAllScripts from './scripts/NameAllScripts' 4 | import OrganizeImports from './scripts/OrganizeImports' 5 | 6 | interface AllScriptsProps { 7 | activeScript: string 8 | } 9 | 10 | const AllScripts = ({ activeScript }: AllScriptsProps) => ( 11 | <> 12 | 13 | 14 | 15 | ) 16 | 17 | export default AllScripts 18 | -------------------------------------------------------------------------------- /vsc-base.org/src/components/Header/Header.module.scss: -------------------------------------------------------------------------------- 1 | @import 'style/variables.scss'; 2 | 3 | .header { 4 | display: flex; 5 | color: white; 6 | padding-right: 15px; 7 | padding-left: 15px; 8 | background-color: $dark; 9 | justify-content: space-between; 10 | } 11 | 12 | .logo { 13 | display: block; 14 | position: relative; 15 | margin-left: 15px; 16 | background-image: url('~images/logo-white.png'); 17 | background-size: 24px 24px; 18 | background-repeat: no-repeat; 19 | background-position: left 50%; 20 | padding-left: 35px; 21 | font-size: 20px; 22 | letter-spacing: -0.04rem; 23 | color: white; 24 | min-height: 50px; 25 | padding-top: 15px; 26 | line-height: 20px; 27 | } 28 | 29 | .logoNote { 30 | font-size: 12px; 31 | margin-left: 10px; 32 | } 33 | @media only screen and (max-width: 800px) { 34 | .logoNote { 35 | display: none; 36 | } 37 | } 38 | 39 | .mainNav { 40 | display: flex; 41 | margin-top: 5px; 42 | } 43 | .logo a, 44 | .mainNav a { 45 | padding: 10px 15px; 46 | text-align: center; 47 | display: block; 48 | color: #fff; 49 | } 50 | .logo:hover { 51 | color: #ddd !important; 52 | } 53 | 54 | .mainNav a { 55 | font-size: 0.99em; 56 | opacity: 0.6; 57 | transition: opacity 0.08s ease-in; 58 | } 59 | 60 | .mainNav a:hover { 61 | opacity: 1; 62 | } 63 | .github { 64 | background-image: url('~images/github.svg'); 65 | background-size: 18px 18px; 66 | background-repeat: no-repeat; 67 | background-position: left 50%; 68 | padding-left: 20px !important; 69 | } 70 | -------------------------------------------------------------------------------- /vsc-base.org/src/components/Header/Header.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react' 2 | import { NavLink } from 'react-router-dom' 3 | import styles from './Header.module.scss' 4 | 5 | const Header = () => ( 6 |
7 | 8 | vsc-base.org 9 | 10 | 20 |
21 | ) 22 | 23 | export default Header 24 | -------------------------------------------------------------------------------- /vsc-base.org/src/components/HighlightedCode/HighlightedCode.module.scss: -------------------------------------------------------------------------------- 1 | .codeArea { 2 | display: block; 3 | position: relative; 4 | line-height: 25px; 5 | font-size: 10px; 6 | color: #666; 7 | } 8 | .copyArea { 9 | position: absolute; 10 | top: 5px; 11 | right: 10px; 12 | line-height: 25px; 13 | font-size: 10px; 14 | color: #666; 15 | } 16 | 17 | .copy { 18 | font-size: 16px; 19 | cursor: pointer; 20 | color: #666; 21 | } 22 | .copiedLabel { 23 | position: absolute; 24 | right: 25px; 25 | top: 0px; 26 | } 27 | .copy:hover { 28 | color: #999; 29 | } 30 | .code { 31 | font-size: smaller; 32 | overflow: auto; 33 | font-size: 10px !important; 34 | border: 1px solid transparent; 35 | border-radius: 10px; 36 | -webkit-background-clip: padding-box; 37 | -moz-background-clip: padding; 38 | background-clip: padding-box; 39 | } 40 | -------------------------------------------------------------------------------- /vsc-base.org/src/components/HighlightedCode/HighlightedCode.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode, useEffect, useState } from 'react' 2 | import cx from 'classnames' 3 | import Prism from 'prismjs' 4 | //@ts-ignore 5 | import 'prismjs/components/prism-typescript' 6 | 7 | import CopyToClipboard from 'react-copy-to-clipboard' 8 | 9 | import styles from './HighlightedCode.module.scss' 10 | 11 | const HighlightedCode = ({ code, className = '' }: { code: string; className?: string }) => { 12 | const [copyCode, setCopyCode] = useState(false) 13 | useEffect(() => { 14 | Prism.highlightAll() 15 | }, [code]) 16 | const copy = () => { 17 | setCopyCode(true) 18 | setTimeout(() => setCopyCode(false), 2000) 19 | } 20 | return ( 21 |
22 |
23 |             {code}
24 |          
25 |
26 | {copyCode && Copied} 27 | 28 | 29 | 30 |
31 |
32 | ) 33 | } 34 | 35 | export default HighlightedCode 36 | -------------------------------------------------------------------------------- /vsc-base.org/src/components/MethodTest/MethodTest.module.scss: -------------------------------------------------------------------------------- 1 | .wrap { 2 | display: block; 3 | padding: 10px 20px; 4 | } 5 | .headline { 6 | display: block; 7 | text-align: center; 8 | font-size: 12px; 9 | font-weight: bold; 10 | margin-bottom: 0px; 11 | color: #666; 12 | } 13 | .inputWrap { 14 | position: relative; 15 | display: block; 16 | height: 24px; 17 | } 18 | .resetter { 19 | position: absolute; 20 | top: 2px; 21 | right: 2px; 22 | font-size: 10px; 23 | width: 14px; 24 | height: 14px; 25 | border-radius: 100%; 26 | background: rgba(100, 100, 100, 0.1); 27 | text-align: center; 28 | cursor: pointer; 29 | line-height: 14px; 30 | font-family: arial; 31 | } 32 | .resetter:hover { 33 | background: rgba(100, 100, 100, 0.2); 34 | } 35 | 36 | .textfieldLabel { 37 | display: block; 38 | width: 100%; 39 | padding: 3px 0px; 40 | font-weight: bold; 41 | color: #666; 42 | font-size: 12px; 43 | } 44 | .textfield { 45 | display: block; 46 | width: 100%; 47 | padding: 3px 6px; 48 | outline: none; 49 | background: #f6f7f5; 50 | } 51 | 52 | .testResult { 53 | display: block; 54 | padding: 5px; 55 | margin-top: 10px; 56 | background: #e5e8e2; 57 | min-height: 20px; 58 | } 59 | .testResultTitle { 60 | display: block; 61 | font-size: 10px; 62 | color: #999; 63 | } 64 | .testResultBox { 65 | display: block; 66 | font-size: 12px; 67 | padding: 4px; 68 | color: #333; 69 | } 70 | -------------------------------------------------------------------------------- /vsc-base.org/src/components/MethodTestPrinter/MethodTestPrinter.module.scss: -------------------------------------------------------------------------------- 1 | .wrap { 2 | display: block; 3 | padding: 10px 20px; 4 | } 5 | .headline { 6 | display: block; 7 | text-align: center; 8 | font-size: 12px; 9 | font-weight: bold; 10 | margin-bottom: 0px; 11 | color: #666; 12 | } 13 | .inputWrap { 14 | position: relative; 15 | display: block; 16 | height: 24px; 17 | } 18 | .resetter { 19 | position: absolute; 20 | top: 2px; 21 | right: 2px; 22 | font-size: 10px; 23 | width: 14px; 24 | height: 14px; 25 | border-radius: 100%; 26 | background: rgba(100, 100, 100, 0.1); 27 | text-align: center; 28 | cursor: pointer; 29 | line-height: 14px; 30 | font-family: arial; 31 | } 32 | .resetter:hover { 33 | background: rgba(100, 100, 100, 0.2); 34 | } 35 | 36 | .textfieldLabel { 37 | display: block; 38 | width: 100%; 39 | padding: 3px 0px; 40 | font-weight: bold; 41 | color: #666; 42 | font-size: 12px; 43 | } 44 | .textfield { 45 | display: block; 46 | width: 100%; 47 | padding: 3px 6px; 48 | outline: none; 49 | background: #f6f7f5; 50 | } 51 | 52 | .testResult { 53 | display: block; 54 | padding: 5px; 55 | margin-top: 10px; 56 | background: #e5e8e2; 57 | min-height: 20px; 58 | } 59 | .testResultTitle { 60 | display: block; 61 | font-size: 10px; 62 | color: #999; 63 | } 64 | .testResultBox { 65 | display: block; 66 | font-size: 12px; 67 | padding: 4px; 68 | color: #333; 69 | } 70 | -------------------------------------------------------------------------------- /vsc-base.org/src/images/logo-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/src/images/logo-gray.png -------------------------------------------------------------------------------- /vsc-base.org/src/images/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/src/images/logo-white.png -------------------------------------------------------------------------------- /vsc-base.org/src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/src/images/logo.png -------------------------------------------------------------------------------- /vsc-base.org/src/images/logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-base.org/src/images/logo.psd -------------------------------------------------------------------------------- /vsc-base.org/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import 'style/index.scss' 4 | import 'style/prism.css' 5 | import App from 'App/App' 6 | import * as serviceWorker from 'serviceWorker' 7 | import { BrowserRouter } from 'react-router-dom' 8 | 9 | ReactDOM.render( 10 | 11 | 12 | , 13 | document.getElementById('root') 14 | ) 15 | 16 | // If you want your app to work offline and load faster, you can change 17 | // unregister() to register() below. Note this comes with some pitfalls. 18 | // Learn more about service workers: https://bit.ly/CRA-PWA 19 | serviceWorker.unregister() 20 | -------------------------------------------------------------------------------- /vsc-base.org/src/pages/home/Home.module.scss: -------------------------------------------------------------------------------- 1 | @import 'style/variables.scss'; 2 | 3 | input[type='text'] { 4 | border: 0; 5 | padding: 5px; 6 | outline: none; 7 | } 8 | label { 9 | margin-left: 15px; 10 | input { 11 | margin-right: 5px; 12 | } 13 | } 14 | .annotationArea { 15 | min-height: 400px; 16 | } 17 | .logo { 18 | display: block; 19 | position: relative; 20 | margin-left: 0px; 21 | font-size: 20px; 22 | letter-spacing: -0.04rem; 23 | color: 000; 24 | min-height: 50px; 25 | padding-top: 15px; 26 | line-height: 20px; 27 | } 28 | .logoImg { 29 | display: inline-block; 30 | width: 24px; 31 | height: 24px; 32 | filter: brightness(1) invert(1); 33 | background-image: url('~images/logo-white.png'); 34 | background-repeat: no-repeat; 35 | background-size: 24px 24px; 36 | margin-right: 10px; 37 | margin-bottom: -6px; 38 | } 39 | 40 | .logoNote { 41 | font-weight: normal; 42 | font-size: 12px; 43 | margin-left: 10px; 44 | } 45 | 46 | .description { 47 | padding: 30px; 48 | } 49 | 50 | .annotatedCode { 51 | display: block; 52 | background: $dark; 53 | color: #fff; 54 | padding: 10px 30px; 55 | } 56 | 57 | .titleNote { 58 | font-size: 12px; 59 | } 60 | .warning { 61 | background: #f99; 62 | padding: 5px; 63 | margin-bottom: 40px; 64 | } 65 | -------------------------------------------------------------------------------- /vsc-base.org/src/pages/scripts/Scripts.module.scss: -------------------------------------------------------------------------------- 1 | @import 'style/variables.scss'; 2 | 3 | .description { 4 | padding: 30px; 5 | } 6 | 7 | .annotatedCode { 8 | display: block; 9 | background: $dark; 10 | color: #fff; 11 | padding: 10px 30px; 12 | } 13 | 14 | .titleNote { 15 | font-size: 12px; 16 | } 17 | .warning { 18 | background: #f99; 19 | padding: 5px; 20 | margin-bottom: 40px; 21 | } 22 | -------------------------------------------------------------------------------- /vsc-base.org/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /vsc-base.org/src/style/index.scss: -------------------------------------------------------------------------------- 1 | @import './variables.scss'; 2 | 3 | html { 4 | height: 100%; 5 | } 6 | 7 | div#root { 8 | height: 100%; 9 | } 10 | 11 | * { 12 | box-sizing: border-box; 13 | margin: 0; 14 | padding: 0; 15 | border: 0; 16 | font-family: 'Segoe UI', 'Helvetica Neue', 'Helvetica', Arial, sans-serif; 17 | -webkit-font-smoothing: antialiased; 18 | -moz-osx-font-smoothing: grayscale; 19 | } 20 | 21 | body { 22 | height: 100%; 23 | background: $light; 24 | } 25 | 26 | code { 27 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; 28 | } 29 | 30 | ul { 31 | margin: 0; 32 | padding: 0; 33 | list-style: none; 34 | } 35 | h3, 36 | h4 { 37 | margin-top: 20px; 38 | } 39 | 40 | a { 41 | text-decoration: none; 42 | color: #669; 43 | } 44 | a:hover { 45 | color: #88a; 46 | transform: color 0.08s ease-in; 47 | } 48 | 49 | p { 50 | margin: 2px 0 10px 0; 51 | } 52 | -------------------------------------------------------------------------------- /vsc-base.org/src/style/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin noSelect() { 2 | -webkit-touch-callout: none; /* iOS Safari */ 3 | -webkit-user-select: none; /* Safari */ 4 | -khtml-user-select: none; /* Konqueror HTML */ 5 | -moz-user-select: none; /* Firefox */ 6 | -ms-user-select: none; /* Internet Explorer/Edge */ 7 | user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */ 8 | } 9 | -------------------------------------------------------------------------------- /vsc-base.org/src/style/variables.scss: -------------------------------------------------------------------------------- 1 | $dark: #808f85; 2 | $light: #dce0d9; 3 | -------------------------------------------------------------------------------- /vsc-base.org/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "downlevelIteration": true, 11 | "skipLibCheck": true, 12 | "esModuleInterop": true, 13 | "allowSyntheticDefaultImports": true, 14 | "strict": true, 15 | "forceConsistentCasingInFileNames": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "jsx": "preserve", 22 | "rootDirs": [ 23 | "*", 24 | "src" 25 | ] 26 | }, 27 | "include": [ 28 | "src" 29 | ], 30 | "extends": "./tsconfig.paths.json" 31 | } 32 | -------------------------------------------------------------------------------- /vsc-base.org/tsconfig.paths.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "src", 4 | "paths": { 5 | "src/*": ["*"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /vsc-base/README.md: -------------------------------------------------------------------------------- 1 | # vsc-base 2 | 3 | vsc-base as a module that aims to make it easier to create vscode extensions. 4 | 5 | It's also the base for using the [vsc-script extension](https://marketplace.visualstudio.com/items?itemName=alfnielsen.vsc-script) and [vsc-scaffolding extension](https://marketplace.visualstudio.com/items?itemName=alfnielsen.vsc-scaffolding). 6 | 7 | Documentation can be found on [vsc-base.org](http://vsc-base.org) 8 | 9 | Release note can be found on vsc-base's [github wiki](https://github.com/alfnielsen/vsc-base/wiki/Release-notes) 10 | 11 | **WARNING:** 12 | This is still not version 1.0.0, and changes to methods and their names will come before the final first version. 13 | 14 | ## Get started 15 | 16 | ``` 17 | >> npm i vsc-base 18 | ``` 19 | 20 | or 21 | 22 | ``` 23 | >> yarn add vsc-base 24 | ``` 25 | 26 | When you only use vsc-base for vsc-script and/or vsc-scaffolding, you can install it as devDependency instead: 27 | 28 | ``` 29 | >> npm i vsc-base --save-dev 30 | ``` 31 | 32 | or 33 | 34 | ``` 35 | >> yarn add vsc-base -D 36 | ``` 37 | 38 | ## Links 39 | 40 | > vsc-base: [npm-module](https://www.npmjs.com/package/vsc-base) | [source-code](https://github.com/alfnielsen/vsc-base) 41 | 42 | > vsc-base.org: [documentation](http://vsc-base.org) 43 | -------------------------------------------------------------------------------- /vsc-base/out/vsc-base-typescript-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-typescript-base.js","sourceRoot":"","sources":["../src/vsc-base-typescript-base.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAEhC,kCAAiC;AAEjC;;;;;;;;;;GAUG;AACI,MAAM,WAAW,GAAG,CAAC,QAAgB,EACzC,kBAAsC,GAAG,CAAC,wBAAwB,EACnE,EAAE;IACD,MAAM,gBAAgB,GAAG,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,eAAe,EAAE,CAAC,CAAA;IAC1E,IAAI,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAA;IAC1C,OAAO,QAAQ,CAAC;AACnB,CAAC,CAAA;AANY,QAAA,WAAW,eAMvB;AAGD;;;;;;;;;;;;;GAaG;AACI,MAAM,eAAe,GAAG,CAC5B,UAAa,EACb,YAAwC,EACxC,kBAAsC,GAAG,CAAC,wBAAwB,EACnE,EAAE;IACD,OAAO,EAAE,CAAC,SAAS,CAAI,UAAU,EAAE,YAAY,EAAE,eAAe,CAAC,CAAA;AACpE,CAAC,CAAA;AANY,QAAA,eAAe,mBAM3B;AAED;;;;;;;;;GASG;AACU,QAAA,wBAAwB,GAAiC,CAAC;IACpE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ;IAC9B,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;IAC9B,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC;IAC9B,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK;CACvB,CAAC,CAAA;AAEF;;;;;;;;;;GAUG;AACI,MAAM,kBAAkB,GAAG,CAC/B,OAAe,EACf,cAAc,GAAG,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EACzC,EAAE;IAChB,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACjC,cAAc,EACd,OAAO,EACP,EAAE,CAAC,YAAY,CAAC,MAAM;IAC1B,mBAAmB,CAAC,IAAI,CACtB,CAAC;IACF,OAAO,UAAU,CAAC;AACrB,CAAC,CAAA;AAXY,QAAA,kBAAkB,sBAW9B;AAED;;;;;;;;;;;GAWG;AACI,MAAM,mBAAmB,GAAG,CAAC,IAAa,EAAa,EAAE;IAC7D,IAAI,QAAQ,GAAc,EAAE,CAAA;IAC5B,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,QAAQ,CAAA;AAClB,CAAC,CAAA;AAJY,QAAA,mBAAmB,uBAI/B"} -------------------------------------------------------------------------------- /vsc-base/out/vsc-base-vscTemplate.d.ts: -------------------------------------------------------------------------------- 1 | import * as vsc from './vsc-base'; 2 | /** vsc-base method 3 | * @description 4 | * Recursive function that goes through a template tree 5 | * @see [scaffoldTemplate](http://vsc-base.org/#scaffoldTemplate) 6 | * @param path Full path to where the TemplateItem (file/folder) should be created 7 | * @param userInputs An object with user inputs {[key: string]: string} 8 | * @param templateItem An TemplateItem (folde/file) 9 | * @dependencyInternal makeDir, saveFileContent 10 | * @vscType System 11 | * @example 12 | * await vsc.scaffoldTemplate(path, template) 13 | * @returns Promise 14 | */ 15 | export declare const scaffoldTemplate: (path: string, templateItem: vsc.vscTemplateItem, userInputs?: vsc.vscUserInputs) => Promise; 16 | export declare type vscTemplate = { 17 | userInputs: vscUserInput[]; 18 | template: vscTemplateItem[]; 19 | }; 20 | export declare type vscTemplateItem = vscTemplateFolder | vscTemplateFile; 21 | export declare type vscTemplateFolder = { 22 | type: 'folder'; 23 | name: vscStringDelegate; 24 | children?: vscTemplateItem[]; 25 | }; 26 | export declare type vscTemplateFile = { 27 | type: 'file'; 28 | name: vscStringDelegate; 29 | content: vscStringDelegate; 30 | }; 31 | export declare type vscUserInput = { 32 | title: string; 33 | argumentName: string; 34 | defaultValue: string; 35 | }; 36 | export declare type vscUserInputs = { 37 | [key: string]: string; 38 | }; 39 | export declare type vscStringDelegate = string | ((inputs: vscUserInputs) => string); 40 | -------------------------------------------------------------------------------- /vsc-base/out/vsc-base-vscTemplate.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-vscTemplate.js","sourceRoot":"","sources":["../src/vsc-base-vscTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kCAAiC;AAEjC;;;;;;;;;;;;GAYG;AACI,MAAM,gBAAgB,GAAG,CAC7B,IAAY,EACZ,YAAiC,EACjC,aAAgC,EAAE,EACpB,EAAE;IAChB,QAAQ,YAAY,CAAC,IAAI,EAAE;QACxB,KAAK,QAAQ,CAAC,CAAC;YACZ,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;YAC5B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aACpC;YACD,MAAM,UAAU,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAA;YACpC,MAAM,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;YAC7B,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;gBACzB,MAAK;aACP;YACD,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAO,SAAc,EAAE,EAAE;gBACpD,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;YAC1D,CAAC,CAAA,CAAC,CAAA;YACF,MAAK;SACP;QACD,KAAK,MAAM,CAAC,CAAC;YACV,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;YAC5B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aACpC;YACD,MAAM,QAAQ,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAA;YAClC,IAAI,OAAO,GAAG,YAAY,CAAC,OAAO,CAAA;YAClC,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;gBAChC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aAC1C;YACD,MAAM,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;SAC9C;KACH;AACJ,CAAC,CAAA,CAAA;AAlCY,QAAA,gBAAgB,oBAkC5B"} -------------------------------------------------------------------------------- /vsc-base/out/vsc-base.d.ts: -------------------------------------------------------------------------------- 1 | export * from './vsc-base-raw'; 2 | export * from './vsc-base-vscode'; 3 | export * from './vsc-base-vscode-webview'; 4 | export * from './vsc-base-system'; 5 | export * from './vsc-base-typescript-base'; 6 | export * from './vsc-base-typescript-match'; 7 | export * from './vsc-base-typescript-transform'; 8 | export * from './vsc-base-typescript-top-level-transform'; 9 | export * from './vsc-base-typescript-module-load'; 10 | export * from './vsc-base-vscTemplate'; 11 | -------------------------------------------------------------------------------- /vsc-base/out/vsc-base.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); 5 | }) : (function(o, m, k, k2) { 6 | if (k2 === undefined) k2 = k; 7 | o[k2] = m[k]; 8 | })); 9 | var __exportStar = (this && this.__exportStar) || function(m, exports) { 10 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 11 | }; 12 | Object.defineProperty(exports, "__esModule", { value: true }); 13 | __exportStar(require("./vsc-base-raw"), exports); 14 | __exportStar(require("./vsc-base-vscode"), exports); 15 | __exportStar(require("./vsc-base-vscode-webview"), exports); 16 | __exportStar(require("./vsc-base-system"), exports); 17 | __exportStar(require("./vsc-base-typescript-base"), exports); 18 | __exportStar(require("./vsc-base-typescript-match"), exports); 19 | __exportStar(require("./vsc-base-typescript-transform"), exports); 20 | __exportStar(require("./vsc-base-typescript-top-level-transform"), exports); 21 | __exportStar(require("./vsc-base-typescript-module-load"), exports); 22 | __exportStar(require("./vsc-base-vscTemplate"), exports); 23 | //# sourceMappingURL=vsc-base.js.map -------------------------------------------------------------------------------- /vsc-base/out/vsc-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base.js","sourceRoot":"","sources":["../src/vsc-base.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iDAA8B;AAC9B,oDAAiC;AACjC,4DAA0C;AAC1C,oDAAkC;AAClC,6DAA2C;AAC3C,8DAA4C;AAC5C,kEAAgD;AAChD,4EAA0D;AAC1D,oEAAkD;AAClD,yDAAuC"} -------------------------------------------------------------------------------- /vsc-base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vsc-base", 3 | "version": "0.9.11", 4 | "description": "Base for vsc-script and other vscode extensions", 5 | "publisher": "alfnielsen", 6 | "main": "out/vsc-base.js", 7 | "scripts": { 8 | "build": "tsc --declaration" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/alfnielsen/vsc-base.git" 13 | }, 14 | "keywords": [ 15 | "vscode" 16 | ], 17 | "author": "Alf Nielsen ", 18 | "license": "GPL-3.0-or-later", 19 | "bugs": { 20 | "url": "https://github.com/alfnielsen/vsc-base/issues" 21 | }, 22 | "homepage": "https://github.com/alfnielsen/vsc-base#readme", 23 | "dependencies": { 24 | "@types/child-process-promise": "^2.2.2", 25 | "@types/fs-extra": "^8.1.0", 26 | "child-process-promise": "^2.2.1", 27 | "fs-extra": "^8.1.0", 28 | "typescript": "^4.3.5" 29 | }, 30 | "devDependencies": { 31 | "@types/vscode": "^1.58.1", 32 | "tslint": "^5.20.1" 33 | }, 34 | "typings": "out/vsc-base.d.ts" 35 | } 36 | -------------------------------------------------------------------------------- /vsc-base/src/vsc-base.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from './vsc-base-raw' 3 | export * from './vsc-base-vscode' 4 | export * from './vsc-base-vscode-webview'; 5 | export * from './vsc-base-system'; 6 | export * from './vsc-base-typescript-base'; 7 | export * from './vsc-base-typescript-match'; 8 | export * from './vsc-base-typescript-transform'; 9 | export * from './vsc-base-typescript-top-level-transform'; 10 | export * from './vsc-base-typescript-module-load'; 11 | export * from './vsc-base-vscTemplate'; -------------------------------------------------------------------------------- /vsc-base/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": ["es6"], 7 | "sourceMap": true, 8 | "rootDir": "src", 9 | "strict": true /* enable all strict type-checking options */ 10 | /* Additional Checks */ 11 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 12 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 13 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 14 | }, 15 | "includes": "src/*", 16 | "exclude": ["node_modules", ".vscode-test"] 17 | } 18 | -------------------------------------------------------------------------------- /vsc-base/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [false, "always"], 9 | "triple-equals": true 10 | }, 11 | "defaultSeverity": "warning" 12 | } 13 | -------------------------------------------------------------------------------- /vsc-organize-imports/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "ms-vscode.vscode-typescript-tslint-plugin" 6 | ] 7 | } -------------------------------------------------------------------------------- /vsc-organize-imports/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [{ 8 | "name": "Run Extension", 9 | "type": "extensionHost", 10 | "request": "launch", 11 | "runtimeExecutable": "${execPath}", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "npm: watch" 19 | }, 20 | { 21 | "name": "Extension Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "runtimeExecutable": "${execPath}", 25 | "args": [ 26 | "--extensionDevelopmentPath=${workspaceFolder}", 27 | "--extensionTestsPath=${workspaceFolder}/out/test" 28 | ], 29 | "outFiles": [ 30 | "${workspaceFolder}/out/test/**/*.js" 31 | ], 32 | "preLaunchTask": "npm: watch" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /vsc-organize-imports/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /vsc-organize-imports/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /vsc-organize-imports/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/tslint.json 9 | **/*.map 10 | **/*.ts -------------------------------------------------------------------------------- /vsc-organize-imports/images/vsc-scaffolding.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-organize-imports/images/vsc-scaffolding.gif -------------------------------------------------------------------------------- /vsc-organize-imports/out/CleanCode.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"CleanCode.js","sourceRoot":"","sources":["../src/CleanCode.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;;;;AACZ,gCAA+B;AAE/B,wDAAoD;AAEpD,MAAqB,SAAS;IAC3B,SAAS,CAAI,QAAgB,EAAE,YAAe;QAC3C,OAAO,GAAG,CAAC,SAAS,CAAC,oBAAoB,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;IACrE,CAAC;IACK,GAAG,CAAC,GAAgB;;YACvB,IAAI,CAAC,GAAG,EAAE;gBACP,OAAM;aACR;YACD,MAAM,OAAO,GAAG,GAAG,CAAC,kBAAkB,EAAE,CAAC;YACzC,IAAI,CAAC,OAAO,EAAE;gBACX,OAAM;aACR;YACD,gBAAgB;YAChB,MAAM,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAA;YACjF,MAAM,yBAAW,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAA;QAEvD,CAAC;KAAA;CACH;AAjBD,4BAiBC"} -------------------------------------------------------------------------------- /vsc-organize-imports/out/OrganizeImports.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"OrganizeImports.js","sourceRoot":"","sources":["../src/OrganizeImports.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;;;;;AACZ,gCAA+B;AAG/B,+CAA+D;AAE/D,MAAqB,eAAe;IACjC,SAAS,CAAI,QAAgB,EAAE,YAAe;QAC3C,OAAO,GAAG,CAAC,SAAS,CAAC,oBAAoB,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;IACrE,CAAC;IACK,GAAG,CAAC,OAA2B,EAAE,GAAgB;;YACpD,qBAAqB;YACrB,IAAI,CAAC,GAAG,EAAE;gBACP,OAAM;aACR;YAED,MAAM,OAAO,GAAG,GAAG,CAAC,kBAAkB,EAAE,CAAA;YACxC,IAAI,CAAC,OAAO,EAAE;gBACX,OAAM;aACR;YACD,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAEvC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YACtC,IAAI,CAAC,QAAQ,EAAE;gBACZ,OAAM;aACR;YAED,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;YAE3D,MAAM,yBAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YACzC,sBAAsB;YACtB,qBAAqB;YACrB,qEAAqE;QACxE,CAAC;KAAA;CACH;AA5BD,kCA4BC"} -------------------------------------------------------------------------------- /vsc-organize-imports/out/TemplateTypes.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=TemplateTypes.js.map -------------------------------------------------------------------------------- /vsc-organize-imports/out/TemplateTypes.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"TemplateTypes.js","sourceRoot":"","sources":["../src/TemplateTypes.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /vsc-organize-imports/out/test/extension.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // // 3 | // // Note: This example test is leveraging the Mocha test framework. 4 | // // Please refer to their documentation on https://mochajs.org/ for help. 5 | // // 6 | // // The module 'assert' provides assertion methods from node 7 | // import * as assert from 'assert'; 8 | // // You can import and use all API from the 'vscode' module 9 | // // as well as import your extension to test it 10 | // // import * as vscode from 'vscode'; 11 | // // import * as myExtension from '../extension'; 12 | // // Defines a Mocha test suite to group tests of similar kind together 13 | // suite("Extension Tests", function () { 14 | // // Defines a Mocha unit test 15 | // test("Something 1", function() { 16 | // assert.equal(-1, [1, 2, 3].indexOf(5)); 17 | // assert.equal(-1, [1, 2, 3].indexOf(0)); 18 | // }); 19 | // }); 20 | //# sourceMappingURL=extension.test.js.map -------------------------------------------------------------------------------- /vsc-organize-imports/out/test/extension.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.test.js","sourceRoot":"","sources":["../../src/test/extension.test.ts"],"names":[],"mappings":";AAAA,KAAK;AACL,qEAAqE;AACrE,2EAA2E;AAC3E,KAAK;AAEL,8DAA8D;AAC9D,oCAAoC;AAEpC,6DAA6D;AAC7D,iDAAiD;AACjD,uCAAuC;AACvC,kDAAkD;AAElD,wEAAwE;AACxE,yCAAyC;AAEzC,mCAAmC;AACnC,uCAAuC;AACvC,kDAAkD;AAClD,kDAAkD;AAClD,UAAU;AACV,MAAM"} -------------------------------------------------------------------------------- /vsc-organize-imports/out/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // 3 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 4 | // 5 | // This file is providing the test runner to use when running extension tests. 6 | // By default the test runner in use is Mocha based. 7 | // 8 | // You can provide your own test runner if you want to override it by exporting 9 | // a function run(testsRoot: string, clb: (error: Error, failures?: number) => void): void 10 | // that the extension host can call to run the tests. The test runner is expected to use console.log 11 | // to report the results back to the caller. When the tests are finished, return 12 | // a possible error to the callback or null if none. 13 | Object.defineProperty(exports, "__esModule", { value: true }); 14 | const testRunner = require("vscode/lib/testrunner"); 15 | // You can directly control Mocha options by configuring the test runner below 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options 17 | // for more info 18 | testRunner.configure({ 19 | ui: 'tdd', 20 | useColors: true // colored output from test results 21 | }); 22 | module.exports = testRunner; 23 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /vsc-organize-imports/out/test/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,0FAA0F;AAC1F,oGAAoG;AACpG,gFAAgF;AAChF,oDAAoD;;AAEpD,oDAAoD;AAEpD,8EAA8E;AAC9E,qFAAqF;AACrF,gBAAgB;AAChB,UAAU,CAAC,SAAS,CAAC;IACjB,EAAE,EAAE,KAAK;IACT,SAAS,EAAE,IAAI,CAAC,mCAAmC;CACtD,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"} -------------------------------------------------------------------------------- /vsc-organize-imports/src/OrganizeImports.ts: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | import * as vsc from 'vsc-base' 3 | import * as vscode from 'vscode' 4 | 5 | import { SortImports, SortImportsOptions } from './SortImports' 6 | 7 | export default class OrganizeImports { 8 | getConfig(property: string, defaultValue: T): T { 9 | return vsc.getConfig('vscOrganizeImports', property, defaultValue) 10 | } 11 | async run(options: SortImportsOptions, uri?: vscode.Uri) { 12 | //var t0 = Date.now() 13 | if (!uri) { 14 | return 15 | } 16 | 17 | const content = vsc.getDocumentContent() 18 | if (!content) { 19 | return 20 | } 21 | const path = vsc.pathAsUnix(uri.fsPath) 22 | 23 | const rootPath = vsc.getRootPath(path) 24 | if (!rootPath) { 25 | return 26 | } 27 | 28 | options.basePath = vsc.joinPaths(rootPath, options.baseUrl) 29 | 30 | await SortImports(path, content, options) 31 | // var t1 = Date.now() 32 | // var time = t1 - t0 33 | // console.log('Call to doSomething took ' + time + ' milliseconds.') 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vsc-organize-imports/src/examples.json: -------------------------------------------------------------------------------- 1 | { 2 | "standard": { 3 | "vsc-organize-imports": { 4 | "orderSpecifiers": true, 5 | "orderSpecifiersAsSingleLine": true, 6 | "baseUrl": "src", 7 | "emptyLinesAfterImports": 1, 8 | "emptyLinesBetweenFilledGroups": 1, 9 | "groups": [ 10 | { 11 | "groups": ["global"], 12 | "sortBy": "path", 13 | "emptyLines": true 14 | }, 15 | { 16 | "groups": ["absolute"], 17 | "sortBy": "path", 18 | "emptyLines": true 19 | }, 20 | { 21 | "groups": ["relative"], 22 | "sortBy": "path", 23 | "emptyLines": true 24 | }, 25 | { 26 | "groups": ["globalDirect", "absoluteDirect", "relativeDirect"], 27 | "sortBy": "path", 28 | "emptyLines": true 29 | } 30 | ] 31 | } 32 | }, 33 | "one-group-single-line-no-sort": { 34 | "vsc-organize-imports": { 35 | "orderSpecifiers": true, 36 | "orderSpecifiersAsSingleLine": true, 37 | "baseUrl": "src", 38 | "emptyLinesAfterImports": 1, 39 | "emptyLinesBetweenFilledGroups": 1, 40 | "groups": [ 41 | { 42 | "groups": [ 43 | "global", 44 | "absolute", 45 | "relative", 46 | "globalDirect", 47 | "absoluteDirect", 48 | "relativeDirect" 49 | ], 50 | "sortBy": "none", 51 | "emptyLines": true 52 | } 53 | ] 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vsc-organize-imports/src/temp.vsc-tempate.js: -------------------------------------------------------------------------------- 1 | (function Template(){ 2 | const camelize = str => str.replace(/\W+(.)/g, (_match, chr) => chr.toUpperCase()) 3 | return { 4 | userInputs: [ 5 | { 6 | title: 'What is the Component Name', 7 | argumentName: 'name', // will become input in template 8 | defaultValue: 'test' 9 | } 10 | ], 11 | template: [ 12 | { 13 | type: 'folder', 14 | name: inputs => `${camelize(inputs.name)}Component`, 15 | children: [ 16 | { 17 | type: 'file', 18 | name: inputs => `${camelize(inputs.name)}.js`, 19 | content: inputs => `import React from 'react' 20 | 21 | const ${camelize(inputs.name)} = ({ value }}) => ( 22 |
{value}
23 | ) 24 | 25 | export default ${camelize(inputs.name)} 26 | ` 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | }) 33 | -------------------------------------------------------------------------------- /vsc-organize-imports/src/test/extension.test.ts: -------------------------------------------------------------------------------- 1 | // // 2 | // // Note: This example test is leveraging the Mocha test framework. 3 | // // Please refer to their documentation on https://mochajs.org/ for help. 4 | // // 5 | 6 | // // The module 'assert' provides assertion methods from node 7 | // import * as assert from 'assert'; 8 | 9 | // // You can import and use all API from the 'vscode' module 10 | // // as well as import your extension to test it 11 | // // import * as vscode from 'vscode'; 12 | // // import * as myExtension from '../extension'; 13 | 14 | // // Defines a Mocha test suite to group tests of similar kind together 15 | // suite("Extension Tests", function () { 16 | 17 | // // Defines a Mocha unit test 18 | // test("Something 1", function() { 19 | // assert.equal(-1, [1, 2, 3].indexOf(5)); 20 | // assert.equal(-1, [1, 2, 3].indexOf(0)); 21 | // }); 22 | // }); 23 | -------------------------------------------------------------------------------- /vsc-organize-imports/src/test/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testsRoot: string, clb: (error: Error, failures?: number) => void): void 9 | // that the extension host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | import * as testRunner from 'vscode/lib/testrunner'; 14 | 15 | // You can directly control Mocha options by configuring the test runner below 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options 17 | // for more info 18 | testRunner.configure({ 19 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) 20 | useColors: true // colored output from test results 21 | }); 22 | 23 | module.exports = testRunner; -------------------------------------------------------------------------------- /vsc-organize-imports/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "strict": true /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | }, 17 | "exclude": [ 18 | "node_modules", 19 | ".vscode-test" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /vsc-organize-imports/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [false, "always"], 9 | "triple-equals": true 10 | }, 11 | "defaultSeverity": "warning" 12 | } 13 | -------------------------------------------------------------------------------- /vsc-organize-imports/vsc-base-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-organize-imports/vsc-base-icon.png -------------------------------------------------------------------------------- /vsc-organize-imports/vsc-organize-imports-0.1.9.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-organize-imports/vsc-organize-imports-0.1.9.vsix -------------------------------------------------------------------------------- /vsc-rename-files/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "ms-vscode.vscode-typescript-tslint-plugin" 6 | ] 7 | } -------------------------------------------------------------------------------- /vsc-rename-files/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [{ 8 | "name": "Run Extension", 9 | "type": "extensionHost", 10 | "request": "launch", 11 | "runtimeExecutable": "${execPath}", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "npm: watch" 19 | }, 20 | { 21 | "name": "Extension Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "runtimeExecutable": "${execPath}", 25 | "args": [ 26 | "--extensionDevelopmentPath=${workspaceFolder}", 27 | "--extensionTestsPath=${workspaceFolder}/out/test" 28 | ], 29 | "outFiles": [ 30 | "${workspaceFolder}/out/test/**/*.js" 31 | ], 32 | "preLaunchTask": "npm: watch" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /vsc-rename-files/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /vsc-rename-files/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /vsc-rename-files/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/tslint.json 9 | **/*.map 10 | **/*.ts -------------------------------------------------------------------------------- /vsc-rename-files/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 2.1.1 4 | 5 | Update README (By @robertwayne) 6 | 7 | ## 2.1.0 8 | 9 | Add better interface 10 | - you can now see clearly see: before, whats changed and new name 11 | - files and folders count (how many folders/files will be changed) 12 | - added a html select for settings on what to rename: files, folder or both 13 | 14 | Add casing modifiers for output like in vscode: \u\U\l\L for captured groups 15 | 16 | ## 2.0.0 17 | 18 | Create new version using veb-view. 19 | 20 | more settings has been added, 21 | and review of what will be renamed. 22 | 23 | You can now rename folders as well. 24 | More settings for using index (\$idnex). 25 | 26 | The preview will show if rename cause some name, 27 | and default option for adding index in when this appends. 28 | 29 | ## 1.0.0 30 | 31 | Clone extension code from vsc-scaffolding. 32 | Rename and change logic to rename files in the currently clicked folder. 33 | -------------------------------------------------------------------------------- /vsc-rename-files/out/extension.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;AAAA,gCAA+B;AAC/B,iCAAgC;AAEhC,+CAAuC;AAEvC,8EAA8E;AAC9E,yDAAyD;AACzD,0EAA0E;AAC1E,SAAgB,QAAQ,CAAC,OAAgC;IACtD,4FAA4F;IAC5F,gFAAgF;IAChF,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAA;IAEhF,wDAAwD;IACxD,qEAAqE;IACrE,uEAAuE;IAEvE,MAAM,WAAW,GAAG,IAAI,qBAAW,EAAE,CAAA;IAErC,IAAI,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAC7C,0BAA0B,EAC1B,CAAC,GAAgB,EAAE,IAAmB,EAAE,EAAE;QACvC,GAAG,CAAC,WAAW,CAAC,EAAE,GAAG,GAAG,CAAC,CAAA;QACzB,IAAI,CAAC,GAAG,EAAE;YACP,GAAG,CAAC,gBAAgB,CACjB,kEAAkE,CACpE,CAAA;YACD,OAAM;SACR;QACD,MAAM,YAAY,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC/C,WAAW,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC,CACH,CAAA;IAED,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACzC,CAAC;AA3BD,4BA2BC;AAED,2DAA2D;AAC3D,SAAgB,UAAU,KAAK,CAAC;AAAhC,gCAAgC"} -------------------------------------------------------------------------------- /vsc-rename-files/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "strict": true /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | }, 17 | "exclude": [ 18 | "node_modules", 19 | ".vscode-test" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /vsc-rename-files/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [false, "always"], 9 | "triple-equals": true 10 | }, 11 | "defaultSeverity": "warning" 12 | } 13 | -------------------------------------------------------------------------------- /vsc-rename-files/vsc-base-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-rename-files/vsc-base-icon.png -------------------------------------------------------------------------------- /vsc-rename-files/vsc-rename-files-2.1.1.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-rename-files/vsc-rename-files-2.1.1.vsix -------------------------------------------------------------------------------- /vsc-scaffolding/.vsc-templates/Component.vsc-template.js: -------------------------------------------------------------------------------- 1 | //vsc-template-name: Script >Js Script Component 2 | (function Template() { 3 | const camelize = str => 4 | str.replace(/\W+(.)/g, (_match, chr) => chr.toUpperCase()) 5 | const dash = str => 6 | str[0].toLowerCase() + 7 | str 8 | .substr(1) 9 | .replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`) 10 | return { 11 | userInputs: [ 12 | { 13 | title: 'What is the Component Name', 14 | argumentName: 'name', // will become input in template 15 | defaultValue: 'test' 16 | } 17 | ], 18 | template: [ 19 | { 20 | type: 'folder', 21 | name: inputs => `${camelize(inputs.name)}Component`, 22 | children: [ 23 | { 24 | type: 'file', 25 | name: inputs => `${camelize(inputs.name)}.js`, 26 | content: inputs => `import React from 'react' 27 | 28 | const ${camelize(inputs.name)} = ({ value }) => ( 29 |
{value}
30 | ) 31 | 32 | export default ${camelize(inputs.name)} 33 | ` 34 | }, 35 | { 36 | type: 'file', 37 | name: inputs => `${camelize(inputs.name)}.css`, 38 | content: inputs => ` 39 | .${dash(inputs.name)} { 40 | display: block; 41 | } 42 | ` 43 | } 44 | ] 45 | } 46 | ] 47 | } 48 | }) 49 | -------------------------------------------------------------------------------- /vsc-scaffolding/.vsc-templates/ComponentTSPath.vsc-template.ts: -------------------------------------------------------------------------------- 1 | import * as vsc from 'vsc-base' 2 | 3 | //vsc-template-name:Script > Ts Script Component 4 | 5 | export function Template(path: string, templatePath: string): vsc.vscTemplate { 6 | return { 7 | userInputs: [ 8 | { 9 | title: 'What is the Component Name', 10 | argumentName: 'name', // will become input in template 11 | defaultValue: 'test' 12 | } 13 | ], 14 | template: [ 15 | { 16 | type: 'folder', 17 | name: inputs => `${vsc.toPascalCase(inputs.name)}Component`, 18 | children: [ 19 | { 20 | type: 'file', 21 | name: inputs => `${vsc.toPascalCase(inputs.name)}.js`, 22 | content: inputs => `import React from 'react' 23 | //path: ${path} 24 | //templatePath: ${templatePath} 25 | const ${vsc.toPascalCase(inputs.name)} = ({ value }) => ( 26 |
{value}
27 | ) 28 | 29 | export default ${vsc.toPascalCase(inputs.name)} 30 | ` 31 | }, 32 | { 33 | type: 'file', 34 | name: inputs => `${vsc.toPascalCase(inputs.name)}.css`, 35 | content: inputs => ` 36 | .${vsc.toKebabCase(inputs.name)} { 37 | display: block; 38 | } 39 | ` 40 | } 41 | ] 42 | } 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vsc-scaffolding/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "ms-vscode.vscode-typescript-tslint-plugin" 6 | ] 7 | } -------------------------------------------------------------------------------- /vsc-scaffolding/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [{ 8 | "name": "Run Extension", 9 | "type": "extensionHost", 10 | "request": "launch", 11 | "runtimeExecutable": "${execPath}", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "npm: watch" 19 | }, 20 | { 21 | "name": "Extension Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "runtimeExecutable": "${execPath}", 25 | "args": [ 26 | "--extensionDevelopmentPath=${workspaceFolder}", 27 | "--extensionTestsPath=${workspaceFolder}/out/test" 28 | ], 29 | "outFiles": [ 30 | "${workspaceFolder}/out/test/**/*.js" 31 | ], 32 | "preLaunchTask": "npm: watch" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /vsc-scaffolding/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /vsc-scaffolding/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /vsc-scaffolding/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/tslint.json 9 | **/*.map 10 | **/*.ts -------------------------------------------------------------------------------- /vsc-scaffolding/images/vsc-scaffolding.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-scaffolding/images/vsc-scaffolding.gif -------------------------------------------------------------------------------- /vsc-scaffolding/out/TemplateTypes.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=TemplateTypes.js.map -------------------------------------------------------------------------------- /vsc-scaffolding/out/TemplateTypes.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"TemplateTypes.js","sourceRoot":"","sources":["../src/TemplateTypes.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /vsc-scaffolding/out/extension.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // The module 'vscode' contains the VS Code extensibility API 4 | const vscode = require("vscode"); 5 | const Scaffolding_1 = require("./Scaffolding"); 6 | // Import the module and reference it with the alias vscode in your code below 7 | // this method is called when your extension is activated 8 | // your extension is activated the very first time the command is executed 9 | function activate(context) { 10 | // Use the console to output diagnostic information (console.log) and errors (console.error) 11 | // This line of code will only be executed once when your extension is activated 12 | console.log('Congratulations, your extension "vsc-scaffolding" is now active!'); 13 | // The command has been defined in the package.json file 14 | // Now provide the implementation of the command with registerCommand 15 | // The commandId parameter must match the command field in package.json 16 | const scaffolding = new Scaffolding_1.default(); 17 | let disposable = vscode.commands.registerCommand('extension.vscScaffolding', (uri, uris) => { 18 | scaffolding.createTemplate(uri); 19 | }); 20 | context.subscriptions.push(disposable); 21 | } 22 | exports.activate = activate; 23 | // this method is called when your extension is deactivated 24 | function deactivate() { } 25 | exports.deactivate = deactivate; 26 | //# sourceMappingURL=extension.js.map -------------------------------------------------------------------------------- /vsc-scaffolding/out/extension.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;AAAA,6DAA6D;AAC7D,iCAAgC;AAEhC,+CAAuC;AAEvC,8EAA8E;AAC9E,yDAAyD;AACzD,0EAA0E;AAC1E,SAAgB,QAAQ,CAAC,OAAgC;IACxD,4FAA4F;IAC5F,gFAAgF;IAChF,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAA;IAE/E,wDAAwD;IACxD,qEAAqE;IACrE,uEAAuE;IAEvE,MAAM,WAAW,GAAG,IAAI,qBAAW,EAAE,CAAA;IAErC,IAAI,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAC/C,0BAA0B,EAC1B,CAAC,GAAgB,EAAE,IAAmB,EAAE,EAAE;QACzC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC,CACD,CAAA;IAED,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACvC,CAAC;AAnBD,4BAmBC;AAED,2DAA2D;AAC3D,SAAgB,UAAU,KAAI,CAAC;AAA/B,gCAA+B"} -------------------------------------------------------------------------------- /vsc-scaffolding/out/test/extension.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // // 3 | // // Note: This example test is leveraging the Mocha test framework. 4 | // // Please refer to their documentation on https://mochajs.org/ for help. 5 | // // 6 | // // The module 'assert' provides assertion methods from node 7 | // import * as assert from 'assert'; 8 | // // You can import and use all API from the 'vscode' module 9 | // // as well as import your extension to test it 10 | // // import * as vscode from 'vscode'; 11 | // // import * as myExtension from '../extension'; 12 | // // Defines a Mocha test suite to group tests of similar kind together 13 | // suite("Extension Tests", function () { 14 | // // Defines a Mocha unit test 15 | // test("Something 1", function() { 16 | // assert.equal(-1, [1, 2, 3].indexOf(5)); 17 | // assert.equal(-1, [1, 2, 3].indexOf(0)); 18 | // }); 19 | // }); 20 | //# sourceMappingURL=extension.test.js.map -------------------------------------------------------------------------------- /vsc-scaffolding/out/test/extension.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.test.js","sourceRoot":"","sources":["../../src/test/extension.test.ts"],"names":[],"mappings":";AAAA,KAAK;AACL,qEAAqE;AACrE,2EAA2E;AAC3E,KAAK;AAEL,8DAA8D;AAC9D,oCAAoC;AAEpC,6DAA6D;AAC7D,iDAAiD;AACjD,uCAAuC;AACvC,kDAAkD;AAElD,wEAAwE;AACxE,yCAAyC;AAEzC,mCAAmC;AACnC,uCAAuC;AACvC,kDAAkD;AAClD,kDAAkD;AAClD,UAAU;AACV,MAAM"} -------------------------------------------------------------------------------- /vsc-scaffolding/out/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // 3 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 4 | // 5 | // This file is providing the test runner to use when running extension tests. 6 | // By default the test runner in use is Mocha based. 7 | // 8 | // You can provide your own test runner if you want to override it by exporting 9 | // a function run(testsRoot: string, clb: (error: Error, failures?: number) => void): void 10 | // that the extension host can call to run the tests. The test runner is expected to use console.log 11 | // to report the results back to the caller. When the tests are finished, return 12 | // a possible error to the callback or null if none. 13 | Object.defineProperty(exports, "__esModule", { value: true }); 14 | const testRunner = require("vscode/lib/testrunner"); 15 | // You can directly control Mocha options by configuring the test runner below 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options 17 | // for more info 18 | testRunner.configure({ 19 | ui: 'tdd', 20 | useColors: true // colored output from test results 21 | }); 22 | module.exports = testRunner; 23 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /vsc-scaffolding/out/test/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,0FAA0F;AAC1F,oGAAoG;AACpG,gFAAgF;AAChF,oDAAoD;;AAEpD,oDAAoD;AAEpD,8EAA8E;AAC9E,qFAAqF;AACrF,gBAAgB;AAChB,UAAU,CAAC,SAAS,CAAC;IACjB,EAAE,EAAE,KAAK;IACT,SAAS,EAAE,IAAI,CAAC,mCAAmC;CACtD,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"} -------------------------------------------------------------------------------- /vsc-scaffolding/src/extension.ts: -------------------------------------------------------------------------------- 1 | // The module 'vscode' contains the VS Code extensibility API 2 | import * as vscode from 'vscode' 3 | 4 | import Scaffolding from './Scaffolding' 5 | 6 | // Import the module and reference it with the alias vscode in your code below 7 | // this method is called when your extension is activated 8 | // your extension is activated the very first time the command is executed 9 | export function activate(context: vscode.ExtensionContext) { 10 | // Use the console to output diagnostic information (console.log) and errors (console.error) 11 | // This line of code will only be executed once when your extension is activated 12 | console.log('Congratulations, your extension "vsc-scaffolding" is now active!') 13 | 14 | // The command has been defined in the package.json file 15 | // Now provide the implementation of the command with registerCommand 16 | // The commandId parameter must match the command field in package.json 17 | 18 | const scaffolding = new Scaffolding() 19 | 20 | let disposable = vscode.commands.registerCommand( 21 | 'extension.vscScaffolding', 22 | (uri?: vscode.Uri, uris?: vscode.Uri[]) => { 23 | scaffolding.createTemplate(uri) 24 | } 25 | ) 26 | 27 | context.subscriptions.push(disposable) 28 | } 29 | 30 | // this method is called when your extension is deactivated 31 | export function deactivate() {} 32 | -------------------------------------------------------------------------------- /vsc-scaffolding/src/temp.vsc-tempate.js: -------------------------------------------------------------------------------- 1 | (function Template(){ 2 | const camelize = str => str.replace(/\W+(.)/g, (_match, chr) => chr.toUpperCase()) 3 | return { 4 | userInputs: [ 5 | { 6 | title: 'What is the Component Name', 7 | argumentName: 'name', // will become input in template 8 | defaultValue: 'test' 9 | } 10 | ], 11 | template: [ 12 | { 13 | type: 'folder', 14 | name: inputs => `${camelize(inputs.name)}Component`, 15 | children: [ 16 | { 17 | type: 'file', 18 | name: inputs => `${camelize(inputs.name)}.js`, 19 | content: inputs => `import React from 'react' 20 | 21 | const ${camelize(inputs.name)} = ({ value }}) => ( 22 |
{value}
23 | ) 24 | 25 | export default ${camelize(inputs.name)} 26 | ` 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | }) 33 | -------------------------------------------------------------------------------- /vsc-scaffolding/src/test/extension.test.ts: -------------------------------------------------------------------------------- 1 | // // 2 | // // Note: This example test is leveraging the Mocha test framework. 3 | // // Please refer to their documentation on https://mochajs.org/ for help. 4 | // // 5 | 6 | // // The module 'assert' provides assertion methods from node 7 | // import * as assert from 'assert'; 8 | 9 | // // You can import and use all API from the 'vscode' module 10 | // // as well as import your extension to test it 11 | // // import * as vscode from 'vscode'; 12 | // // import * as myExtension from '../extension'; 13 | 14 | // // Defines a Mocha test suite to group tests of similar kind together 15 | // suite("Extension Tests", function () { 16 | 17 | // // Defines a Mocha unit test 18 | // test("Something 1", function() { 19 | // assert.equal(-1, [1, 2, 3].indexOf(5)); 20 | // assert.equal(-1, [1, 2, 3].indexOf(0)); 21 | // }); 22 | // }); 23 | -------------------------------------------------------------------------------- /vsc-scaffolding/src/test/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testsRoot: string, clb: (error: Error, failures?: number) => void): void 9 | // that the extension host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | import * as testRunner from 'vscode/lib/testrunner'; 14 | 15 | // You can directly control Mocha options by configuring the test runner below 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options 17 | // for more info 18 | testRunner.configure({ 19 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) 20 | useColors: true // colored output from test results 21 | }); 22 | 23 | module.exports = testRunner; -------------------------------------------------------------------------------- /vsc-scaffolding/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "strict": true /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | }, 17 | "exclude": [ 18 | "node_modules", 19 | ".vscode-test" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /vsc-scaffolding/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [false, "always"], 9 | "triple-equals": true 10 | }, 11 | "defaultSeverity": "warning" 12 | } 13 | -------------------------------------------------------------------------------- /vsc-scaffolding/vsc-base-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-scaffolding/vsc-base-icon.png -------------------------------------------------------------------------------- /vsc-scaffolding/vsc-scaffolding-0.1.14.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-scaffolding/vsc-scaffolding-0.1.14.vsix -------------------------------------------------------------------------------- /vsc-script/.vsc-script/Add-Script-Names.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: Automation > Add Names To All Scripts 2 | import * as vsc from 'vsc-base' 3 | 4 | export async function run(_path: string) { 5 | const files = await vsc.findFilePaths('**/*.vsc-script.ts'); 6 | vsc.showMessage("files found:" + files.length) 7 | for (const filePath of files) { 8 | let source = await vsc.getFileContent(filePath) 9 | if (!source.match(/\/\/vsc\-script\-name:/)) { 10 | const name = filePath.replace(/^.*\/([^\/]*).ts$/, '$1') 11 | source = `//vsc-script-name: ${name}\n${source}` 12 | await vsc.saveFileContent(filePath, source) 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/PPFILES.txt: -------------------------------------------------------------------------------- 1 | /Users/alfnielsen/Dropbox/Coding/vsc-base/vsc-script/package.json -------------------------------------------------------------------------------- /vsc-script/.vsc-script/findRel.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: findRel.vsc-script 2 | import vscNext from '../src/vsc-base/vsc-next' 3 | import * as vscode from 'vscode' 4 | 5 | export async function run(path: string, { vscNext1 }) { 6 | const files = await vscNext.findRelativeFilePaths(path, '..') 7 | const names = files.map(p => vscNext.cleanPath) 8 | 9 | vscNext.showMessage('Found: ' + JSON.stringify(files)); 10 | } 11 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/getConst.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: getConst.vsc-script 2 | import vsc from 'vsc-base' 3 | /** 4 | * This script finds all const names in a file (From start of lines) and append the list to the end of that file. 5 | */ 6 | export async function run(path: string) { 7 | if (vsc.isDir(path)) { 8 | vsc.showErrorMessage('Only works on files!') 9 | } 10 | let source = await vsc.getFileContent(path) 11 | const value = runner(source) 12 | //append result to file 13 | source = source + '\n\n' + value 14 | await vsc.saveFileContent(path, source) 15 | } 16 | 17 | const runner = (source: string) => { 18 | const lines = source.split(/\n/) 19 | const list: string[] = [] 20 | lines.forEach((line: string) => { 21 | const match = line.match(/^const\s*(\w+)/) 22 | if (match) { 23 | list.push(match[1]) 24 | } 25 | }) 26 | return 'const found = {\n\t' + list.join(',\n\t') + '\n}\n' 27 | } 28 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/onSaveEx.vsc-script-onsave-.ts: -------------------------------------------------------------------------------- 1 | import * as vsc from 'vsc-base'; 2 | 3 | const lastSaveTime = '2019-06-23T20:57:53.490Z'; // <-- updae on save 4 | export async function runOnSave() { 5 | const content = vsc.getDocumentContent() 6 | const [, pos] = vsc.tsFindNodePositionFromContent(content, 7 | node => vsc.tsMatchValueNode(node, /.*/, { 8 | hasAncestor: ancestor => vsc.tsIsVariable(ancestor, { name: 'lastSaveTime' }) 9 | }) 10 | ) 11 | vsc.insertAtRange(`'${(new Date()).toISOString()}'`, pos.range) 12 | } 13 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/test.vsc-script-onsave-.ts: -------------------------------------------------------------------------------- 1 | import * as vsc from 'vsc-base' 2 | import * as vscode from 'vscode' 3 | 4 | export function runOnSave(path: string) { 5 | vsc.showMessage('On Save Test file is active!') 6 | } 7 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/test.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: test.vsc-script 2 | import * as vsc from 'vsc-base' 3 | 4 | export async function run(path: string) { 5 | vsc.showMessage('Im a Test!') 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/tests/test-tsInsertImport.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: TEST > tsInsertImport (Run with this file open!) 2 | import * as vsc from 'vsc-base' 3 | 4 | const source1 = `const foo = () => {} 5 | ` 6 | const source2 = `import fii from 'test/test' 7 | 8 | const foo = () => {} 9 | ` 10 | const source3 = `import { fii2 } from 'test/test' 11 | 12 | const foo = () => {} 13 | ` 14 | 15 | export async function run(path: string) { 16 | 17 | vsc.showMessage('STARTTTT') 18 | const t11 = vsc.tsInsertImport(source1, 'fii', 'test/test') 19 | const t12 = vsc.tsInsertImport(source1, 'fii', 'test/test', true) 20 | const t21 = vsc.tsInsertImport(source2, 'fii', 'test/test') 21 | const t22 = vsc.tsInsertImport(source2, 'fii', 'test/test', true) 22 | const t31 = vsc.tsInsertImport(source3, 'fii', 'test/test') 23 | const t32 = vsc.tsInsertImport(source3, 'fii', 'test/test', true) 24 | const t33 = vsc.tsInsertImport(source1, 'fii', 'test/test', true, true, true) 25 | 26 | vsc.appendToDocument('\nconst foo = `\n' + t11 + '\n' + t12 + '\n' + t21 + '\n' + t22 + '\n' + t31 + '\n' + t32 + '\n' + t33 + '\n`') 27 | } 28 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/tests/test-util/with__import.ts: -------------------------------------------------------------------------------- 1 | 2 | export const test = () => { 3 | return "hej" 4 | } 5 | export const test2 = () => { 6 | return "hej2" 7 | } 8 | export const test3 = "WHAT!!" -------------------------------------------------------------------------------- /vsc-script/.vsc-script/tests/webviews/webview-test3.vsc-script.tsx: -------------------------------------------------------------------------------- 1 | import * as vsc from "vsc-base"; 2 | //vsc-script-name: WebView Test > React version (test 3) 3 | import * as vscode from "vscode"; 4 | 5 | //import * as vsc from "./vsc-base-development/vsc-base"; 6 | 7 | export async function run(path: string, context: vscode.ExtensionContext) { 8 | await startFindWebview(context); 9 | 10 | vsc.showMessage("Script Done"); 11 | } 12 | 13 | const startFindWebview = async (context: vscode.ExtensionContext) => { 14 | const { onCommand, sendSetHTML: set } = vsc.startWebview(context, { 15 | title: "Rename", 16 | body: ` 17 |
18 |

Test 3

19 | 20 |
info
21 |
22 | `, 23 | showOptions: { viewColumn: 2 }, 24 | onCommand: (command: string, value: any) => { 25 | //console.log("HERE!!!", message); 26 | } 27 | }); 28 | let count = 1; 29 | onCommand(async (command, value, resolve) => { 30 | switch (command) { 31 | case "ping": 32 | set("#info", "Ping!" + count++); 33 | break; 34 | } 35 | }); 36 | }; 37 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/tests/webviews/webview-test4.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: WebView Test > Custom html file test (test 4) 2 | import React from "react"; 3 | //import * as vsc from "./vsc-base-development/vsc-base"; 4 | import * as vsc from "vsc-base"; 5 | import * as vscode from "vscode"; 6 | 7 | export async function run(path: string, context: vscode.ExtensionContext) { 8 | await startFindWebview(context); 9 | 10 | } 11 | 12 | const startFindWebview = async (context: vscode.ExtensionContext) => { 13 | const pathToExtensionHtmlFile = vsc.joinPaths(context.extensionPath, '.vsc-script/tests/webviews/test-webview.html'); 14 | const html = await vsc.getFileContent(pathToExtensionHtmlFile) 15 | const { sendSetHTML: set, onCommand, dispose } = vsc.startWebview(context, { 16 | title: "Search in file", 17 | showOptions: 2, // this will open the webview in column 2 18 | html 19 | }); 20 | await onCommand(async (command, value, resolve) => { 21 | switch (command) { 22 | case "info": 23 | vsc.showMessage(value); 24 | resolve() 25 | break; 26 | } 27 | }); 28 | dispose() 29 | vsc.showMessage('Script done'); 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/tests/with__import.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: TEST > Script with import statements 2 | import * as vsc from "vsc-base" 3 | 4 | import { test, test2, test3 } from "./test-util/with__import" 5 | 6 | export async function run(path: string) { 7 | vsc.showMessage(test() + test3) 8 | vsc.showMessage(test2() + test3) 9 | } -------------------------------------------------------------------------------- /vsc-script/.vsc-script/tsReplaceTest.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: tsReplaceTest.vsc-script 2 | //import * as vsc from '../src/vsc-base-development/vsc-base' 3 | 4 | import * as ts from 'typescript' 5 | import * as vsc from 'vsc-base' 6 | 7 | export async function run(path: string) { 8 | vsc.showMessage("Start finding node... ") 9 | 10 | 11 | let source = ` 12 | const method2 = () => { 13 | const moduleNumber1Path = '/module/area/file1' 14 | return moduleNumber1Path 15 | } 16 | ` 17 | source = vsc.tsReplace(source, "'/file'", node => vsc.tsMatchValueNode(node, /file1/, { 18 | hasAncestors: [ 19 | ancestor => vsc.tsIsFunction(ancestor, { name: /^method/ }), 20 | //ancestor => vsc.tsIsVariable(ancestor, { name: /^module.*Path/ }) 21 | ] 22 | })) 23 | 24 | // Find a constant with name starting with 'module' witin a function but not in an if statement 25 | source = vsc.tsReplaceAll(source, 'A', node => vsc.tsMatchIdentifier(node, { 26 | name: 'moduleNumber1Path' 27 | })) 28 | 29 | 30 | source = vsc.tsReplaceAll(source, 'MM', node => vsc.tsMatchIdentifier(node, { 31 | name: /method/, 32 | hasAncestor: ancestor => vsc.tsIsVariable(ancestor, { 33 | hasGrandChild: child => vsc.tsIsFunction(child) 34 | }) 35 | })) 36 | 37 | vsc.appendLineToDocument(source); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/vsc-compiling/VSC-Project-Analysis.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: VSC-Project > Analyse 2 | import * as vsc from 'vsc-base' 3 | 4 | import { CodePart, createPartMap } from './vcs-base-util/mapping'; 5 | 6 | /** 7 | * This script finds all const names in a file (From start of lines) and append the list to the end of that file. 8 | */ 9 | export async function run(path: string) { 10 | const answers = ['All', 'Only Selected'] 11 | const response = await vsc.pick(answers) 12 | if (!response) { return } 13 | let vscFiles: string[] 14 | if (response === answers[0]) { 15 | vscFiles = await vsc.findFilePaths( 16 | '**/vsc-base-development/vsc-base-*.ts' 17 | ) 18 | } else { 19 | vscFiles = [path] 20 | 21 | } 22 | // create a part of combined from all files 23 | const parts = await createPartMap(vscFiles) 24 | vsc.showMessage(`found ${parts.length} methods in ${vscFiles.length} files`) 25 | } 26 | -------------------------------------------------------------------------------- /vsc-script/.vsc-script/vsc-compiling/updateSCriptAndScaff.vsc-script.ts: -------------------------------------------------------------------------------- 1 | //vsc-script-name: VSC-Project > Update vsc-bse in SCript and Scaffolding 2 | import * as vsc from 'vsc-base' 3 | 4 | /** 5 | * This script finds all const names in a file (From start of lines) and append the list to the end of that file. 6 | */ 7 | export async function run(path: string) { 8 | vsc.showMessage('Start update...') 9 | // Find all files under vsc-base-development folder with starting name 'vsc-base-' 10 | const vscFiles = await vsc.findFilePaths( 11 | '**/vsc-base-development/vsc-base-*.ts' 12 | ) 13 | let dir = vsc.getDir(vscFiles[0]) 14 | const scriptDir = dir.replace('vsc-script/src/vsc-base-development', 'vsc-script'); 15 | const scaffDir = dir.replace('vsc-script/src/vsc-base-development', 'vsc-scaffolding'); 16 | 17 | vsc.showMessage(`Update vsc-base in Script: ${scriptDir}`) 18 | await vsc.execFromPath("ncu -u vsc-base", scriptDir) 19 | await vsc.execFromPath("npm i", scriptDir) 20 | await vsc.execFromPath("ncu -u vsc-base", scaffDir) 21 | await vsc.execFromPath("npm i", scaffDir) 22 | 23 | vsc.showMessage(`Update Done`) 24 | } 25 | 26 | -------------------------------------------------------------------------------- /vsc-script/.vsc-temples/Component.vsc-template.js: -------------------------------------------------------------------------------- 1 | (function Template() { 2 | const camelize = str => str.replace(/\W+(.)/g, (_match, chr) => chr.toUpperCase()) 3 | const dash = str => str[0].toLowerCase()+str.substr(1).replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`) 4 | return { 5 | userInputs: [ 6 | { 7 | title: 'What is the Component Name', 8 | argumentName: 'name', // will become input in template 9 | defaultValue: 'test' 10 | } 11 | ], 12 | template: [ 13 | { 14 | type: 'folder', 15 | name: inputs => `${camelize(inputs.name)}Component`, 16 | children: [ 17 | { 18 | type: 'file', 19 | name: inputs => `${camelize(inputs.name)}.js`, 20 | content: inputs => `import React from 'react' 21 | 22 | const ${camelize(inputs.name)} = ({ value }) => ( 23 |
{value}
24 | ) 25 | 26 | export default ${camelize(inputs.name)} 27 | ` 28 | }, 29 | { 30 | type: 'file', 31 | name: inputs => `${camelize(inputs.name)}.css`, 32 | content: inputs => ` 33 | .${dash(inputs.name)} { 34 | display: block; 35 | } 36 | ` 37 | } 38 | ] 39 | } 40 | ] 41 | } 42 | }) 43 | -------------------------------------------------------------------------------- /vsc-script/.vsc-temples/ComponentAcyncTS.vsc-template.ts: -------------------------------------------------------------------------------- 1 | import * as vsc from 'vsc-base' 2 | 3 | //vsc-template-name: Component Async Ts 4 | 5 | export async function Template(): Promise { 6 | await vsc.sleep(50); 7 | return { 8 | userInputs: [ 9 | { 10 | title: 'What is the Component Name', 11 | argumentName: 'name', // will become input in template 12 | defaultValue: 'test' 13 | } 14 | ], 15 | template: [ 16 | { 17 | type: 'folder', 18 | name: inputs => `${vsc.toPascalCase(inputs.name)}Component`, 19 | children: [ 20 | { 21 | type: 'file', 22 | name: inputs => `${vsc.toPascalCase(inputs.name)}.js`, 23 | content: inputs => `import React from 'react' 24 | 25 | const ${vsc.toPascalCase(inputs.name)} = ({ value }) => ( 26 |
{value}
27 | ) 28 | 29 | export default ${vsc.toPascalCase(inputs.name)} 30 | ` 31 | }, 32 | { 33 | type: 'file', 34 | name: inputs => `${vsc.toPascalCase(inputs.name)}.css`, 35 | content: inputs => ` 36 | .${vsc.toKebabCase(inputs.name)} { 37 | display: block; 38 | } 39 | ` 40 | } 41 | ] 42 | } 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vsc-script/.vsc-temples/ComponentTS.vsc-template.ts: -------------------------------------------------------------------------------- 1 | import * as vsc from 'vsc-base' 2 | 3 | //vsc-template-name: Component Ts 4 | export function Template(): vsc.vscTemplate { 5 | return { 6 | userInputs: [ 7 | { 8 | title: 'What is the Component Name', 9 | argumentName: 'name', // will become input in template 10 | defaultValue: 'test' 11 | } 12 | ], 13 | template: [ 14 | { 15 | type: 'folder', 16 | name: inputs => `${vsc.toPascalCase(inputs.name)}Component`, 17 | children: [ 18 | { 19 | type: 'file', 20 | name: inputs => `${vsc.toPascalCase(inputs.name)}.js`, 21 | content: inputs => `import React from 'react' 22 | 23 | const ${vsc.toPascalCase(inputs.name)} = ({ value }) => ( 24 |
{value}
25 | ) 26 | 27 | export default ${vsc.toPascalCase(inputs.name)} 28 | ` 29 | }, 30 | { 31 | type: 'file', 32 | name: inputs => `${vsc.toPascalCase(inputs.name)}.css`, 33 | content: inputs => ` 34 | .${vsc.toKebabCase(inputs.name)} { 35 | display: block; 36 | } 37 | ` 38 | } 39 | ] 40 | } 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vsc-script/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "ms-vscode.vscode-typescript-tslint-plugin" 6 | ] 7 | } -------------------------------------------------------------------------------- /vsc-script/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Run Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "runtimeExecutable": "${execPath}", 13 | "args": ["--extensionDevelopmentPath=${workspaceFolder}"], 14 | "outFiles": ["${workspaceFolder}/out/**/*.js"], 15 | "preLaunchTask": "npm: compile" 16 | }, 17 | { 18 | "name": "Extension Tests", 19 | "type": "extensionHost", 20 | "request": "launch", 21 | "runtimeExecutable": "${execPath}", 22 | "args": [ 23 | "--extensionDevelopmentPath=${workspaceFolder}", 24 | "--extensionTestsPath=${workspaceFolder}/out/test" 25 | ], 26 | "outFiles": ["${workspaceFolder}/out/test/**/*.js"], 27 | "preLaunchTask": "npm: test-compile" 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /vsc-script/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /vsc-script/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /vsc-script/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .vscode-test 3 | node_modules 4 | out/ 5 | src/ 6 | .gitignore 7 | vsc-extension-quickstart.md 8 | tsconfig.json 9 | tslint.json 10 | **/*.map 11 | **/*.ts 12 | webpack.config.json -------------------------------------------------------------------------------- /vsc-script/out/extension.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAgC;AAEhC,sDAA6B;AAI7B,6DAA6D;AAE7D,8EAA8E;AAC9E,yDAAyD;AACzD,0EAA0E;AAC1E,SAAgB,QAAQ,CAAC,OAAgC;IACtD,4FAA4F;IAC5F,gFAAgF;IAChF,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAA;IAC1E,MAAM,MAAM,GAAG,IAAI,gBAAM,CAAC,OAAO,CAAC,CAAA;IAElC,IAAI,uBAAuB,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,qBAAqB,EAAE,CAAC,GAAgB,EAAE,IAAmB,EAAE,EAAE;QAC5H,IAAI,GAAG,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;YACvD,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,iFAAiF,CAAC,CAAC;YAClH,OAAO;SACT;aAAM,IAAI,GAAG,KAAK,SAAS,EAAE;YAC3B,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAA;SACnD;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC,CAAC,CAAA;IAEF,IAAI,kBAAkB,GAAG,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAC/D,2BAA2B,EAC3B,GAAG,EAAE;QACF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;YAClC,OAAM;SACR;QACD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAChE,CAAC,CACH,CAAA;IAED,IAAI,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,KAAuC,EAAE,EAAE;QACxG,KAAK,CAAC,SAAS,CACZ,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CACtC,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;IACnD,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC9C,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;AAC/C,CAAC;AAnCD,4BAmCC;AAED,2DAA2D;AAC3D,SAAgB,UAAU,KAAK,CAAC;AAAhC,gCAAgC"} -------------------------------------------------------------------------------- /vsc-script/out/src/extension.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/extension.ts"],"names":[],"mappings":";;AAAA,6DAA6D;AAC7D,iCAAgC;AAEhC,qCAA6B;AAE7B,8EAA8E;AAC9E,yDAAyD;AACzD,0EAA0E;AAC1E,SAAgB,QAAQ,CAAC,OAAgC;IACxD,4FAA4F;IAC5F,gFAAgF;IAChF,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAA;IAE1E,wDAAwD;IACxD,qEAAqE;IACrE,uEAAuE;IAEvE,MAAM,MAAM,GAAG,IAAI,gBAAM,EAAE,CAAA;IAE3B,IAAI,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,qBAAqB,EAAE,CAAC,GAAgB,EAAE,IAAmB,EAAE,EAAE;QAChH,IAAG,GAAG,KAAK,SAAS,EAAC;YACpB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,yGAAyG,CAAC,CAAC;YAC1I,OAAO;SACP;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAChB,CAAC,CACD,CAAA;IAED,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACvC,CAAC;AArBD,4BAqBC;AAED,2DAA2D;AAC3D,SAAgB,UAAU,KAAI,CAAC;AAA/B,gCAA+B"} -------------------------------------------------------------------------------- /vsc-script/out/src/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // 3 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 4 | // 5 | // This file is providing the test runner to use when running extension tests. 6 | // By default the test runner in use is Mocha based. 7 | // 8 | // You can provide your own test runner if you want to override it by exporting 9 | // a function run(testsRoot: string, clb: (error: Error, failures?: number) => void): void 10 | // that the extension host can call to run the tests. The test runner is expected to use console.log 11 | // to report the results back to the caller. When the tests are finished, return 12 | // a possible error to the callback or null if none. 13 | Object.defineProperty(exports, "__esModule", { value: true }); 14 | const testRunner = require("vscode/lib/testrunner"); 15 | // You can directly control Mocha options by configuring the test runner below 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options 17 | // for more info 18 | testRunner.configure({ 19 | ui: 'tdd', 20 | useColors: true // colored output from test results 21 | }); 22 | module.exports = testRunner; 23 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /vsc-script/out/src/test/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/test/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,0FAA0F;AAC1F,oGAAoG;AACpG,gFAAgF;AAChF,oDAAoD;;AAEpD,oDAAoD;AAEpD,8EAA8E;AAC9E,qFAAqF;AACrF,gBAAgB;AAChB,UAAU,CAAC,SAAS,CAAC;IACjB,EAAE,EAAE,KAAK;IACT,SAAS,EAAE,IAAI,CAAC,mCAAmC;CACtD,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"} -------------------------------------------------------------------------------- /vsc-script/out/src/vsc-base-development/vsc-base-vscTemplate.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-vscTemplate.js","sourceRoot":"","sources":["../../../src/vsc-base-development/vsc-base-vscTemplate.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,kCAAiC;AAEjC;;;;;;;;;;;GAWG;AACU,QAAA,gBAAgB,GAAG,CAC7B,IAAY,EACZ,YAAiC,EACjC,aAAgC,EAAE,EACpB,EAAE;IAChB,QAAQ,YAAY,CAAC,IAAI,EAAE;QACxB,KAAK,QAAQ,CAAC,CAAC;YACZ,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;YAC5B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aACpC;YACD,MAAM,UAAU,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAA;YACpC,MAAM,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;YAC7B,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;gBACzB,MAAK;aACP;YACD,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAO,SAAc,EAAE,EAAE;gBACpD,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;YAC1D,CAAC,CAAA,CAAC,CAAA;YACF,MAAK;SACP;QACD,KAAK,MAAM,CAAC,CAAC;YACV,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;YAC5B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aACpC;YACD,MAAM,QAAQ,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAA;YAClC,IAAI,OAAO,GAAG,YAAY,CAAC,OAAO,CAAA;YAClC,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;gBAChC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aAC1C;YACD,MAAM,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;SAC9C;KACH;AACJ,CAAC,CAAA,CAAA"} -------------------------------------------------------------------------------- /vsc-script/out/test/compiled-tests/vsc-base-typescript-module-load.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // suite('ts_awaitResult', () => { 4 | // test(' 1', () => { 5 | // const r1 = vsc.awaitResult() 6 | // assert.equal(r1, '') 7 | // }) 8 | // }) 9 | // suite('System_getVscDefaultModuleMap', () => { 10 | // test(' 1', () => { 11 | // const r1 = vsc.getVscDefaultModuleMap() 12 | // assert.equal(r1, '') 13 | // }) 14 | // }) 15 | // suite('System_tsGetLocalModules', () => { 16 | // test(' 1', () => { 17 | // const r1 = vsc.tsGetLocalModules() 18 | // assert.equal(r1, '') 19 | // }) 20 | // }) 21 | // suite('System_tsLoadModule', () => { 22 | // test(' 1', () => { 23 | // const r1 = vsc.tsLoadModule() 24 | // assert.equal(r1, '') 25 | // }) 26 | // }) 27 | // suite('System_tsLoadModuleSourceCode', () => { 28 | // test(' 1', () => { 29 | // const r1 = vsc.tsLoadModuleSourceCode() 30 | // assert.equal(r1, '') 31 | // }) 32 | // }) 33 | // suite('System_tsRewriteTranspiledCodeWithVscBaseModules', () => { 34 | // test(' 1', () => { 35 | // const r1 = vsc.tsRewriteTranspiledCodeWithVscBaseModules() 36 | // assert.equal(r1, '') 37 | // }) 38 | // }) 39 | // suite('System_verifyModuleMethods', () => { 40 | // test(' 1', () => { 41 | // const r1 = vsc.verifyModuleMethods() 42 | // assert.equal(r1, '') 43 | // }) 44 | // }) 45 | //# sourceMappingURL=vsc-base-typescript-module-load.test.js.map -------------------------------------------------------------------------------- /vsc-script/out/test/compiled-tests/vsc-base-typescript-module-load.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-typescript-module-load.test.js","sourceRoot":"","sources":["../../../src/test/compiled-tests/vsc-base-typescript-module-load.test.ts"],"names":[],"mappings":";;AAIA,kCAAkC;AAClC,wBAAwB;AACxB,qCAAqC;AACrC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,iDAAiD;AACjD,wBAAwB;AACxB,gDAAgD;AAChD,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,4CAA4C;AAC5C,wBAAwB;AACxB,2CAA2C;AAC3C,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,uCAAuC;AACvC,wBAAwB;AACxB,sCAAsC;AACtC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,iDAAiD;AACjD,wBAAwB;AACxB,gDAAgD;AAChD,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,oEAAoE;AACpE,wBAAwB;AACxB,mEAAmE;AACnE,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,8CAA8C;AAC9C,wBAAwB;AACxB,6CAA6C;AAC7C,6BAA6B;AAC7B,QAAQ;AACR,KAAK"} -------------------------------------------------------------------------------- /vsc-script/out/test/compiled-tests/vsc-base-typescript-transform.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-typescript-transform.test.js","sourceRoot":"","sources":["../../../src/test/compiled-tests/vsc-base-typescript-transform.test.ts"],"names":[],"mappings":";;AAIA,0CAA0C;AAC1C,wBAAwB;AACxB,6CAA6C;AAC7C,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,qDAAqD;AACrD,wBAAwB;AACxB,wDAAwD;AACxD,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,0CAA0C;AAC1C,wBAAwB;AACxB,6CAA6C;AAC7C,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,wDAAwD;AACxD,wBAAwB;AACxB,2DAA2D;AAC3D,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,oDAAoD;AACpD,wBAAwB;AACxB,uDAAuD;AACvD,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,qCAAqC;AACrC,wBAAwB;AACxB,wCAAwC;AACxC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,gCAAgC;AAChC,wBAAwB;AACxB,mCAAmC;AACnC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,mCAAmC;AACnC,wBAAwB;AACxB,sCAAsC;AACtC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,kCAAkC;AAClC,wBAAwB;AACxB,qCAAqC;AACrC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,8CAA8C;AAC9C,wBAAwB;AACxB,iDAAiD;AACjD,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,sCAAsC;AACtC,wBAAwB;AACxB,yCAAyC;AACzC,6BAA6B;AAC7B,QAAQ;AACR,KAAK"} -------------------------------------------------------------------------------- /vsc-script/out/test/compiled-tests/vsc-base-vscTemplate.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // suite('System_scaffoldTemplate', () => { 4 | // test(' 1', () => { 5 | // const r1 = vsc.scaffoldTemplate() 6 | // assert.equal(r1, '') 7 | // }) 8 | // }) 9 | //# sourceMappingURL=vsc-base-vscTemplate.test.js.map -------------------------------------------------------------------------------- /vsc-script/out/test/compiled-tests/vsc-base-vscTemplate.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-vscTemplate.test.js","sourceRoot":"","sources":["../../../src/test/compiled-tests/vsc-base-vscTemplate.test.ts"],"names":[],"mappings":";;AAIA,2CAA2C;AAC3C,wBAAwB;AACxB,0CAA0C;AAC1C,6BAA6B;AAC7B,QAAQ;AACR,KAAK"} -------------------------------------------------------------------------------- /vsc-script/out/test/compiled-tests/vsc-base-vscode-webview.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // suite('webview_initWebview', () => { 4 | // test(' 1', () => { 5 | // const r1 = vsc.initWebview() 6 | // assert.equal(r1, '') 7 | // }) 8 | // }) 9 | // suite('webview_setupWebviewConnection', () => { 10 | // test(' 1', () => { 11 | // const r1 = vsc.setupWebviewConnection() 12 | // assert.equal(r1, '') 13 | // }) 14 | // }) 15 | // suite('webview_startWebview', () => { 16 | // test(' 1', () => { 17 | // const r1 = vsc.startWebview() 18 | // assert.equal(r1, '') 19 | // }) 20 | // }) 21 | // suite('webview_WebviewHTMLTemplate', () => { 22 | // test(' 1', () => { 23 | // const r1 = vsc.WebviewHTMLTemplate() 24 | // assert.equal(r1, '') 25 | // }) 26 | // }) 27 | //# sourceMappingURL=vsc-base-vscode-webview.test.js.map -------------------------------------------------------------------------------- /vsc-script/out/test/compiled-tests/vsc-base-vscode-webview.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-vscode-webview.test.js","sourceRoot":"","sources":["../../../src/test/compiled-tests/vsc-base-vscode-webview.test.ts"],"names":[],"mappings":";;AAIA,uCAAuC;AACvC,wBAAwB;AACxB,qCAAqC;AACrC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,kDAAkD;AAClD,wBAAwB;AACxB,gDAAgD;AAChD,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,wCAAwC;AACxC,wBAAwB;AACxB,sCAAsC;AACtC,6BAA6B;AAC7B,QAAQ;AACR,KAAK;AAEL,+CAA+C;AAC/C,wBAAwB;AACxB,6CAA6C;AAC7C,6BAA6B;AAC7B,QAAQ;AACR,KAAK"} -------------------------------------------------------------------------------- /vsc-script/out/test/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // 3 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 4 | // 5 | // This file is providing the test runner to use when running extension tests. 6 | // By default the test runner in use is Mocha based. 7 | // 8 | // You can provide your own test runner if you want to override it by exporting 9 | // a function run(testsRoot: string, clb: (error: Error, failures?: number) => void): void 10 | // that the extension host can call to run the tests. The test runner is expected to use console.log 11 | // to report the results back to the caller. When the tests are finished, return 12 | // a possible error to the callback or null if none. 13 | var __importStar = (this && this.__importStar) || function (mod) { 14 | if (mod && mod.__esModule) return mod; 15 | var result = {}; 16 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 17 | result["default"] = mod; 18 | return result; 19 | }; 20 | Object.defineProperty(exports, "__esModule", { value: true }); 21 | const testRunner = __importStar(require("vscode/lib/testrunner")); 22 | // You can directly control Mocha options by configuring the test runner below 23 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options 24 | // for more info 25 | testRunner.configure({ 26 | ui: 'tdd', 27 | useColors: true // colored output from test results 28 | }); 29 | module.exports = testRunner; 30 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /vsc-script/out/test/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,0FAA0F;AAC1F,oGAAoG;AACpG,gFAAgF;AAChF,oDAAoD;;;;;;;;;AAEpD,kEAAoD;AAEpD,8EAA8E;AAC9E,qFAAqF;AACrF,gBAAgB;AAChB,UAAU,CAAC,SAAS,CAAC;IACjB,EAAE,EAAE,KAAK;IACT,SAAS,EAAE,IAAI,CAAC,mCAAmC;CACtD,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"} -------------------------------------------------------------------------------- /vsc-script/out/test/typescript-base/-test-typescript-base.vsc-script.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"-test-typescript-base.vsc-script.js","sourceRoot":"","sources":["../../../src/test/typescript-base/-test-typescript-base.vsc-script.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,mDAAmD;AACnD,iCAAgC;AAChC,gCAA+B;AAO/B,SAAsB,GAAG,CAAC,IAAY;;QACnC,MAAM,WAAW,GAAiB,EAAE,CAAC;QACrC,eAAe,CAAC,WAAW,CAAC,CAAA;IAE/B,CAAC;CAAA;AAJD,kBAIC;AAED,MAAM,UAAU,GAAG,CAAC,WAAyB,EAAE,EAAE;IAC9C,WAAW,CAAC,IAAI,CAAC;QACd,OAAO,EAAE,IAAI;KACf,CAAC,CAAA;AACL,CAAC,CAAA;AACD,MAAM,QAAQ,GAAG,CAAC,WAAyB,EAAE,MAAc,EAAE,MAAW,EAAE,MAAW,EAAE,EAAE;IACtF,WAAW,CAAC,IAAI,CAAC;QACd,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,wCAAwC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;KACnH,CAAC,CAAA;AACL,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,WAAyB,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,6BAA6B,CAAA;IAC5C,MAAM,MAAM,GAAG,qBAAqB,CAAA;IACpC,MAAM,IAAI,GAAG,EAAE,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IACvF,MAAM,MAAM,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAC5C,oCAAoC;IACpC,6BAA6B;IAC7B,WAAW;IACX,0DAA0D;IAC1D,IAAI;AACP,CAAC,CAAA"} -------------------------------------------------------------------------------- /vsc-script/out/test/vsc-base-raw.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //# sourceMappingURL=vsc-base-raw.test.js.map -------------------------------------------------------------------------------- /vsc-script/out/test/vsc-base-raw.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-raw.test.js","sourceRoot":"","sources":["../../src/test/vsc-base-raw.test.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /vsc-script/out/test/vsc-base.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //# sourceMappingURL=vsc-base.test.js.map -------------------------------------------------------------------------------- /vsc-script/out/test/vsc-base.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base.test.js","sourceRoot":"","sources":["../../src/test/vsc-base.test.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /vsc-script/out/vsc-base-development/vsc-base-typescript-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-typescript-base.js","sourceRoot":"","sources":["../../src/vsc-base-development/vsc-base-typescript-base.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAgC;AAEhC,gDAAiC;AAEjC;;;;;;;;;;GAUG;AACU,QAAA,WAAW,GAAG,CAAC,QAAgB,EACzC,kBAAsC,GAAG,CAAC,wBAAwB,EACnE,EAAE;IACD,MAAM,gBAAgB,GAAG,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,eAAe,EAAE,CAAC,CAAA;IAC1E,IAAI,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAA;IAC1C,OAAO,QAAQ,CAAC;AACnB,CAAC,CAAA;AAGD;;;;;;;;;;;;;GAaG;AACU,QAAA,eAAe,GAAG,CAC5B,UAAa,EACb,YAAwC,EACxC,kBAAsC,GAAG,CAAC,wBAAwB,EACnE,EAAE;IACD,OAAO,EAAE,CAAC,SAAS,CAAI,UAAU,EAAE,YAAY,EAAE,eAAe,CAAC,CAAA;AACpE,CAAC,CAAA;AAED;;;;;;;;;GASG;AACU,QAAA,wBAAwB,GAAiC,CAAC;IACpE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ;IAC9B,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;IAC9B,IAAI,EAAE,CAAC,KAAK,CAAC;CACf,CAAC,CAAA;AAEF;;;;;;;;;;GAUG;AACU,QAAA,kBAAkB,GAAG,CAC/B,OAAe,EACf,cAAc,GAAG,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EACzC,EAAE;IAChB,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACjC,cAAc,EACd,OAAO,EACP,EAAE,CAAC,YAAY,CAAC,MAAM;IAC1B,mBAAmB,CAAC,IAAI,CACtB,CAAC;IACF,OAAO,UAAU,CAAC;AACrB,CAAC,CAAA;AAED;;;;;;;;;;;GAWG;AACU,QAAA,mBAAmB,GAAG,CAAC,IAAa,EAAa,EAAE;IAC7D,IAAI,QAAQ,GAAc,EAAE,CAAA;IAC5B,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,QAAQ,CAAA;AAClB,CAAC,CAAA"} -------------------------------------------------------------------------------- /vsc-script/out/vsc-base-development/vsc-base-vscTemplate.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-vscTemplate.js","sourceRoot":"","sources":["../../src/vsc-base-development/vsc-base-vscTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAAiC;AAEjC;;;;;;;;;;;;GAYG;AACU,QAAA,gBAAgB,GAAG,CAC7B,IAAY,EACZ,YAAiC,EACjC,aAAgC,EAAE,EACpB,EAAE;IAChB,QAAQ,YAAY,CAAC,IAAI,EAAE;QACxB,KAAK,QAAQ,CAAC,CAAC;YACZ,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;YAC5B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aACpC;YACD,MAAM,UAAU,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAA;YACpC,MAAM,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;YAC7B,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;gBACzB,MAAK;aACP;YACD,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAO,SAAc,EAAE,EAAE;gBACpD,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;YAC1D,CAAC,CAAA,CAAC,CAAA;YACF,MAAK;SACP;QACD,KAAK,MAAM,CAAC,CAAC;YACV,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;YAC5B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aACpC;YACD,MAAM,QAAQ,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAA;YAClC,IAAI,OAAO,GAAG,YAAY,CAAC,OAAO,CAAA;YAClC,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;gBAChC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aAC1C;YACD,MAAM,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;SAC9C;KACH;AACJ,CAAC,CAAA,CAAA"} -------------------------------------------------------------------------------- /vsc-script/out/vsc-base-development/vsc-base-vscode-webview-libs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base-vscode-webview-libs.js","sourceRoot":"","sources":["../../src/vsc-base-development/vsc-base-vscode-webview-libs.ts"],"names":[],"mappings":";;AAIA;;;;;;;;;;;EAWE;AACW,QAAA,OAAO,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAgCe,CAAA;AAE9C;;;;;;;;;;;EAWE;AACW,QAAA,UAAU,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6FAgP2D,CAAA;AAE7F;;;;;;;;;;;EAWE;AACW,QAAA,UAAU,GAAW;;;;;;8CAMY,CAAA"} -------------------------------------------------------------------------------- /vsc-script/out/vsc-base-development/vsc-base.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | __export(require("./vsc-base-raw")); 7 | __export(require("./vsc-base-vscode")); 8 | __export(require("./vsc-base-vscode-webview")); 9 | __export(require("./vsc-base-system")); 10 | __export(require("./vsc-base-typescript-base")); 11 | __export(require("./vsc-base-typescript-match")); 12 | __export(require("./vsc-base-typescript-transform")); 13 | __export(require("./vsc-base-typescript-top-level-transform")); 14 | __export(require("./vsc-base-typescript-module-load")); 15 | __export(require("./vsc-base-vscTemplate")); 16 | //# sourceMappingURL=vsc-base.js.map -------------------------------------------------------------------------------- /vsc-script/out/vsc-base-development/vsc-base.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vsc-base.js","sourceRoot":"","sources":["../../src/vsc-base-development/vsc-base.ts"],"names":[],"mappings":";;;;;AACA,oCAA8B;AAC9B,uCAAiC;AACjC,+CAA0C;AAC1C,uCAAkC;AAClC,gDAA2C;AAC3C,iDAA4C;AAC5C,qDAAgD;AAChD,+DAA0D;AAC1D,uDAAkD;AAClD,4CAAuC"} -------------------------------------------------------------------------------- /vsc-script/out/webview-test1.vsc-script.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"webview-test1.vsc-script.js","sourceRoot":"","sources":["../src/webview-test1.vsc-script.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,8CAAgC;AAGhC,SAAsB,GAAG,CAAC,IAAY,EAAE,OAAgC;;QACrE,MAAM,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE;YACjE,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,CAAC;YACd,IAAI,EAAE;;;;;;;;;KASP;YACC,gBAAgB,EAAE,CAAC,OAAY,EAAE,EAAE;gBAChC,QAAQ,OAAO,CAAC,OAAO,EAAE;oBACtB,KAAK,MAAM;wBACR,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAE,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;wBAC7D,MAAM;oBACT,KAAK,OAAO;wBACT,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAE,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;wBAC9D,MAAM;iBACX;YACJ,CAAC;SACH,CAAC,CAAC;QACH,MAAM,SAAS,CAAC,CAAO,OAAO,EAAE,OAAO,EAAE,EAAE;YACxC,QAAQ,OAAO,CAAC,OAAO,EAAE;gBACtB,KAAK,MAAM;oBACR,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAC/B,MAAM;gBACT,KAAK,KAAK;oBACP,OAAO,EAAE,CAAC;oBACV,MAAM;gBACT,KAAK,QAAQ;oBACV,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBACrD,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;oBACnE,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,2DAA2D,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpJ,MAAM;gBACT,KAAK,MAAM;oBACR,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBACzE,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oBACjC,MAAM;aACX;QACJ,CAAC,CAAA,CAAC,CAAC;QACH,OAAO,EAAE,CAAA;QACT,GAAG,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC;CAAA;AA9CD,kBA8CC"} -------------------------------------------------------------------------------- /vsc-script/src/test/compiled-tests/vsc-base-typescript-module-load.test.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert' 2 | 3 | import * as vsc from '../../vsc-base-development/vsc-base' 4 | 5 | // suite('ts_awaitResult', () => { 6 | // test(' 1', () => { 7 | // const r1 = vsc.awaitResult() 8 | // assert.equal(r1, '') 9 | // }) 10 | // }) 11 | 12 | // suite('System_getVscDefaultModuleMap', () => { 13 | // test(' 1', () => { 14 | // const r1 = vsc.getVscDefaultModuleMap() 15 | // assert.equal(r1, '') 16 | // }) 17 | // }) 18 | 19 | // suite('System_tsGetLocalModules', () => { 20 | // test(' 1', () => { 21 | // const r1 = vsc.tsGetLocalModules() 22 | // assert.equal(r1, '') 23 | // }) 24 | // }) 25 | 26 | // suite('System_tsLoadModule', () => { 27 | // test(' 1', () => { 28 | // const r1 = vsc.tsLoadModule() 29 | // assert.equal(r1, '') 30 | // }) 31 | // }) 32 | 33 | // suite('System_tsLoadModuleSourceCode', () => { 34 | // test(' 1', () => { 35 | // const r1 = vsc.tsLoadModuleSourceCode() 36 | // assert.equal(r1, '') 37 | // }) 38 | // }) 39 | 40 | // suite('System_tsRewriteTranspiledCodeWithVscBaseModules', () => { 41 | // test(' 1', () => { 42 | // const r1 = vsc.tsRewriteTranspiledCodeWithVscBaseModules() 43 | // assert.equal(r1, '') 44 | // }) 45 | // }) 46 | 47 | // suite('System_verifyModuleMethods', () => { 48 | // test(' 1', () => { 49 | // const r1 = vsc.verifyModuleMethods() 50 | // assert.equal(r1, '') 51 | // }) 52 | // }) 53 | -------------------------------------------------------------------------------- /vsc-script/src/test/compiled-tests/vsc-base-vscTemplate.test.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert' 2 | 3 | import * as vsc from '../../vsc-base-development/vsc-base' 4 | 5 | // suite('System_scaffoldTemplate', () => { 6 | // test(' 1', () => { 7 | // const r1 = vsc.scaffoldTemplate() 8 | // assert.equal(r1, '') 9 | // }) 10 | // }) 11 | -------------------------------------------------------------------------------- /vsc-script/src/test/compiled-tests/vsc-base-vscode-webview.test.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert' 2 | 3 | import * as vsc from '../../vsc-base-development/vsc-base' 4 | 5 | // suite('webview_initWebview', () => { 6 | // test(' 1', () => { 7 | // const r1 = vsc.initWebview() 8 | // assert.equal(r1, '') 9 | // }) 10 | // }) 11 | 12 | // suite('webview_setupWebviewConnection', () => { 13 | // test(' 1', () => { 14 | // const r1 = vsc.setupWebviewConnection() 15 | // assert.equal(r1, '') 16 | // }) 17 | // }) 18 | 19 | // suite('webview_startWebview', () => { 20 | // test(' 1', () => { 21 | // const r1 = vsc.startWebview() 22 | // assert.equal(r1, '') 23 | // }) 24 | // }) 25 | 26 | // suite('webview_WebviewHTMLTemplate', () => { 27 | // test(' 1', () => { 28 | // const r1 = vsc.WebviewHTMLTemplate() 29 | // assert.equal(r1, '') 30 | // }) 31 | // }) 32 | 33 | // suite('webview_WebviewStyleTemplate', () => { 34 | // test(' 1', () => { 35 | // const r1 = vsc.WebviewStyleTemplate() 36 | // assert.equal(r1, '') 37 | // }) 38 | // }) 39 | -------------------------------------------------------------------------------- /vsc-script/src/test/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testsRoot: string, clb: (error: Error, failures?: number) => void): void 9 | // that the extension host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | import * as testRunner from 'vscode/lib/testrunner'; 14 | 15 | // You can directly control Mocha options by configuring the test runner below 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options 17 | // for more info 18 | testRunner.configure({ 19 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) 20 | useColors: true // colored output from test results 21 | }); 22 | 23 | module.exports = testRunner; 24 | -------------------------------------------------------------------------------- /vsc-script/src/vsc-base-development/vsc-base.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from './vsc-base-raw' 3 | export * from './vsc-base-vscode' 4 | export * from './vsc-base-vscode-webview'; 5 | export * from './vsc-base-system'; 6 | export * from './vsc-base-typescript-base'; 7 | export * from './vsc-base-typescript-match'; 8 | export * from './vsc-base-typescript-transform'; 9 | export * from './vsc-base-typescript-top-level-transform'; 10 | export * from './vsc-base-typescript-module-load'; 11 | export * from './vsc-base-vscTemplate'; -------------------------------------------------------------------------------- /vsc-script/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": ["es6", "esnext", "dom"], 7 | "esModuleInterop": true, 8 | "sourceMap": true, 9 | "rootDir": "src", 10 | "jsx": "react", 11 | "strict": true /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | }, 17 | "exclude": ["node_modules", ".vscode-test", ".vsc-script"] 18 | } 19 | -------------------------------------------------------------------------------- /vsc-script/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [false, "always"], 9 | "triple-equals": true 10 | }, 11 | "defaultSeverity": "warning" 12 | } 13 | -------------------------------------------------------------------------------- /vsc-script/vsc-base-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-script/vsc-base-icon.png -------------------------------------------------------------------------------- /vsc-script/vsc-script-0.6.7.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfnielsen/vsc-base/a700aa5085ea4ebedbacc76e7483db8d92325cf7/vsc-script/vsc-script-0.6.7.vsix -------------------------------------------------------------------------------- /vsc-script/webpack.config.js: -------------------------------------------------------------------------------- 1 | //@ts-check 2 | 3 | 'use strict' 4 | 5 | const path = require('path') 6 | 7 | const config = { 8 | target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ 9 | entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ 10 | output: { 11 | // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ 12 | path: path.resolve(__dirname, 'dist'), 13 | filename: 'extension.js', 14 | libraryTarget: 'commonjs2', 15 | devtoolModuleFilenameTemplate: '../[resource-path]' 16 | }, 17 | devtool: 'source-map', 18 | externals: { 19 | vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ 20 | }, 21 | resolve: { 22 | // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader 23 | extensions: ['.ts', '.js'] 24 | }, 25 | module: { 26 | rules: [ 27 | { 28 | test: /\.ts$/, 29 | exclude: /node_modules/, 30 | use: [ 31 | { 32 | loader: 'ts-loader' 33 | } 34 | ] 35 | } 36 | ] 37 | } 38 | } 39 | 40 | module.exports = config 41 | --------------------------------------------------------------------------------