add internals file and use it to organize imports

This commit is contained in:
Kevin Jahns
2019-04-04 19:35:38 +02:00
parent 8dbd2c4696
commit 30bf3742c9
38 changed files with 378 additions and 260 deletions

View File

@@ -1,12 +1,13 @@
import { runTests } from 'lib0/testing.js'
import { isBrowser } from 'lib0/environment.js'
import * as log from 'lib0/logging.js'
import * as array from './y-array.tests.js'
import * as map from './y-map.tests.js'
import * as text from './y-text.tests.js'
import * as xml from './y-xml.tests.js'
import { runTests } from 'lib0/testing.js'
import { isBrowser } from 'lib0/environment.js'
import * as log from 'lib0/logging.js'
if (isBrowser) {
log.createVConsole(document.body)
}

View File

@@ -1,13 +1,18 @@
import * as Y from '../src/index.js'
import {
createDeleteSetFromStructStore,
getStates,
AbstractItem,
DeleteSet, StructStore // eslint-disable-line
} from '../src/internals.js'
import * as t from 'lib0/testing.js'
import * as prng from 'lib0/prng.js'
import { createMutex } from 'lib0/mutex.js'
import * as encoding from 'lib0/encoding.js'
import * as decoding from 'lib0/decoding.js'
import * as syncProtocol from 'y-protocols/sync.js'
import { createDeleteSetFromStructStore, DeleteSet } from '../src/utils/DeleteSet.js' // eslint-disable-line
import { getStates, StructStore } from '../src/utils/StructStore.js' // eslint-disable-line
import { AbstractItem } from '../src/structs/AbstractItem.js' // eslint-disable-line
/**
* @param {TestYInstance} y
@@ -278,9 +283,6 @@ export const compare = users => {
compareDS(createDeleteSetFromStructStore(users[i].store), createDeleteSetFromStructStore(users[i + 1].store))
compareStructStores(users[i].store, users[i + 1].store)
}
users.forEach(user =>
t.assert(user._missingStructs.size === 0)
)
users.map(u => u.destroy())
}

View File

@@ -1,4 +1,5 @@
import { init, compare, applyRandomTests, TestYInstance } from './testHelper.js' // eslint-disable-line
import * as Y from '../src/index.js'
import * as t from 'lib0/testing.js'
import * as prng from 'lib0/prng.js'

View File

@@ -1,4 +1,5 @@
import { init, compare, applyRandomTests, TestYInstance } from './testHelper.js' // eslint-disable-line
import * as Y from '../src/index.js'
import * as t from 'lib0/testing.js'
import * as prng from 'lib0/prng.js'

View File

@@ -1,4 +1,5 @@
import { init, compare } from './testHelper.js'
import * as t from 'lib0/testing.js'
/**

View File

@@ -1,5 +1,6 @@
import { init, compare } from './testHelper.js'
import * as Y from '../src/index.js'
import * as t from 'lib0/testing.js'
/**