BREAKING CHANGE(core): switch to esm
This commit is contained in:
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/webstore',
|
||||
version: '2.0.0',
|
||||
description: 'high performance storage in the browser using indexed db'
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
export * from './webstore.classes.typedrequestcache';
|
||||
export * from './webstore.classes.webstore';
|
||||
export * from './webstore.classes.typedrequestcache.js';
|
||||
export * from './webstore.classes.webstore.js';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { WebStore } from './webstore.classes.webstore';
|
||||
import * as plugins from './webstore.plugins';
|
||||
import { WebStore } from './webstore.classes.webstore.js';
|
||||
import * as plugins from './webstore.plugins.js';
|
||||
|
||||
/**
|
||||
* a cache that can be used to store and retrieve typedrequests
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './webstore.plugins';
|
||||
import * as plugins from './webstore.plugins.js';
|
||||
|
||||
export interface IWebStoreOptions {
|
||||
dbName: string;
|
||||
@ -22,6 +22,13 @@ export class WebStore<T = any> {
|
||||
return;
|
||||
}
|
||||
this.initCalled = true;
|
||||
|
||||
const smartenv = new plugins.smartenv.Smartenv();
|
||||
if (!smartenv.isBrowser) {
|
||||
const fetch = await smartenv.getSafeNodeModule('fake-indexeddb/auto.js');
|
||||
globalThis.fetch = fetch.default;
|
||||
}
|
||||
|
||||
this.db = await plugins.idb.openDB(this.options.dbName, 1, {
|
||||
upgrade: (db) => {
|
||||
db.createObjectStore(this.options.storeName);
|
||||
|
@ -1,10 +1,11 @@
|
||||
// pushrocks scope
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as smartenv from '@pushrocks/smartenv';
|
||||
import * as smartjson from '@pushrocks/smartjson';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrx from '@pushrocks/smartrx';
|
||||
|
||||
export { lik, smartjson, smartpromise, smartrx };
|
||||
export { lik, smartenv, smartjson, smartpromise, smartrx };
|
||||
|
||||
// apiglobal scope
|
||||
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
|
||||
|
Reference in New Issue
Block a user