Compare commits

..

1 Commits

Author SHA1 Message Date
amk-dev
f98687da7b chore: remove @lezer/highlight from hoppscotch-ui 2023-11-02 20:10:42 +05:30
20 changed files with 923 additions and 1110 deletions

View File

@@ -17,8 +17,8 @@
"types": "dist/index.d.ts",
"sideEffects": false,
"dependencies": {
"@codemirror/language": "^6.9.2",
"@lezer/highlight": "1.1.4",
"@codemirror/language": "^6.9.1",
"@lezer/highlight": "^1.1.6",
"@lezer/lr": "^1.3.13"
},
"devDependencies": {

View File

@@ -74,7 +74,7 @@ export class AdminService {
try {
await this.mailerService.sendUserInvitationEmail(inviteeEmail, {
template: 'user-invitation',
template: 'code-your-own',
variables: {
inviteeEmail: inviteeEmail,
magicLink: `${process.env.VITE_BASE_URL}`,

View File

@@ -229,7 +229,7 @@ export class AuthService {
}
await this.mailerService.sendEmail(email, {
template: 'user-invitation',
template: 'code-your-own',
variables: {
inviteeEmail: email,
magicLink: `${url}/enter?token=${generatedTokens.token}`,

View File

@@ -8,7 +8,7 @@ export type MailDescription = {
};
export type UserMagicLinkMailDescription = {
template: 'user-invitation';
template: 'code-your-own';
variables: {
inviteeEmail: string;
magicLink: string;
@@ -16,7 +16,7 @@ export type UserMagicLinkMailDescription = {
};
export type AdminUserInvitationMailDescription = {
template: 'user-invitation';
template: 'code-your-own';
variables: {
inviteeEmail: string;
magicLink: string;

View File

@@ -27,7 +27,7 @@ export class MailerService {
case 'team-invitation':
return `${mailDesc.variables.invitee} invited you to join ${mailDesc.variables.invite_team_name} in Hoppscotch`;
case 'user-invitation':
case 'code-your-own':
return 'Sign in to Hoppscotch';
}
}

View File

@@ -14,7 +14,7 @@
-->
<style type="text/css" rel="stylesheet" media="all">
/* Base ------------------------------ */
@import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap");
body {
width: 100% !important;
@@ -22,19 +22,19 @@
margin: 0;
-webkit-text-size-adjust: none;
}
a {
color: #3869D4;
}
a img {
border: none;
}
td {
word-break: break-word;
}
.preheader {
display: none !important;
visibility: hidden;
@@ -47,13 +47,13 @@
overflow: hidden;
}
/* Type ------------------------------ */
body,
td,
th {
font-family: "Nunito Sans", Helvetica, Arial, sans-serif;
}
h1 {
margin-top: 0;
color: #333333;
@@ -61,7 +61,7 @@
font-weight: bold;
text-align: left;
}
h2 {
margin-top: 0;
color: #333333;
@@ -69,7 +69,7 @@
font-weight: bold;
text-align: left;
}
h3 {
margin-top: 0;
color: #333333;
@@ -77,12 +77,12 @@
font-weight: bold;
text-align: left;
}
td,
th {
font-size: 16px;
}
p,
ul,
ol,
@@ -91,25 +91,25 @@
font-size: 16px;
line-height: 1.625;
}
p.sub {
font-size: 13px;
}
/* Utilities ------------------------------ */
.align-right {
text-align: right;
}
.align-left {
text-align: left;
}
.align-center {
text-align: center;
}
/* Buttons ------------------------------ */
.button {
background-color: #3869D4;
border-top: 10px solid #3869D4;
@@ -124,7 +124,7 @@
-webkit-text-size-adjust: none;
box-sizing: border-box;
}
.button--green {
background-color: #22BC66;
border-top: 10px solid #22BC66;
@@ -132,7 +132,7 @@
border-bottom: 10px solid #22BC66;
border-left: 18px solid #22BC66;
}
.button--red {
background-color: #FF6136;
border-top: 10px solid #FF6136;
@@ -140,7 +140,7 @@
border-bottom: 10px solid #FF6136;
border-left: 18px solid #FF6136;
}
@media only screen and (max-width: 500px) {
.button {
width: 100% !important;
@@ -148,21 +148,21 @@
}
}
/* Attribute list ------------------------------ */
.attributes {
margin: 0 0 21px;
}
.attributes_content {
background-color: #F4F4F7;
padding: 16px;
}
.attributes_item {
padding: 0;
}
/* Related Items ------------------------------ */
.related {
width: 100%;
margin: 0;
@@ -171,31 +171,31 @@
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
}
.related_item {
padding: 10px 0;
color: #CBCCCF;
font-size: 15px;
line-height: 18px;
}
.related_item-title {
display: block;
margin: .5em 0 0;
}
.related_item-thumb {
display: block;
padding-bottom: 10px;
}
.related_heading {
border-top: 1px solid #CBCCCF;
text-align: center;
padding: 25px 0 10px;
}
/* Discount Code ------------------------------ */
.discount {
width: 100%;
margin: 0;
@@ -206,33 +206,33 @@
background-color: #F4F4F7;
border: 2px dashed #CBCCCF;
}
.discount_heading {
text-align: center;
}
.discount_body {
text-align: center;
font-size: 15px;
}
/* Social Icons ------------------------------ */
.social {
width: auto;
}
.social td {
padding: 0;
width: auto;
}
.social_icon {
height: 20px;
margin: 0 8px 10px 8px;
padding: 0;
}
/* Data table ------------------------------ */
.purchase {
width: 100%;
margin: 0;
@@ -241,7 +241,7 @@
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
}
.purchase_content {
width: 100%;
margin: 0;
@@ -250,50 +250,50 @@
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
}
.purchase_item {
padding: 10px 0;
color: #51545E;
font-size: 15px;
line-height: 18px;
}
.purchase_heading {
padding-bottom: 8px;
border-bottom: 1px solid #EAEAEC;
}
.purchase_heading p {
margin: 0;
color: #85878E;
font-size: 12px;
}
.purchase_footer {
padding-top: 15px;
border-top: 1px solid #EAEAEC;
}
.purchase_total {
margin: 0;
text-align: right;
font-weight: bold;
color: #333333;
}
.purchase_total--label {
padding: 0 15px 0 0;
}
body {
background-color: #F2F4F6;
color: #51545E;
}
p {
color: #51545E;
}
.email-wrapper {
width: 100%;
margin: 0;
@@ -303,7 +303,7 @@
-premailer-cellspacing: 0;
background-color: #F2F4F6;
}
.email-content {
width: 100%;
margin: 0;
@@ -313,16 +313,16 @@
-premailer-cellspacing: 0;
}
/* Masthead ----------------------- */
.email-masthead {
padding: 25px 0;
text-align: center;
}
.email-masthead_logo {
width: 94px;
}
.email-masthead_name {
font-size: 16px;
font-weight: bold;
@@ -331,7 +331,7 @@
text-shadow: 0 1px 0 white;
}
/* Body ------------------------------ */
.email-body {
width: 100%;
margin: 0;
@@ -340,7 +340,7 @@
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
}
.email-body_inner {
width: 570px;
margin: 0 auto;
@@ -350,7 +350,7 @@
-premailer-cellspacing: 0;
background-color: #FFFFFF;
}
.email-footer {
width: 570px;
margin: 0 auto;
@@ -360,11 +360,11 @@
-premailer-cellspacing: 0;
text-align: center;
}
.email-footer p {
color: #A8AAAF;
}
.body-action {
width: 100%;
margin: 30px auto;
@@ -374,25 +374,25 @@
-premailer-cellspacing: 0;
text-align: center;
}
.body-sub {
margin-top: 25px;
padding-top: 25px;
border-top: 1px solid #EAEAEC;
}
.content-cell {
padding: 45px;
}
/*Media Queries ------------------------------ */
@media only screen and (max-width: 600px) {
.email-body_inner,
.email-footer {
width: 100% !important;
}
}
@media (prefers-color-scheme: dark) {
body,
.email-body,

View File

@@ -17,7 +17,7 @@
"postinstall": "pnpm run gql-codegen",
"do-test": "pnpm run test",
"do-lint": "pnpm run prod-lint",
"do-typecheck": "node type-check.mjs",
"do-typecheck": "pnpm run lint",
"do-lintfix": "pnpm run lintfix"
},
"dependencies": {
@@ -27,12 +27,12 @@
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-xml": "^6.0.2",
"@codemirror/language": "^6.9.2",
"@codemirror/language": "^6.9.1",
"@codemirror/legacy-modes": "^6.3.3",
"@codemirror/lint": "^6.4.2",
"@codemirror/search": "^6.5.4",
"@codemirror/state": "^6.3.1",
"@codemirror/view": "^6.22.0",
"@codemirror/view": "^6.21.3",
"@fontsource-variable/inter": "^5.0.8",
"@fontsource-variable/material-symbols-rounded": "^5.0.7",
"@fontsource-variable/roboto-mono": "^5.0.9",
@@ -41,7 +41,7 @@
"@hoppscotch/js-sandbox": "workspace:^",
"@hoppscotch/ui": "workspace:^",
"@hoppscotch/vue-toasted": "^0.1.0",
"@lezer/highlight": "1.1.4",
"@lezer/highlight": "^1.1.6",
"@urql/core": "^4.1.1",
"@urql/devtools": "^2.0.3",
"@urql/exchange-auth": "^2.1.6",
@@ -136,7 +136,6 @@
"eslint": "^8.47.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.17.0",
"glob": "^10.3.10",
"npm-run-all": "^4.1.5",
"openapi-types": "^12.1.3",
"rollup-plugin-polyfill-node": "^0.12.0",

View File

@@ -18,12 +18,13 @@
"
>
<WorkspaceCurrent :section="t('tab.collections')" />
<input
<HoppSmartInput
v-model="filterTexts"
type="search"
autocomplete="off"
class="flex w-full p-4 py-2 bg-transparent h-8"
:placeholder="t('action.search')"
input-styles="py-2 pl-4 pr-2 bg-transparent !border-0"
type="search"
:autofocus="false"
:disabled="collectionsType.type === 'team-collections'"
/>
</div>

View File

@@ -66,7 +66,7 @@
/>
<HoppSmartTabs
v-model="selectedEnvTab"
:styles="`sticky overflow-x-auto my-2 border border-divider rounded flex-shrink-0 z-10 top-0 bg-primary ${
:styles="`sticky overflow-x-auto my-2 border border-divider rounded flex-shrink-0 z-0 top-0 bg-primary ${
!isTeamSelected || workspace.type === 'personal'
? 'bg-primaryLight'
: ''

View File

@@ -30,8 +30,8 @@
v-model="graphqlFieldsFilterText"
type="search"
autocomplete="off"
class="flex w-full p-4 py-2 bg-transparent h-8"
:placeholder="`${t('action.search')}`"
class="flex flex-1 p-4 py-2 bg-transparent"
/>
<div class="flex">
<HoppButtonSecondary

View File

@@ -9,7 +9,7 @@
v-model="filterText"
type="search"
autocomplete="off"
class="flex w-full p-4 py-2 bg-transparent h-8"
class="flex flex-1 p-4 py-2 bg-transparent"
:placeholder="`${t('action.search')}`"
/>
<div class="flex">

View File

@@ -256,7 +256,7 @@ import * as E from "fp-ts/Either"
import * as O from "fp-ts/Option"
import * as A from "fp-ts/Array"
import draggable from "vuedraggable-es"
import { RESTOptionTabs } from "./RequestOptions.vue"
import { RequestOptionTabs } from "./RequestOptions.vue"
import { useCodemirror } from "@composables/codemirror"
import { commonHeaders } from "~/helpers/headers"
import { useI18n } from "@composables/i18n"
@@ -295,7 +295,7 @@ const deletionToast = ref<{ goAway: (delay: number) => void } | null>(null)
const props = defineProps<{ modelValue: HoppRESTRequest }>()
const emit = defineEmits<{
(e: "change-tab", value: RESTOptionTabs): void
(e: "change-tab", value: RequestOptionTabs): void
(e: "update:modelValue", value: HoppRESTRequest): void
}>()

View File

@@ -35,12 +35,12 @@
v-if="
!teamDetails.loading &&
E.isRight(teamDetails.data) &&
teamDetails.data.right.team?.teamMembers
teamDetails.data.right.team.teamMembers
"
class="border rounded border-divider"
>
<HoppSmartPlaceholder
v-if="teamDetails.data.right.team.teamMembers.length === 0"
v-if="teamDetails.data.right.team.teamMembers === 0"
:src="`/images/states/${colorMode.value}/add_group.svg`"
:alt="`${t('empty.members')}`"
:text="t('empty.members')"

View File

@@ -88,7 +88,7 @@
>
<div
v-for="(invitee, index) in pendingInvites.data.right.team
?.teamInvitations"
.teamInvitations"
:key="`invitee-${index}`"
class="flex divide-x divide-dividerLight"
>
@@ -122,7 +122,7 @@
<HoppSmartPlaceholder
v-if="
E.isRight(pendingInvites.data) &&
pendingInvites.data.right.team?.teamInvitations.length === 0
pendingInvites.data.right.team.teamInvitations.length === 0
"
:text="t('empty.pending_invites')"
>

View File

@@ -6,7 +6,7 @@ import { Ref, onBeforeUnmount, onMounted, reactive, watch } from "vue"
import { BehaviorSubject } from "rxjs"
import { HoppRESTDocument } from "./rest/document"
import { HoppGQLRequest, HoppRESTRequest } from "@hoppscotch/data"
import { RESTOptionTabs } from "~/components/http/RequestOptions.vue"
import { RequestOptionTabs } from "~/components/http/RequestOptions.vue"
import { HoppGQLSaveContext } from "./graphql/document"
import { GQLOptionTabs } from "~/components/graphql/RequestOptions.vue"
import { computed } from "vue"
@@ -113,7 +113,7 @@ type HoppActionArgsMap = {
request: HoppGQLRequest
}
"request.open-tab": {
tab: RESTOptionTabs | GQLOptionTabs
tab: RequestOptionTabs | GQLOptionTabs
}
"tab.duplicate-tab": {

View File

@@ -58,13 +58,7 @@ export const FALLBACK_LANG = pipe(
)
// A reference to the i18n instance
let i18nInstance: I18n<
Record<string, unknown>,
Record<string, unknown>,
Record<string, unknown>,
string,
true
> | null = null
let i18nInstance: I18n<any, any, any> | null = null
const resolveCurrentLocale = () =>
pipe(
@@ -125,6 +119,7 @@ export const changeAppLanguage = async (locale: string) => {
* Returns the i18n instance
*/
export function getI18n() {
// @ts-expect-error Something weird with the i18n errors
return i18nInstance!.global.t
}

View File

@@ -1,92 +0,0 @@
import fs from "fs"
import { glob } from "glob"
import path from "path"
import ts from "typescript"
import vueTsc from "vue-tsc"
import { fileURLToPath } from "url"
/**
* Helper function to find files to perform type check on
*/
const findFilesToPerformTypeCheck = (directoryPaths, filePatterns) => {
const files = []
directoryPaths.forEach((directoryPath) => {
if (!fs.existsSync(directoryPath)) {
console.error(`Directory not found: ${directoryPath}`)
process.exit(1)
}
files.push(
...glob.sync(filePatterns, {
cwd: directoryPath,
ignore: ["**/__tests__/**", "**/*.d.ts"],
absolute: true,
})
)
})
return files
}
// Derive the current file's directory path `__dirname` from the URL of this module `__filename`
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// Define the directory paths and file patterns to perform type checks on
const directoryPaths = [path.resolve(__dirname, "src", "services")]
const filePatterns = ["**/*.ts"]
const tsConfigFileName = path.resolve(__dirname, "tsconfig.json")
const tsConfig = ts.readConfigFile(tsConfigFileName, ts.sys.readFile)
const { options } = ts.parseJsonConfigFileContent(
tsConfig.config,
ts.sys,
__dirname
)
const files = findFilesToPerformTypeCheck(directoryPaths, filePatterns)
const host = ts.createCompilerHost(options)
const program = vueTsc.createProgram({
rootNames: files,
options: { ...options, noEmit: true },
host,
})
// Perform type checking
const diagnostics = ts
.getPreEmitDiagnostics(program)
// Filter diagnostics to include only errors from files in the specified directory
.filter(({ file }) => {
if (!file) {
return false
}
return directoryPaths.some((directoryPath) =>
path.resolve(file.fileName).includes(directoryPath)
)
})
if (!diagnostics.length) {
console.log("Type checking passed.")
// Success
process.exit(0)
}
console.log("TypeScript diagnostics:")
const formatHost = {
getCanonicalFileName: (fileName) => fileName,
getCurrentDirectory: host.getCurrentDirectory,
getNewLine: () => ts.sys.newLine,
}
const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(
diagnostics,
formatHost
)
console.error(formattedDiagnostics)
// Failure
process.exit(1)

View File

@@ -34,16 +34,16 @@
},
"homepage": "https://github.com/hoppscotch/hoppscotch#readme",
"devDependencies": {
"@types/lodash": "^4.14.200",
"@types/lodash": "^4.14.181",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"vite": "^3.2.3"
},
"dependencies": {
"fp-ts": "^2.16.1",
"io-ts": "^2.2.20",
"fp-ts": "^2.11.10",
"io-ts": "^2.2.16",
"lodash": "^4.17.21",
"parser-ts": "^0.7.0",
"parser-ts": "^0.6.16",
"verzod": "^0.1.1",
"zod": "^3.22.4"
"zod": "^3.22.2"
}
}

1752
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff