Skip to content

Commit

Permalink
chore: add caller to push, upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Mar 18, 2024
1 parent 9285356 commit ff7308b
Show file tree
Hide file tree
Showing 76 changed files with 611 additions and 508 deletions.
12 changes: 6 additions & 6 deletions @fiction/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
],
"dependencies": {
"@aws-sdk/client-cloudfront": "^3.535.0",
"@aws-sdk/client-s3": "^3.535.0",
"@aws-sdk/client-s3": "^3.536.0",
"@faker-js/faker": "^8.4.1",
"@iconify-json/carbon": "^1.1.31",
"@iconify-json/clarity": "^1.1.12",
"@iconify-json/flag": "^1.1.49",
"@iconify-json/heroicons": "^1.1.20",
"@iconify-json/logos": "^1.1.42",
"@iconify-json/tabler": "^1.1.108",
"@iconify-json/tabler": "^1.1.109",
"@medv/finder": "^3.2.0",
"@sinclair/typebox": "^0.32.15",
"@slack/webhook": "^7.0.2",
Expand Down Expand Up @@ -72,7 +72,7 @@
"google-auth-library": "^9.7.0",
"google-one-tap": "^1.0.6",
"handlebars": "^4.7.8",
"happy-dom": "^13.8.6",
"happy-dom": "^13.10.1",
"helmet": "^7.1.0",
"highlight.js": "^11.9.0",
"html-minifier": "^4.0.0",
Expand Down Expand Up @@ -104,7 +104,7 @@
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"pg": "^8.11.3",
"postcss": "^8.4.35",
"postcss": "^8.4.36",
"prettyoutput": "^1.2.0",
"process": "^0.11.10",
"querystring-browser": "^1.0.4",
Expand All @@ -120,7 +120,7 @@
"spark-md5": "^3.0.2",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"tailwind-merge": "^2.2.1",
"tailwind-merge": "^2.2.2",
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.2",
"tsup": "^8.0.2",
Expand Down Expand Up @@ -154,7 +154,7 @@
"@types/jsonwebtoken": "^9.0.6",
"@types/mime-types": "^2.1.4",
"@types/multer": "^1.4.11",
"@types/node": "^20.11.28",
"@types/node": "^20.11.29",
"@types/nodemailer": "^6.4.14",
"@types/nodemailer-html-to-text": "^3.1.3",
"@types/nodemon": "^1.19.6",
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-app/test/renderHtml.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('serverRenderHtml', () => {
htmlBody: '<htmlBody></htmlBody>',
})
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
if (!testUtils.fictionApp.fictionRender)
throw new Error('no fictionRender')

Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-app/test/rendering.alpha.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createTestUtils } from '../../test-utils/init'
let testUtils: undefined | TestUtils
describe('rendering tests', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
})

it('generates correct html', async () => {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-app/test/viteConfig.alpha.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let viteConfig: vite.InlineConfig | undefined
let testUtils: TestUtils | undefined
describe('vite config', () => {
beforeAll(async () => {
testUtils = await createTestUtils({ serverPort: 20_220, appPort: 1234 })
testUtils = createTestUtils({ serverPort: 20_220, appPort: 1234 })
})
it('gets and merges vite config', async () => {
expect(testUtils?.fictionServer.port).toBe(20_220)
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-db/test/utilUsername.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { objectId, shortId } from '../../utils'
import { standardTable } from '../../tbl'

describe('check username', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()
const fictionDb = testUtils.fictionDb
const initialized = await testUtils.init()
const userId = initialized.user.userId
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-env/test/generate.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { generateStaticConfig } from '@fiction/core/plugin-env/generate'
const root = new URL('.', import.meta.url).pathname
describe('test config generator', () => {
beforeAll(async () => {
const testUtils = await createTestUtils({
const testUtils = createTestUtils({
cwd: safeDirname(import.meta.url),
})

Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-media/test/upload.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('media upload/download tests', async () => {
if (!fs.existsSync(testEnvFile))
console.warn(`missing test env file ${testEnvFile}`)

const testUtils = await createTestUtils({ envFiles: [testEnvFile] }) as (TestUtils & { fictionMedia?: FictionMedia })
const testUtils = createTestUtils({ envFiles: [testEnvFile] }) as (TestUtils & { fictionMedia?: FictionMedia })

const awsAccessKey = testUtils.fictionEnv.var('AWS_ACCESS_KEY')
const awsAccessKeySecret = testUtils.fictionEnv.var('AWS_ACCESS_KEY_SECRET')
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class FictionRouter<

public async push(
location: vueRouter.RouteLocationRaw,
options?: { caller?: string, navMode?: 'push' | 'replace' },
options: { caller: string, navMode?: 'push' | 'replace' },
) {
if (!this.router.value)
throw new Error(`router not initialized [${this.settings.routerId}]`)
Expand Down
8 changes: 4 additions & 4 deletions @fiction/core/plugin-router/test/routes.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const routes = [
]

describe('fictionRouterCreate', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()

await testUtils.init()

Expand All @@ -25,9 +25,9 @@ describe('fictionRouterCreate', async () => {
routerId: 'testRouter',
})

it('errors if not initialized', async () => {
it('errors if not initialized', async (ctx) => {
await expect(fictionRouter.goto('testPage1', { testId: '123' })).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: router not initialized [testRouter]]`)
await expect(fictionRouter.push({ path: '123' })).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: router not initialized [testRouter]]`)
await expect(fictionRouter.push({ path: '123' }, { caller: ctx.task.name })).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: router not initialized [testRouter]]`)
})

it('syncs with vue router', async () => {
Expand All @@ -47,7 +47,7 @@ describe('fictionRouterCreate', async () => {
})

describe.skip('fictionRouter', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()

await testUtils.init()

Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-server/test/server.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let testUtils: TestUtils
let server: http.Server | undefined
describe('server test', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
})

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-team/test/team.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let testUtils: (TestUtils & { fictionTeam?: FictionTeam }) | undefined

describe('org team', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()

const fictionTeam = new FictionTeam({
...testUtils,
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-user/test/org.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let user: User | undefined
let org: Organization | undefined
let orgId: string | undefined
describe('org/project handling', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()
const initialized = await testUtils.init()
orgId = initialized.user.orgs?.[0].orgId

Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-user/test/user.browser.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let token: string | undefined
const email = getTestEmail()

describe('user tests', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()
await testUtils.init()

afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-user/test/user.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ vi.mock('../serverEmail', async () => {
let user: User

describe('user tests', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()
await testUtils.fictionDb.init()

it('creates user', async () => {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-user/test/userGoogle.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ vi.mock('google-auth-library', () => {
let testUtils: undefined | TestUtils
describe('google auth', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
await testUtils.fictionDb.init()

testUtils.fictionUser.googleClientId = 'mocked_id'
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/plugin-user/test/userUpdate.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { afterAll, describe, expect, it } from 'vitest'
import { getTestEmail } from '../../test-utils'

describe('user settings update', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()
const initialized = await testUtils.init()

afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/utils-analytics/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const patchHistory = function (
): (...args: historyArgs) => void {
const orig = history[method]
return function (this: typeof orig, ...args: historyArgs): void {
const rv = orig.apply(this, args as historyArgs)
const rv = orig.apply(this, args)
const e = new Event(method) as Event & { arguments: historyArgs }
e.arguments = args
window.dispatchEvent(e)
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/utils/test/activeUser.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { vue } from '../libraries'
import { createTestUtils } from '../../test-utils/init'

describe('active user handling', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()
const initialized = await testUtils.init()

it('should set the user to initialized', async () => {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/utils/test/processor.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let shortcodes: Shortcodes

describe('shortcodes tests', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
const fictionEnv = testUtils.fictionEnv
shortcodes = new Shortcodes({ fictionEnv })
shortcodes.addShortcode('mock', () => 'MockResult')
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/utils/test/socket.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const clientEvents: [keyof EventMap, EventMap[keyof EventMap]['res']][] = []
let testUtils: TestUtils | undefined
describe('sockets', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
s = await createSocketServer<EventMap>({
serverName: 'testSocketServer',
port,
Expand Down
2 changes: 1 addition & 1 deletion @fiction/core/utils/test/token.ci.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getCookie, getNakedDomain } from '../cookie'
let testUtils: TestUtils | undefined
describe('user token', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
testUtils.initialized = await testUtils.init()
})

Expand Down
4 changes: 2 additions & 2 deletions @fiction/plugin-admin-index/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"@fiction/core": "6.0.9",
"@fiction/plugin-sites": "6.0.9"
"@fiction/core": "workspace:*",
"@fiction/plugin-sites": "workspace:*"
},
"gitHead": "b257411e1c6c32b52b444cc6f1518bf1bee1e480",
"license": "GPL-2.0-only",
Expand Down
8 changes: 4 additions & 4 deletions @fiction/plugin-admin/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dependencies": {
"@fiction/core": "6.0.9",
"@fiction/plugin-ai": "6.0.9",
"@fiction/plugin-highlight-code": "6.0.9",
"@fiction/ui": "6.0.9",
"@fiction/core": "workspace:*",
"@fiction/plugin-ai": "workspace:*",
"@fiction/plugin-highlight-code": "workspace:*",
"@fiction/ui": "workspace:*",
"marked": "^12.0.1",
"minimatch": "^9.0.3",
"tailwindcss": "^3.4.1",
Expand Down
10 changes: 5 additions & 5 deletions @fiction/plugin-admin/test/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ import { createTestUtils } from '@fiction/core/test-utils/init'
import { FictionAdmin } from '..'

describe('fictionAdmin Auth', async () => {
const testUtils = await createTestUtils()
const testUtils = createTestUtils()

const _fictionAdmin = new FictionAdmin({ ...testUtils })
await testUtils.fictionDb.init()
await testUtils.fictionServer.createServer()

it('redirects User If Not Logged In', async () => {
await testUtils?.fictionRouter.push('/admin')
it('redirects User If Not Logged In', async (ctx) => {
await testUtils?.fictionRouter.push('/admin', { caller: ctx.task.name })

expect(testUtils?.fictionRouter.current.value.path, 'base path (default)').toBe('/')
})

it('if logged in, it redirects to org route', async () => {
it('if logged in, it redirects to org route', async (ctx) => {
const initialized = await testUtils?.init()
const user = initialized?.user
if (!user)
throw new Error('no user')

await testUtils?.fictionRouter.push('/admin')
await testUtils?.fictionRouter.push('/admin', { caller: ctx.task.name })

const orgPath = `/admin/${user.orgs?.[0].orgId}/home`
expect(testUtils?.fictionRouter.current.value.path, 'is org path').toBe(orgPath)
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-admin/test/reactive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createTestUtils } from '@fiction/core/test-utils/init'
let testUtils: TestUtils | undefined
describe('active project and org', () => {
beforeAll(async () => {
testUtils = await createTestUtils()
testUtils = createTestUtils()
testUtils.initialized = await testUtils.init()
})

Expand Down
4 changes: 2 additions & 2 deletions @fiction/plugin-ai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"@fiction/core": "6.0.9",
"@fiction/plugin-unsplash": "6.0.9",
"@fiction/core": "workspace:*",
"@fiction/plugin-unsplash": "workspace:*",
"@pinecone-database/pinecone": "^2.1.0",
"openai": "^4.29.1",
"tailwindcss": "^3.4.1",
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-ai/test/completion.ai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ai completions', async () => {
if (!fs.existsSync(testEnvFile))
console.warn(`missing test env file ${testEnvFile}`)

const testUtils = await createTestUtils({ envFiles: [testEnvFile] })
const testUtils = createTestUtils({ envFiles: [testEnvFile] })

const openaiApiKey = testUtils.fictionEnv.var('OPENAI_API_KEY')

Expand Down
4 changes: 2 additions & 2 deletions @fiction/plugin-contact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"license": "GPL-2.0-only",
"main": "index.ts",
"dependencies": {
"@fiction/core": "6.0.9",
"@fiction/plugin-monitor": "6.0.9"
"@fiction/core": "workspace:*",
"@fiction/plugin-monitor": "workspace:*"
},
"gitHead": "435e8535660c83acb445295cfb98a21b32c69434",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-highlight-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "GPL-2.0-only",
"main": "index.ts",
"dependencies": {
"@fiction/core": "6.0.9",
"@fiction/core": "workspace:*",
"highlight.js": "^11.9.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-monitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "GPL-2.0-only",
"main": "index.ts",
"dependencies": {
"@fiction/core": "6.0.9",
"@fiction/core": "workspace:*",
"@mailchimp/mailchimp_marketing": "^3.0.80",
"@sentry/node": "^7.107.0",
"@sentry/tracing": "^7.107.0",
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-notify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "GPL-2.0-only",
"main": "index.ts",
"dependencies": {
"@fiction/core": "6.0.9"
"@fiction/core": "workspace:*"
},
"gitHead": "435e8535660c83acb445295cfb98a21b32c69434",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-sites/cards/logos/ElLogos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const uc = vue.computed(() => {
v-for="(logo, i) in uc.items"
:key="i"
:href="logo.href"
class="hover:text-theme-500 logo-link flex items-center justify-center h-[80px] max-w-[200px] relative"
class="hover:text-theme-500 logo-link flex items-center justify-center h-[80px] w-full max-w-[200px] relative"
:class="uc.format === 'stacked' ? `w-[17%]` : ''"
target="_blank"
>
Expand Down
10 changes: 5 additions & 5 deletions @fiction/plugin-sites/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"@fiction/core": "6.0.9",
"@fiction/plugin-admin": "6.0.9",
"@fiction/plugin-ai": "6.0.9",
"@fiction/plugin-highlight-code": "6.0.9",
"@fiction/ui": "6.0.9",
"@fiction/core": "workspace:*",
"@fiction/plugin-admin": "workspace:*",
"@fiction/plugin-ai": "workspace:*",
"@fiction/plugin-highlight-code": "workspace:*",
"@fiction/ui": "workspace:*",
"@shopify/draggable": "^1.1.3",
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
Expand Down
Loading

0 comments on commit ff7308b

Please sign in to comment.