Skip to content

Commit

Permalink
refactor(core): use npm deps in lieu of skypack #612
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Nov 21, 2023
1 parent 784cdf2 commit 21ca0ad
Show file tree
Hide file tree
Showing 6 changed files with 521 additions and 70 deletions.
557 changes: 497 additions & 60 deletions packages/core/deno.lock

Large diffs are not rendered by default.

24 changes: 17 additions & 7 deletions packages/core/deps.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
export * as R from 'https://cdn.skypack.dev/[email protected]?dts'
// @deno-types="npm:@types/ramda@^0.29.9"
export * as R from 'npm:[email protected]'

/**
* Shim hand-rolled crocks types
*/
// @deno-types="./crocks.d.ts"
export { default as crocks } from 'https://cdn.skypack.dev/[email protected]'
export { default as crocks } from 'npm:[email protected]'
export { z } from 'https://deno.land/x/[email protected]/mod.ts'
export { ms } from 'https://deno.land/x/[email protected]/ms.ts'

export { cuid } from 'https://deno.land/x/[email protected]/index.js'
export { join } from 'https://deno.land/std@0.182.0/path/mod.ts'
export { exists } from 'https://deno.land/std@0.182.0/fs/mod.ts'
export { join } from 'https://deno.land/std@0.207.0/path/mod.ts'
export { exists } from 'https://deno.land/std@0.207.0/fs/mod.ts'

export {
import {
HyperErr,
isBaseHyperErr,
isHyperErr,
} from 'https://raw.githubusercontent.com/hyper63/hyper/hyper-utils%40v0.1.0/packages/utils/hyper-err.js'
isHyperErr as isHyperErrBase,
} from 'https://raw.githubusercontent.com/hyper63/hyper/hyper-utils%40v0.1.2/packages/utils/hyper-err.js'

export { HyperErr, isBaseHyperErr }

/**
* The new ramda types in hyper-utils are overly assuming, so
* just wrap the isHyperErr from utils with a more unassuming signature
*/
// deno-lint-ignore no-explicit-any
export const isHyperErr = (v: any) => isHyperErrBase(v)

export {
queue,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/dev_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export {
assertEquals,
assertObjectMatch,
assertThrows,
} from 'https://deno.land/std@0.184.0/testing/asserts.ts'
} from 'https://deno.land/std@0.207.0/assert/mod.ts'

export { encode as base64Encode } from 'https://deno.land/std@0.184.0/encoding/base64.ts'
export { encode as base64Encode } from 'https://deno.land/std@0.207.0/encoding/base64.ts'
3 changes: 3 additions & 0 deletions packages/core/lib/data/mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ Deno.test('data', async (t) => {
await dataWithErr
.getDocument('foobar', 'err', true)
.map((res) => {
// @ts-expect-error
assert(res.ok === false)
})
.toPromise()
Expand All @@ -294,6 +295,7 @@ Deno.test('data', async (t) => {
await data
.getDocument('foo', 'key', false)
.map((res) => {
// @ts-expect-error
assert(res.ok)
// @ts-expect-error
assert(res.doc.db)
Expand All @@ -320,6 +322,7 @@ Deno.test('data', async (t) => {
await dataWithErr
.getDocument('foobar', 'err', false)
.map((res) => {
// @ts-expect-error
assert(res.ok === false)
})
.toPromise()
Expand Down
1 change: 1 addition & 0 deletions packages/core/lib/queue/mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Deno.test('queue', async (t) => {
.map((res) => {
// @ts-expect-error
assertEquals(res.name, 'foobar')
// @ts-expect-error
assertEquals(res.status, 'READY')
})
.toPromise()
Expand Down
2 changes: 1 addition & 1 deletion packages/core/mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {
default as pouchdb,
PouchDbAdapterTypes,
} from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-pouchdb/v0.1.7/mod.js'
} from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-pouchdb/v0.2.0/mod.js'
import memory from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-memory/v2.0.0/mod.js'

import { R } from './deps.ts'
Expand Down

0 comments on commit 21ca0ad

Please sign in to comment.