Skip to content

Commit

Permalink
transformed to GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
itswadesh committed Apr 26, 2022
1 parent 8693150 commit 3bbfb0a
Show file tree
Hide file tree
Showing 150 changed files with 100,507 additions and 2,554 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
WWW_URL=http://localhost:3000
LIVE_KEY=D:/ssh/node-server.pem
VITE_DOMAIN=food.misiki.in
42 changes: 37 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,50 @@ module.exports = {
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
// Some preference rules by KitQL
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-console': ['error', { allow: ['info', 'warn', 'error', 'time', 'timeEnd'] }]
},
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
overrides: [
{ files: ['*.svelte'], processor: 'svelte3/svelte3' },
{
files: ['*.graphql', '*.gql'],
parserOptions: {
operations: '**/*.gql',
schema: '**/*.graphql'
},
// Enable all rules
extends: ['plugin:@graphql-eslint/schema-all', 'plugin:@graphql-eslint/operations-all'],
// Some preference rules by KitQL
rules: {
'@graphql-eslint/alphabetize': 'off',
'@graphql-eslint/match-document-filename': [
'error',
{
query: { style: 'PascalCase', suffix: '_QUERY' },
mutation: { style: 'PascalCase', suffix: '_MUTATION' },
subscription: { style: 'PascalCase', suffix: '_SUB' },
fragment: { style: 'PascalCase', suffix: '_FRAG' }
}
],
'@graphql-eslint/no-unused-fields': 'error',
'@graphql-eslint/unique-enum-value-names': 'error',
'@graphql-eslint/require-id-when-available': 'error'
}
}
],
settings: {
'svelte3/typescript': () => require('typescript'),
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true,
},
node: true
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.env
.DS_Store
node_modules
/.svelte
Expand Down
29 changes: 29 additions & 0 deletions .graphqlrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Typical File for extension: vscode-graphql & CodeGen!
projects:
default:
schema:
- ./src/lib/graphql/schema.json # or https://localhost:3777/graphql
documents:
- '**/*.gql'
extensions:
endpoints:
default:
url: https://localhost:3000/graphql
codegen:
generates:
./src/lib/graphql/_kitql/graphqlTypes.ts:
plugins:
- typescript
- typescript-operations
- typed-document-node
- typescript-document-nodes

./src/lib/graphql/_kitql/graphqlStores.ts:
plugins:
- '@kitql/graphql-codegen'
config:
importBaseTypesFrom: $lib/graphql/_kitql/graphqlTypes
operationPrefix: 'KQL_'

config:
useTypeImports: true
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"svelteSortOrder": "options-styles-scripts-markup",
"svelteStrictMode": true,
"svelteBracketNewLine": false,
Expand Down
4 changes: 2 additions & 2 deletions _redirects
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/api/* https://api.litekart.in/api/:splat 200
/images/* https://api.litekart.in/images/:splat 200
/api/_ https://api.misiki.in/api/:splat 200
/images/_ https://api.misiki.in/images/:splat 200
40 changes: 0 additions & 40 deletions config/index.ts

This file was deleted.

110 changes: 55 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,80 @@
"name": "svelte-commerce",
"version": "0.0.2",
"scripts": {
"dev": "svelte-kit dev --host",
"build": "set NODE_ENV=production && svelte-kit build",
"dev": "svelte-kit dev",
"gen": "graphql-codegen --config ./.graphqlrc.yaml",
"build": "svelte-kit build",
"package": "svelte-kit package",
"preview": "svelte-kit preview",
"lint": "prettier --check . && eslint --ignore-path .gitignore .",
"format": "prettier --write .",
"start": "cross-env NODE_ENV=production node .",
"copy": "node devops/copy.js",
"live": "run-s build copy liveS",
"liveS": "node devops/live.js",
"format:check": "prettier --check './**/*.{js,ts,css,html,svelte}'"
"quality": "npm run quality:eslint && npm run quality:prettier && npm run quality:ts",
"quality:fix": "prettier --ignore-path .gitignore --write --plugin-search-dir=. . && npm run quality:eslint --fix",
"quality:eslint": "eslint --ignore-path .gitignore .",
"quality:prettier": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .",
"quality:ts": "svelte-check --tsconfig ./tsconfig.json",
"quality:ts:w": "npm run quality:ts --watch",
"update": "npm exec -- npx ncu -u -p yarn"
},
"devDependencies": {
"@apollo/client": "^3.4.10",
"@sveltejs/adapter-begin": "^1.0.0-next.11",
"@sveltejs/adapter-netlify": "^1.0.0-next.25",
"@sveltejs/adapter-node": "^1.0.0-next.35",
"@sveltejs/adapter-static": "^1.0.0-next.13",
"@sveltejs/adapter-vercel": "^1.0.0-next.26",
"@sveltejs/kit": "1.0.0-next.159",
"@tailwindcss/forms": "^0.3.3",
"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "next",
"@tailwindcss/forms": "^0.5.0",
"@tailwindcss/jit": "^0.1.1",
"@tailwindcss/line-clamp": "^0.2.1",
"@tailwindcss/typography": "^0.4.1",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"autoprefixer": "^10.3.3",
"concurrently": "^6.2.1",
"@tailwindcss/line-clamp": "^0.3.1",
"@tailwindcss/typography": "^0.5.2",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"autoprefixer": "^10.4.5",
"concurrently": "^7.1.0",
"cookie-universal": "^2.1.5",
"cssnano": "^5.0.8",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0",
"cssnano": "^5.1.7",
"eslint": "^8.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.1.5",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-svelte3": "^3.2.0",
"graphql": "^15.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-svelte3": "^3.4.1",
"graphql": "^16.4.0",
"graphql-tag": "^2.12.6",
"npm-run-all": "^4.1.5",
"postcss": "^8.3.6",
"postcss-cli": "^8.3.1",
"postcss-load-config": "^3.1.0",
"prettier": "^2.3.2",
"prettier-plugin-svelte": "^2.4.0",
"shelljs": "^0.8.4",
"postcss": "^8.4.12",
"postcss-cli": "^9.1.0",
"postcss-load-config": "^3.1.4",
"prettier": "^2.6.2",
"prettier-plugin-svelte": "^2.7.0",
"shelljs": "^0.8.5",
"siema": "^1.5.1",
"ssh2shell": "^1.9.5",
"svelte": "^3.42.4",
"svelte-apollo": "^0.4.0",
"ssh2shell": "^1.9.10",
"svelte": "^3.47.0",
"svelte-debugger": "^1.0.5",
"svelte-hero-icons": "^2.4.0",
"svelte-preprocess": "^4.8.0",
"svelte-swipe": "^1.8.1",
"svelte-hero-icons": "^4.1.1",
"svelte-preprocess": "^4.10.6",
"svelte-swipe": "^1.8.2",
"svelte-toasts": "^1.1.2",
"tailwindcss": "^2.2.8",
"tailwindcss-rtl": "^0.7.3",
"tslib": "^2.3.1",
"typescript": "^4.4.2",
"vite": "^2.5.1"
"tailwind-scrollbar": "^1.3.1",
"tailwindcss": "^3.0.24",
"tailwindcss-rtl": "^0.9.0",
"tslib": "^2.4.0",
"typescript": "^4.6.3"
},
"type": "module",
"engines": {
"node": ">= 12.0.0"
},
"dependencies": {
"@fontsource/fira-mono": "^4.5.0",
"@beyonk/async-script-loader": "^2.0.0",
"@fontsource/fira-mono": "^4.5.8",
"@kitql/all-in": "0.6.3",
"@lukeed/uuid": "^2.0.0",
"cookie": "^0.4.1",
"graphql": "16.3.0",
"graphql-tag": "^2.12.6",
"cookie": "^0.5.0",
"cross-env": "^7.0.3",
"dayjs": "^1.10.6",
"dotenv": "^10.0.0",
"fathom-client": "^3.1.0",
"dayjs": "^1.11.1",
"fathom-client": "^3.4.1",
"hash-it": "^5.0.2",
"node-fetch": "^2.6.1",
"node-fetch": "^3.2.3",
"universal-cookie": "^4.0.4"
}
}
25 changes: 20 additions & 5 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
module.exports = {
plugins: {
autoprefixer: {},
tailwindcss: {},
},
const tailwindcss = require('tailwindcss')
const autoprefixer = require('autoprefixer')
const cssnano = require('cssnano')

const mode = process.env.NODE_ENV
const dev = mode === 'development'

const config = {
plugins: [
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
tailwindcss(),
//But others, like autoprefixer, need to run after,
autoprefixer(),
!dev &&
cssnano({
preset: 'default',
}),
],
}

module.exports = config
28 changes: 28 additions & 0 deletions src/actions/svelte-quill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Quill from 'quill'

export function quill(node, options) {
const quill = new Quill(node, {
modules: {
toolbar: [
[{ header: [1, 2, 3, false] }],
['bold', 'italic', 'underline', 'strike'],
['link', 'code-block'],
],
},
placeholder: 'Type something...',
theme: 'snow', // or 'bubble'
...options,
})
const container = node.getElementsByClassName('ql-editor')[0]

quill.on('text-change', function (delta, oldDelta, source) {
node.dispatchEvent(
new CustomEvent('text-change', {
detail: {
html: container.innerHTML,
text: quill.getText(),
},
})
)
})
}
Loading

0 comments on commit 3bbfb0a

Please sign in to comment.