Browse Source

chore: split app to commons and web (squash commit)

Andrew Bastin 2 years ago
parent
commit
3d004f2322

+ 0 - 0
packages/hoppscotch-app/.env.example → .env.example


+ 2 - 2
.github/workflows/deploy-netlify.yml

@@ -13,7 +13,7 @@ jobs:
         uses: actions/checkout@v3
 
       - name: Setup Environment
-        run: mv packages/hoppscotch-app/.env.example packages/hoppscotch-app/.env
+        run: mv packages/hoppscotch-web/.env.example packages/hoppscotch-web/.env
 
       - name: Setup and run pnpm install
         uses: pnpm/action-setup@v2.2.2
@@ -30,7 +30,7 @@ jobs:
 
       # Deploy the production site with netlify-cli
       - name: Deploy to Netlify (production)
-        run: npx netlify-cli deploy --dir=packages/hoppscotch-app/dist --prod
+        run: npx netlify-cli deploy --dir=packages/hoppscotch-web/dist --prod
         env:
           NETLIFY_SITE_ID: ${{ secrets.NETLIFY_PRODUCTION_SITE_ID }}
           NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

+ 1 - 1
.github/workflows/deploy-preview-netlify.yml

@@ -42,7 +42,7 @@ jobs:
 
       # Deploy the preview site with netlify-cli
       - name: Deploy to Netlify (preview)
-        run: npx netlify-cli deploy --dir=packages/hoppscotch-app/dist --alias=preview
+        run: npx netlify-cli deploy --dir=packages/hoppscotch-web/dist --alias=preview
         env:
           NETLIFY_SITE_ID: ${{ secrets.NETLIFY_STAGING_SITE_ID }}
           NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

+ 1 - 1
.github/workflows/deploy-staging-netlify.yml

@@ -42,7 +42,7 @@ jobs:
 
       # Deploy the staging site with netlify-cli
       - name: Deploy to Netlify (staging)
-        run: npx netlify-cli deploy --dir=packages/hoppscotch-app/dist --prod
+        run: npx netlify-cli deploy --dir=packages/hoppscotch-web/dist --prod
         env:
           NETLIFY_SITE_ID: ${{ secrets.NETLIFY_STAGING_SITE_ID }}
           NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

+ 1 - 0
.vscode/extensions.json

@@ -6,6 +6,7 @@
     "dbaeumer.vscode-eslint",
     "editorconfig.editorconfig",
     "csstools.postcss",
+    "folke.vscode-monorepo-workspace"
   ],
   "unwantedRecommendations": [
     "octref.vetur"

+ 1 - 1
README.md

@@ -279,7 +279,7 @@ _Add-ons are developed and maintained under **[Hoppscotch Organization](https://
 
 ## **Developing**
 
-0. Update [`.env.example`](https://github.com/hoppscotch/hoppscotch/blob/main/packages/hoppscotch-app/.env.example) file found in `packages/hoppscotch-app` with your own keys and rename it to `.env`.
+0. Update [`.env.example`](https://github.com/hoppscotch/hoppscotch/blob/main/.env.example) file found in the root of the repo with your own keys and rename it to `.env`.
 
 _Sample keys only work with the [production build](https://hoppscotch.io)._
 

+ 0 - 16
packages/hoppscotch-app/README.md

@@ -1,16 +0,0 @@
-# Vue 3 + TypeScript + Vite
-
-This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
-
-## Recommended IDE Setup
-
-- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
-
-## Type Support For `.vue` Imports in TS
-
-Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:
-
-1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
-2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
-
-You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).

+ 0 - 272
packages/hoppscotch-app/shims-volar.d.ts

@@ -1,272 +0,0 @@
-import AppAnnouncement from "./components/app/Announcement.vue";
-import AppDeveloperOptions from "./components/app/DeveloperOptions.vue";
-import AppFooter from "./components/app/Footer.vue";
-import AppFuse from "./components/app/Fuse.vue";
-import AppGitHubStarButton from "./components/app/GitHubStarButton.vue";
-import AppHeader from "./components/app/Header.vue";
-import AppInterceptor from "./components/app/Interceptor.vue";
-import AppLogo from "./components/app/Logo.vue";
-import AppOptions from "./components/app/Options.vue";
-import AppPaneLayout from "./components/app/PaneLayout.vue";
-import AppPowerSearch from "./components/app/PowerSearch.vue";
-import AppPowerSearchEntry from "./components/app/PowerSearchEntry.vue";
-import AppShare from "./components/app/Share.vue";
-import AppShortcuts from "./components/app/Shortcuts.vue";
-import AppShortcutsEntry from "./components/app/ShortcutsEntry.vue";
-import AppSidenav from "./components/app/Sidenav.vue";
-import AppSlideOver from "./components/app/SlideOver.vue";
-import AppSupport from "./components/app/Support.vue";
-import ButtonPrimary from "./components/button/Primary.vue";
-import ButtonSecondary from "./components/button/Secondary.vue";
-import CollectionsAdd from "./components/collections/Add.vue";
-import CollectionsAddFolder from "./components/collections/AddFolder.vue";
-import CollectionsAddRequest from "./components/collections/AddRequest.vue";
-import CollectionsChooseType from "./components/collections/ChooseType.vue";
-import CollectionsEdit from "./components/collections/Edit.vue";
-import CollectionsEditFolder from "./components/collections/EditFolder.vue";
-import CollectionsEditRequest from "./components/collections/EditRequest.vue";
-import CollectionsImportExport from "./components/collections/ImportExport.vue";
-import CollectionsSaveRequest from "./components/collections/SaveRequest.vue";
-import CollectionsGraphqlAdd from "./components/collections/graphql/Add.vue";
-import CollectionsGraphqlAddFolder from "./components/collections/graphql/AddFolder.vue";
-import CollectionsGraphqlAddRequest from "./components/collections/graphql/AddRequest.vue";
-import CollectionsGraphqlCollection from "./components/collections/graphql/Collection.vue";
-import CollectionsGraphqlEdit from "./components/collections/graphql/Edit.vue";
-import CollectionsGraphqlEditFolder from "./components/collections/graphql/EditFolder.vue";
-import CollectionsGraphqlEditRequest from "./components/collections/graphql/EditRequest.vue";
-import CollectionsGraphqlFolder from "./components/collections/graphql/Folder.vue";
-import CollectionsGraphqlImportExport from "./components/collections/graphql/ImportExport.vue";
-import CollectionsGraphqlRequest from "./components/collections/graphql/Request.vue";
-import CollectionsGraphql from "./components/collections/graphql/index.vue";
-import Collections from "./components/collections/index.vue";
-import CollectionsMyCollection from "./components/collections/my/Collection.vue";
-import CollectionsMyFolder from "./components/collections/my/Folder.vue";
-import CollectionsMyRequest from "./components/collections/my/Request.vue";
-import CollectionsTeamsCollection from "./components/collections/teams/Collection.vue";
-import CollectionsTeamsFolder from "./components/collections/teams/Folder.vue";
-import CollectionsTeamsRequest from "./components/collections/teams/Request.vue";
-import DocsCollection from "./components/docs/Collection.vue";
-import DocsFolder from "./components/docs/Folder.vue";
-import DocsRequest from "./components/docs/Request.vue";
-import EnvironmentsDetails from "./components/environments/Details.vue";
-import EnvironmentsEnvironment from "./components/environments/Environment.vue";
-import EnvironmentsImportExport from "./components/environments/ImportExport.vue";
-import Environments from "./components/environments/index.vue";
-import FirebaseLogin from "./components/firebase/Login.vue";
-import FirebaseLogout from "./components/firebase/Logout.vue";
-import GraphqlAuthorization from "./components/graphql/Authorization.vue";
-import GraphqlField from "./components/graphql/Field.vue";
-import GraphqlRequest from "./components/graphql/Request.vue";
-import GraphqlRequestOptions from "./components/graphql/RequestOptions.vue";
-import GraphqlResponse from "./components/graphql/Response.vue";
-import GraphqlSidebar from "./components/graphql/Sidebar.vue";
-import GraphqlType from "./components/graphql/Type.vue";
-import GraphqlTypeLink from "./components/graphql/TypeLink.vue";
-import HistoryGraphqlCard from "./components/history/graphql/Card.vue";
-import History from "./components/history/index.vue";
-import HistoryRestCard from "./components/history/rest/Card.vue";
-import HttpAuthorization from "./components/http/Authorization.vue";
-import HttpBody from "./components/http/Body.vue";
-import HttpBodyParameters from "./components/http/BodyParameters.vue";
-import HttpCodegenModal from "./components/http/CodegenModal.vue";
-import HttpHeaders from "./components/http/Headers.vue";
-import HttpImportCurl from "./components/http/ImportCurl.vue";
-import HttpOAuth2Authorization from "./components/http/OAuth2Authorization.vue";
-import HttpParameters from "./components/http/Parameters.vue";
-import HttpPreRequestScript from "./components/http/PreRequestScript.vue";
-import HttpRawBody from "./components/http/RawBody.vue";
-import HttpReqChangeConfirmModal from "./components/http/ReqChangeConfirmModal.vue";
-import HttpRequest from "./components/http/Request.vue";
-import HttpRequestOptions from "./components/http/RequestOptions.vue";
-import HttpResponse from "./components/http/Response.vue";
-import HttpResponseMeta from "./components/http/ResponseMeta.vue";
-import HttpSidebar from "./components/http/Sidebar.vue";
-import HttpTestResult from "./components/http/TestResult.vue";
-import HttpTestResultEntry from "./components/http/TestResultEntry.vue";
-import HttpTestResultEnv from "./components/http/TestResultEnv.vue";
-import HttpTestResultReport from "./components/http/TestResultReport.vue";
-import HttpTests from "./components/http/Tests.vue";
-import HttpURLEncodedParams from "./components/http/URLEncodedParams.vue";
-import LensesHeadersRenderer from "./components/lenses/HeadersRenderer.vue";
-import LensesHeadersRendererEntry from "./components/lenses/HeadersRendererEntry.vue";
-import LensesResponseBodyRenderer from "./components/lenses/ResponseBodyRenderer.vue";
-import LensesRenderersHTMLLensRenderer from "./components/lenses/renderers/HTMLLensRenderer.vue";
-import LensesRenderersImageLensRenderer from "./components/lenses/renderers/ImageLensRenderer.vue";
-import LensesRenderersJSONLensRenderer from "./components/lenses/renderers/JSONLensRenderer.vue";
-import LensesRenderersPDFLensRenderer from "./components/lenses/renderers/PDFLensRenderer.vue";
-import LensesRenderersRawLensRenderer from "./components/lenses/renderers/RawLensRenderer.vue";
-import LensesRenderersXMLLensRenderer from "./components/lenses/renderers/XMLLensRenderer.vue";
-import ProfilePicture from "./components/profile/Picture.vue";
-import ProfileShortcode from "./components/profile/Shortcode.vue";
-import RealtimeCommunication from "./components/realtime/Communication.vue";
-import RealtimeLog from "./components/realtime/Log.vue";
-import RealtimeLogEntry from "./components/realtime/LogEntry.vue";
-import SmartAccentModePicker from "./components/smart/AccentModePicker.vue";
-import SmartAnchor from "./components/smart/Anchor.vue";
-import SmartAutoComplete from "./components/smart/AutoComplete.vue";
-import SmartChangeLanguage from "./components/smart/ChangeLanguage.vue";
-import SmartCheckbox from "./components/smart/Checkbox.vue";
-import SmartColorModePicker from "./components/smart/ColorModePicker.vue";
-import SmartConfirmModal from "./components/smart/ConfirmModal.vue";
-import SmartEnvInput from "./components/smart/EnvInput.vue";
-import SmartExpand from "./components/smart/Expand.vue";
-import SmartFileChip from "./components/smart/FileChip.vue";
-import SmartFontSizePicker from "./components/smart/FontSizePicker.vue";
-import SmartIcon from "./components/smart/Icon.vue";
-import SmartIntersection from "./components/smart/Intersection.vue";
-import SmartItem from "./components/smart/Item.vue";
-import SmartLoadingIndicator from "./components/smart/LoadingIndicator.vue";
-import SmartModal from "./components/smart/Modal.vue";
-import SmartProgressRing from "./components/smart/ProgressRing.vue";
-import SmartRadio from "./components/smart/Radio.vue";
-import SmartRadioGroup from "./components/smart/RadioGroup.vue";
-import SmartSpinner from "./components/smart/Spinner.vue";
-import SmartTab from "./components/smart/Tab.vue";
-import SmartTabs from "./components/smart/Tabs.vue";
-import SmartToggle from "./components/smart/Toggle.vue";
-import TabPrimary from "./components/tab/Primary.vue";
-import TabSecondary from "./components/tab/Secondary.vue";
-import TeamsAdd from "./components/teams/Add.vue";
-import TeamsEdit from "./components/teams/Edit.vue";
-import TeamsInvite from "./components/teams/Invite.vue";
-import TeamsModal from "./components/teams/Modal.vue";
-import TeamsTeam from "./components/teams/Team.vue";
-import Teams from "./components/teams/index.vue";
-declare global {
-    interface __VLS_GlobalComponents {
-        AppAnnouncement: typeof AppAnnouncement;
-        AppDeveloperOptions: typeof AppDeveloperOptions;
-        AppFooter: typeof AppFooter;
-        AppFuse: typeof AppFuse;
-        AppGitHubStarButton: typeof AppGitHubStarButton;
-        AppHeader: typeof AppHeader;
-        AppInterceptor: typeof AppInterceptor;
-        AppLogo: typeof AppLogo;
-        AppOptions: typeof AppOptions;
-        AppPaneLayout: typeof AppPaneLayout;
-        AppPowerSearch: typeof AppPowerSearch;
-        AppPowerSearchEntry: typeof AppPowerSearchEntry;
-        AppShare: typeof AppShare;
-        AppShortcuts: typeof AppShortcuts;
-        AppShortcutsEntry: typeof AppShortcutsEntry;
-        AppSidenav: typeof AppSidenav;
-        AppSlideOver: typeof AppSlideOver;
-        AppSupport: typeof AppSupport;
-        ButtonPrimary: typeof ButtonPrimary;
-        ButtonSecondary: typeof ButtonSecondary;
-        CollectionsAdd: typeof CollectionsAdd;
-        CollectionsAddFolder: typeof CollectionsAddFolder;
-        CollectionsAddRequest: typeof CollectionsAddRequest;
-        CollectionsChooseType: typeof CollectionsChooseType;
-        CollectionsEdit: typeof CollectionsEdit;
-        CollectionsEditFolder: typeof CollectionsEditFolder;
-        CollectionsEditRequest: typeof CollectionsEditRequest;
-        CollectionsImportExport: typeof CollectionsImportExport;
-        CollectionsSaveRequest: typeof CollectionsSaveRequest;
-        CollectionsGraphqlAdd: typeof CollectionsGraphqlAdd;
-        CollectionsGraphqlAddFolder: typeof CollectionsGraphqlAddFolder;
-        CollectionsGraphqlAddRequest: typeof CollectionsGraphqlAddRequest;
-        CollectionsGraphqlCollection: typeof CollectionsGraphqlCollection;
-        CollectionsGraphqlEdit: typeof CollectionsGraphqlEdit;
-        CollectionsGraphqlEditFolder: typeof CollectionsGraphqlEditFolder;
-        CollectionsGraphqlEditRequest: typeof CollectionsGraphqlEditRequest;
-        CollectionsGraphqlFolder: typeof CollectionsGraphqlFolder;
-        CollectionsGraphqlImportExport: typeof CollectionsGraphqlImportExport;
-        CollectionsGraphqlRequest: typeof CollectionsGraphqlRequest;
-        CollectionsGraphql: typeof CollectionsGraphql;
-        Collections: typeof Collections;
-        CollectionsMyCollection: typeof CollectionsMyCollection;
-        CollectionsMyFolder: typeof CollectionsMyFolder;
-        CollectionsMyRequest: typeof CollectionsMyRequest;
-        CollectionsTeamsCollection: typeof CollectionsTeamsCollection;
-        CollectionsTeamsFolder: typeof CollectionsTeamsFolder;
-        CollectionsTeamsRequest: typeof CollectionsTeamsRequest;
-        DocsCollection: typeof DocsCollection;
-        DocsFolder: typeof DocsFolder;
-        DocsRequest: typeof DocsRequest;
-        EnvironmentsDetails: typeof EnvironmentsDetails;
-        EnvironmentsEnvironment: typeof EnvironmentsEnvironment;
-        EnvironmentsImportExport: typeof EnvironmentsImportExport;
-        Environments: typeof Environments;
-        FirebaseLogin: typeof FirebaseLogin;
-        FirebaseLogout: typeof FirebaseLogout;
-        GraphqlAuthorization: typeof GraphqlAuthorization;
-        GraphqlField: typeof GraphqlField;
-        GraphqlRequest: typeof GraphqlRequest;
-        GraphqlRequestOptions: typeof GraphqlRequestOptions;
-        GraphqlResponse: typeof GraphqlResponse;
-        GraphqlSidebar: typeof GraphqlSidebar;
-        GraphqlType: typeof GraphqlType;
-        GraphqlTypeLink: typeof GraphqlTypeLink;
-        HistoryGraphqlCard: typeof HistoryGraphqlCard;
-        History: typeof History;
-        HistoryRestCard: typeof HistoryRestCard;
-        HttpAuthorization: typeof HttpAuthorization;
-        HttpBody: typeof HttpBody;
-        HttpBodyParameters: typeof HttpBodyParameters;
-        HttpCodegenModal: typeof HttpCodegenModal;
-        HttpHeaders: typeof HttpHeaders;
-        HttpImportCurl: typeof HttpImportCurl;
-        HttpOAuth2Authorization: typeof HttpOAuth2Authorization;
-        HttpParameters: typeof HttpParameters;
-        HttpPreRequestScript: typeof HttpPreRequestScript;
-        HttpRawBody: typeof HttpRawBody;
-        HttpReqChangeConfirmModal: typeof HttpReqChangeConfirmModal;
-        HttpRequest: typeof HttpRequest;
-        HttpRequestOptions: typeof HttpRequestOptions;
-        HttpResponse: typeof HttpResponse;
-        HttpResponseMeta: typeof HttpResponseMeta;
-        HttpSidebar: typeof HttpSidebar;
-        HttpTestResult: typeof HttpTestResult;
-        HttpTestResultEntry: typeof HttpTestResultEntry;
-        HttpTestResultEnv: typeof HttpTestResultEnv;
-        HttpTestResultReport: typeof HttpTestResultReport;
-        HttpTests: typeof HttpTests;
-        HttpURLEncodedParams: typeof HttpURLEncodedParams;
-        LensesHeadersRenderer: typeof LensesHeadersRenderer;
-        LensesHeadersRendererEntry: typeof LensesHeadersRendererEntry;
-        LensesResponseBodyRenderer: typeof LensesResponseBodyRenderer;
-        LensesRenderersHTMLLensRenderer: typeof LensesRenderersHTMLLensRenderer;
-        LensesRenderersImageLensRenderer: typeof LensesRenderersImageLensRenderer;
-        LensesRenderersJSONLensRenderer: typeof LensesRenderersJSONLensRenderer;
-        LensesRenderersPDFLensRenderer: typeof LensesRenderersPDFLensRenderer;
-        LensesRenderersRawLensRenderer: typeof LensesRenderersRawLensRenderer;
-        LensesRenderersXMLLensRenderer: typeof LensesRenderersXMLLensRenderer;
-        ProfilePicture: typeof ProfilePicture;
-        ProfileShortcode: typeof ProfileShortcode;
-        RealtimeCommunication: typeof RealtimeCommunication;
-        RealtimeLog: typeof RealtimeLog;
-        RealtimeLogEntry: typeof RealtimeLogEntry;
-        SmartAccentModePicker: typeof SmartAccentModePicker;
-        SmartAnchor: typeof SmartAnchor;
-        SmartAutoComplete: typeof SmartAutoComplete;
-        SmartChangeLanguage: typeof SmartChangeLanguage;
-        SmartCheckbox: typeof SmartCheckbox;
-        SmartColorModePicker: typeof SmartColorModePicker;
-        SmartConfirmModal: typeof SmartConfirmModal;
-        SmartEnvInput: typeof SmartEnvInput;
-        SmartExpand: typeof SmartExpand;
-        SmartFileChip: typeof SmartFileChip;
-        SmartFontSizePicker: typeof SmartFontSizePicker;
-        SmartIcon: typeof SmartIcon;
-        SmartIntersection: typeof SmartIntersection;
-        SmartItem: typeof SmartItem;
-        SmartLoadingIndicator: typeof SmartLoadingIndicator;
-        SmartModal: typeof SmartModal;
-        SmartProgressRing: typeof SmartProgressRing;
-        SmartRadio: typeof SmartRadio;
-        SmartRadioGroup: typeof SmartRadioGroup;
-        SmartSpinner: typeof SmartSpinner;
-        SmartTab: typeof SmartTab;
-        SmartTabs: typeof SmartTabs;
-        SmartToggle: typeof SmartToggle;
-        TabPrimary: typeof TabPrimary;
-        TabSecondary: typeof TabSecondary;
-        TeamsAdd: typeof TeamsAdd;
-        TeamsEdit: typeof TeamsEdit;
-        TeamsInvite: typeof TeamsInvite;
-        TeamsModal: typeof TeamsModal;
-        TeamsTeam: typeof TeamsTeam;
-        Teams: typeof Teams;
-    }
-}

+ 0 - 34
packages/hoppscotch-app/src/main.ts

@@ -1,34 +0,0 @@
-import { createApp } from "vue"
-import { setupLocalPersistence } from "./newstore/localpersistence"
-import { performMigrations } from "./helpers/migrations"
-import { initializeFirebase } from "./helpers/fb"
-import { initUserInfo } from "./helpers/teams/BackendUserInfo"
-import { HOPP_MODULES } from "@modules/."
-
-import "virtual:windi.css"
-import "../assets/scss/themes.scss"
-import "../assets/scss/styles.scss"
-import "nprogress/nprogress.css"
-
-import App from "./App.vue"
-
-const app = createApp(App)
-
-// Some basic work that needs to be done before module inits even
-initializeFirebase()
-setupLocalPersistence()
-performMigrations()
-initUserInfo()
-
-HOPP_MODULES.forEach((mod) => mod.onVueAppInit?.(app))
-
-app.mount("#app")
-
-console.info(
-  "%cWe ❤︎ open source!",
-  "background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
-)
-console.info(
-  "%cContribute: https://github.com/hoppscotch/hoppscotch",
-  "background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;"
-)

+ 2 - 0
packages/hoppscotch-app/.eslintrc.js → packages/hoppscotch-common/.eslintrc.js

@@ -36,6 +36,8 @@ module.exports = {
     "vue/no-side-effects-in-computed-properties": "off",
     "import/no-named-as-default": "off",
     "import/no-named-as-default-member": "off",
+    "@typescript-eslint/no-unused-vars":
+      process.env.HOPP_LINT_FOR_PROD === "true" ? "error" : "warn",
     "@typescript-eslint/no-non-null-assertion": "off",
     "@typescript-eslint/no-explicit-any": "off",
     "import/default": "off",

Some files were not shown because too many files changed in this diff