upgrade-pks

This commit is contained in:
tonyrewin 2022-11-13 09:41:04 +03:00
parent 6595b64af0
commit e9e141b36f
13 changed files with 11019 additions and 10147 deletions

View File

@ -3,5 +3,6 @@ public
*.cjs
src/graphql/*.gen.ts
src/legacy_*
src/components/EditorExample
dist/
.vercel/

View File

@ -2,7 +2,7 @@
[+] hybrid routing ssr/spa
[+] 'expo' pages
[-] layout term usage with an exception
[-] nanostores
[-] less nanostores
[+] inbox
[+] css modules
[+] draft editor

View File

@ -2,7 +2,7 @@ import { defineConfig, AstroUserConfig } from 'astro/config'
import vercel from '@astrojs/vercel/serverless'
import solidJs from '@astrojs/solid-js'
import type { CSSOptions } from 'vite'
import defaultGenerateScopedName from 'postcss-modules/build/generateScopedName'
import { generateScopedNameDefault } from 'postcss-modules/build/scoping'
import { isDev } from './src/utils/config'
import { visualizer } from 'rollup-plugin-visualizer'
@ -16,7 +16,7 @@ const getDevCssClassPrefix = (filename: string): string => {
}
const devGenerateScopedName = (name: string, filename: string, css: string) =>
getDevCssClassPrefix(filename) + '_' + defaultGenerateScopedName(name, filename, css)
getDevCssClassPrefix(filename) + '_' + generateScopedNameDefault(name, filename, css)
const css: CSSOptions = {
preprocessorOptions: {
@ -25,7 +25,7 @@ const css: CSSOptions = {
}
},
modules: {
generateScopedName: isDev ? devGenerateScopedName : defaultGenerateScopedName,
generateScopedName: isDev ? devGenerateScopedName : generateScopedNameDefault,
localsConvention: null
}
}

View File

@ -1,6 +1,6 @@
{
"name": "discoursio-webapp",
"version": "0.5.1",
"version": "0.6.0",
"private": true,
"license": "MIT",
"scripts": {
@ -30,61 +30,61 @@
"vercel-build": "astro build"
},
"dependencies": {
"mailgun.js": "^8.0.1"
"mailgun.js": "^8.0.2"
},
"devDependencies": {
"@astrojs/solid-js": "^1.1.0",
"@astrojs/vercel": "^2.1.0",
"@babel/core": "^7.18.13",
"@graphql-codegen/cli": "^2.12.1",
"@graphql-codegen/typescript": "^2.7.3",
"@graphql-codegen/typescript-operations": "^2.5.3",
"@graphql-codegen/typescript-urql": "^3.7.0",
"@astrojs/solid-js": "^1.2.2",
"@astrojs/vercel": "^2.3.3",
"@babel/core": "^7.20.2",
"@graphql-codegen/cli": "^2.13.11",
"@graphql-codegen/typescript": "^2.8.1",
"@graphql-codegen/typescript-operations": "^2.5.6",
"@graphql-codegen/typescript-urql": "^3.7.3",
"@graphql-codegen/urql-introspection": "^2.2.1",
"@graphql-tools/url-loader": "^7.16.4",
"@graphql-tools/url-loader": "^7.16.15",
"@graphql-typed-document-node/core": "^3.1.1",
"@nanostores/persistent": "^0.7.0",
"@nanostores/router": "^0.7.0",
"@nanostores/solid": "^0.3.0",
"@popperjs/core": "^2.11.6",
"@solid-devtools/debugger": "^0.13.1",
"@solid-devtools/logger": "^0.4.9",
"@solid-primitives/memo": "^1.0.2",
"@solid-devtools/debugger": "^0.14.0",
"@solid-devtools/logger": "^0.5.0",
"@solid-primitives/memo": "^1.1.2",
"@solid-primitives/storage": "^1.3.3",
"@types/express": "^4.17.14",
"@types/node": "^18.7.19",
"@types/node": "^18.11.9",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.35.1",
"@urql/core": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@urql/core": "^3.0.5",
"@urql/devtools": "^2.0.3",
"@urql/exchange-auth": "^1.0.0",
"@urql/exchange-graphcache": "^5.0.0",
"astro": "^1.1.1",
"@urql/exchange-graphcache": "^5.0.5",
"astro": "^1.6.7",
"astro-eslint-parser": "^0.9.0",
"bcryptjs": "^2.4.3",
"bootstrap": "5.1.3",
"clsx": "^1.2.1",
"cookie": "^0.5.0",
"cookie-signature": "^1.2.0",
"eslint": "^8.26.0",
"eslint": "^8.27.0",
"eslint-config-stylelint": "^17.0.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-astro": "^0.21.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-promise": "^6.0.1",
"eslint-plugin-solid": "^0.7.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-solid": "^0.8.0",
"eslint-plugin-sonarjs": "^0.16.0",
"eslint-plugin-unicorn": "^44.0.2",
"graphql": "^16.6.0",
"graphql-tag": "^2.12.6",
"graphql-ws": "^5.11.2",
"hast-util-select": "^5.0.2",
"husky": "^8.0.1",
"idb": "^7.1.0",
"jest": "^29.2.1",
"husky": "^8.0.2",
"idb": "^7.1.1",
"jest": "^29.3.1",
"lint-staged": "^13.0.3",
"loglevel": "^1.8.0",
"loglevel": "^1.8.1",
"loglevel-plugin-prefix": "^0.8.4",
"markdown-it": "^13.0.1",
"markdown-it-container": "^3.0.0",
@ -93,50 +93,50 @@
"markdown-it-replace-link": "^1.1.0",
"nanostores": "^0.7.0",
"orderedmap": "^2.1.0",
"postcss": "^8.4.16",
"postcss-modules": "^5.0.0",
"postcss": "^8.4.19",
"postcss-modules": "^6.0.0",
"prettier": "^2.7.1",
"prettier-eslint": "^15.0.1",
"prosemirror-commands": "^1.3.1",
"prosemirror-dropcursor": "^1.6.0",
"prosemirror-dropcursor": "^1.6.1",
"prosemirror-example-setup": "^1.2.1",
"prosemirror-gapcursor": "^1.3.1",
"prosemirror-history": "^1.3.0",
"prosemirror-inputrules": "^1.2.0",
"prosemirror-keymap": "^1.2.0",
"prosemirror-markdown": "^1.9.4",
"prosemirror-markdown": "^1.10.1",
"prosemirror-menu": "^1.2.1",
"prosemirror-model": "^1.16.0",
"prosemirror-model": "^1.18.1",
"prosemirror-schema-list": "^1.2.2",
"prosemirror-state": "^1.4.1",
"prosemirror-view": "^1.28.1",
"prosemirror-state": "^1.4.2",
"prosemirror-view": "^1.29.0",
"rollup": "~2.79.1",
"rollup-plugin-visualizer": "^5.8.2",
"sass": "^1.55.0",
"solid-devtools": "^0.20.1",
"solid-js": "^1.6.0",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.56.1",
"solid-devtools": "^0.22.0",
"solid-js": "^1.6.2",
"solid-js-form": "^0.1.5",
"solid-jsx": "^0.9.1",
"solid-social": "^0.9.0",
"solid-utils": "^0.8.1",
"sort-package-json": "^2.0.0",
"stylelint": "^14.12.1",
"sort-package-json": "^2.1.0",
"stylelint": "^14.14.1",
"stylelint-config-css-modules": "^4.1.0",
"stylelint-config-prettier-scss": "^0.0.1",
"stylelint-config-standard-scss": "^6.0.0",
"stylelint-config-standard-scss": "^6.1.0",
"stylelint-order": "^5.0.0",
"stylelint-scss": "^4.3.0",
"swiper": "^8.4.2",
"swiper": "^8.4.4",
"ts-node": "^10.9.1",
"typescript": "^4.8.3",
"undici": "^5.10.0",
"typescript": "^4.8.4",
"undici": "^5.12.0",
"unique-names-generator": "^4.7.1",
"uuid": "^9.0.0",
"vite": "^3.1.3",
"ws": "^8.9.0",
"vite": "^3.2.3",
"ws": "^8.11.0",
"y-prosemirror": "^1.2.0",
"y-protocols": "^1.0.5",
"y-webrtc": "^10.2.3",
"yjs": "^13.5.41"
"yjs": "^13.5.42"
}
}

10948
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
.authorDetails {
display: flex;
flex: 1;
//padding-right: 1.2rem;
width: max-content;
@ -242,6 +243,7 @@
.authorsListItem {
.authorName {
@include font-size(2.2rem);
font-weight: bold;
}

View File

@ -59,7 +59,7 @@ export const Donate = () => {
script.type = 'text/javascript'
script.src = 'https://widget.cloudpayments.ru/bundles/cloudpayments.js'
script.async = true
script.onload = initiated
script.addEventListener('load', initiated)
document.head.appendChild(script)
})

View File

@ -34,11 +34,11 @@ export const LayoutView = (props: LayoutProps) => {
const { sortedArticles } = useArticlesStore({ sortedArticles: props.shouts })
const layout = createMemo(() => props.layout)
const loadMoreLayout = async (layout: string) => {
const loadMoreLayout = async (kind: string) => {
saveScrollPosition()
const { hasMore } = await loadLayoutShouts({
layout,
layout: kind,
amount: LOAD_MORE_PAGE_SIZE,
offset: sortedArticles().length
})

View File

@ -1,8 +1,8 @@
import { persistentMap } from '@nanostores/persistent'
import { createStorageSignal } from '@solid-primitives/storage'
import type { Reaction } from '../graphql/types.gen'
import { atom } from 'nanostores'
import { createSignal } from 'solid-js'
// TODO: store drafts
// import type { Draft } from '../components/EditorExample/store/context'
interface Collab {
@ -13,18 +13,13 @@ interface Collab {
title?: string
}
export const drafts = persistentMap<{ [key: string]: string }>(
'drafts',
{},
{
encode: JSON.stringify,
decode: JSON.parse
}
) // save drafts on device
export const collabs = atom<Collab[]>([]) // save collabs in backend or in p2p network
export const drafts = createStorageSignal<{ [key: string]: string }>('drafts', {}) // save drafts on device
export const [collabs, setCollabs] = createSignal<Collab[]>([]) // save collabs in backend or in p2p network
export const [editorReactions, setReactions] = createSignal<Reaction[]>([])
/*
TODO: approvals and proposals derived stores
const approvals = computed(
reactions,
(rdict) => Object.values(rdict)

View File

@ -1,4 +1,4 @@
import { atom } from 'nanostores'
import { createSignal } from 'solid-js'
import type { Chat } from '../graphql/types.gen'
export const chats = atom<Chat[]>([])
export const [chats, setChats] = createSignal<Chat[]>([])

View File

@ -1,8 +1,6 @@
//import { persistentAtom } from '@nanostores/persistent'
import { createSignal } from 'solid-js'
import { useRouter } from './router'
//export const locale = persistentAtom<string>('locale', 'ru')
export const [locale, setLocale] = createSignal('ru')
export type ModalType = 'auth' | 'subscribe' | 'feedback' | 'thank' | 'donate'
type WarnKind = 'error' | 'warn' | 'info'

View File

@ -1,18 +1,5 @@
import { persistentAtom } from '@nanostores/persistent'
import { useStore } from '@nanostores/solid'
import { createStorageSignal } from '@solid-primitives/storage'
const seen = persistentAtom<{ [slug: string]: Date }>(
'seen',
{},
{
encode: JSON.stringify,
decode: JSON.parse
}
)
export const addSeen = (slug) => seen.set({ ...seen.get(), [slug]: Date.now() })
export const useSeenStore = () => {
const getSeen = useStore(seen)
return { getSeen }
}
// local stored seen marks by shout's slug
export const [seen, setSeen] = createStorageSignal<{ [slug: string]: Date }>('seen', {})
export const addSeen = (slug) => setSeen({ ...seen(), [slug]: Date.now() })

10059
yarn.lock

File diff suppressed because it is too large Load Diff