Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
9a77b5722a | |||
28d9d62bb4 | |||
9fa8754a15 | |||
6ff92ff880 | |||
eb9cae4be3 | |||
cd5cee545b | |||
fd8aa388ad | |||
58db360c79 | |||
bda524348e | |||
b33f7ed33e |
9
package-lock.json
generated
9
package-lock.json
generated
@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartntml",
|
"name": "@pushrocks/smartntml",
|
||||||
"version": "1.0.3",
|
"version": "1.0.8",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartntml",
|
"name": "@pushrocks/smartntml",
|
||||||
"version": "1.0.3",
|
"version": "1.0.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@happy-dom/global-registrator": "^4.1.0",
|
"@happy-dom/global-registrator": "^4.1.0",
|
||||||
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"lit": "^2.2.5"
|
"lit": "^2.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -665,7 +666,6 @@
|
|||||||
"version": "3.1.7",
|
"version": "3.1.7",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.1.7.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.1.7.tgz",
|
||||||
"integrity": "sha512-2gLQCeviEJwZ+cHHtK2Ks98brZatGC6dPXKIs1tVgJsiNgRFjnp90fESuJ1Pmoe7RrS+7J3mO4NtsFHAJJ/y5w==",
|
"integrity": "sha512-2gLQCeviEJwZ+cHHtK2Ks98brZatGC6dPXKIs1tVgJsiNgRFjnp90fESuJ1Pmoe7RrS+7J3mO4NtsFHAJJ/y5w==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@pushrocks/smartpuppeteer": {
|
"node_modules/@pushrocks/smartpuppeteer": {
|
||||||
@ -6580,8 +6580,7 @@
|
|||||||
"@pushrocks/smartpromise": {
|
"@pushrocks/smartpromise": {
|
||||||
"version": "3.1.7",
|
"version": "3.1.7",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.1.7.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.1.7.tgz",
|
||||||
"integrity": "sha512-2gLQCeviEJwZ+cHHtK2Ks98brZatGC6dPXKIs1tVgJsiNgRFjnp90fESuJ1Pmoe7RrS+7J3mO4NtsFHAJJ/y5w==",
|
"integrity": "sha512-2gLQCeviEJwZ+cHHtK2Ks98brZatGC6dPXKIs1tVgJsiNgRFjnp90fESuJ1Pmoe7RrS+7J3mO4NtsFHAJJ/y5w=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"@pushrocks/smartpuppeteer": {
|
"@pushrocks/smartpuppeteer": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartntml",
|
"name": "@pushrocks/smartntml",
|
||||||
"version": "1.0.3",
|
"version": "1.0.8",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "lit-html for the backend",
|
"description": "lit-html for the backend",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -21,6 +21,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@happy-dom/global-registrator": "^4.1.0",
|
"@happy-dom/global-registrator": "^4.1.0",
|
||||||
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"lit": "^2.2.5"
|
"lit": "^2.2.5"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartntml',
|
name: '@pushrocks/smartntml',
|
||||||
version: '1.0.3',
|
version: '1.0.8',
|
||||||
description: 'lit-html for the backend'
|
description: 'lit-html for the backend'
|
||||||
}
|
}
|
||||||
|
14
ts/index.ts
14
ts/index.ts
@ -1,6 +1,7 @@
|
|||||||
import * as plugins from './smartntml.plugins.js';
|
import * as plugins from './smartntml.plugins.js';
|
||||||
|
|
||||||
import type * as litTypes from 'lit';
|
import type * as litTypes from 'lit';
|
||||||
|
export type { TemplateResult } from 'lit';
|
||||||
|
|
||||||
export class Smartntml {
|
export class Smartntml {
|
||||||
// STATIC
|
// STATIC
|
||||||
@ -10,8 +11,19 @@ export class Smartntml {
|
|||||||
return smartntml;
|
return smartntml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static smartntmlSingletonDeferred: plugins.smartpromise.Deferred<Smartntml>;
|
||||||
|
public static async createAndInitSingleton() {
|
||||||
|
if (this.smartntmlSingletonDeferred) {
|
||||||
|
return this.smartntmlSingletonDeferred.promise;
|
||||||
|
}
|
||||||
|
this.smartntmlSingletonDeferred = plugins.smartpromise.defer();
|
||||||
|
const smartntmlInstance = await this.createAndInit();
|
||||||
|
this.smartntmlSingletonDeferred.resolve(smartntmlInstance);
|
||||||
|
return this.smartntmlSingletonDeferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
render: typeof litTypes.render;
|
private render: typeof litTypes.render;
|
||||||
html: typeof litTypes.html;
|
html: typeof litTypes.html;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -1,2 +1,10 @@
|
|||||||
|
// happy-dom setup
|
||||||
import { GlobalRegistrator } from '@happy-dom/global-registrator';
|
import { GlobalRegistrator } from '@happy-dom/global-registrator';
|
||||||
GlobalRegistrator.register();
|
GlobalRegistrator.register();
|
||||||
|
|
||||||
|
// @pushrocks scope
|
||||||
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
|
export {
|
||||||
|
smartpromise
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user