From 34f27266c2aeaa4105b26bbf44b5d9885daefd08 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Thu, 26 Oct 2023 03:15:21 -0400 Subject: [PATCH] push --- package-lock.json | 21 +++++++++++++-------- package.json | 6 +++--- src/rz/angular/morph-angular-html.ts | 8 +------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index b44e0bb..6d29b4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@codemorph/core", - "version": "1.4.9", + "version": "1.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codemorph/core", - "version": "1.4.9", + "version": "1.5.0", "license": "RAZROO", "workspaces": [ "src/rz/angular" @@ -14,7 +14,7 @@ "dependencies": { "@ctrl/tinycolor": "^3.4.1", "@types/ejs": "^3.1.2", - "angular-html-parser": "^4.0.1", + "angular-html-parser": "1.8.0", "ejs": "^3.1.9", "fast-glob": "3.2.7", "glob": "^8.0.3", @@ -6279,16 +6279,21 @@ } }, "node_modules/angular-html-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/angular-html-parser/-/angular-html-parser-4.0.1.tgz", - "integrity": "sha512-x9SLf2jNNh3nG+haVIwKX/GVW8PcvSRmkeT9WqTDYSAVuwT9IzwEyVm09FCZpOo/dtFRxE9vaNXqcAf/MIxphg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/angular-html-parser/-/angular-html-parser-1.8.0.tgz", + "integrity": "sha512-n5ZowjJJs1OPG3DHDSyUXZvscQzy7uQG227ncL1NzbJEPzfb2XtBZ9qT0PW7cbD7MViho3ijawXoRLCM0ih1rw==", "dependencies": { - "tslib": "^2.5.0" + "tslib": "^1.9.3" }, "engines": { - "node": ">= 14" + "node": ">= 6" } }, + "node_modules/angular-html-parser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", diff --git a/package.json b/package.json index bbf08a6..42573da 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "main": "./lib/cjs/index.js", "scripts": { "clean": "rm -rf ./lib", - "build": "npm run clean && npm run build:esm && npm run build:cjs && npm run babel:build", + "build": "npm run clean && npm run build:esm && npm run build:cjs", "build:esm": "tsc -p ./tsconfig.esm.json && mv lib/esm/index.js lib/esm/index.mjs", "build:cjs": "tsc -p ./tsconfig.cjs.json", - "babel:build": "babel lib/cjs --out-dir lib/cjs", + "babel:build": "babel lib/cjs --out-dir lib/cjs && babel node_modules/angular-html-parser --out-dir node_modules/angular-html-parser", "prepack": "npm run build", "format": "prettier --write \"src/**/*.(js|ts)\"", "lint": "eslint src --ext .js,.ts", @@ -87,7 +87,7 @@ "dependencies": { "@ctrl/tinycolor": "^3.4.1", "@types/ejs": "^3.1.2", - "angular-html-parser": "^4.0.1", + "angular-html-parser": "1.8.0", "ejs": "^3.1.9", "fast-glob": "3.2.7", "glob": "^8.0.3", diff --git a/src/rz/angular/morph-angular-html.ts b/src/rz/angular/morph-angular-html.ts index dd6da3e..fb79c43 100644 --- a/src/rz/angular/morph-angular-html.ts +++ b/src/rz/angular/morph-angular-html.ts @@ -9,13 +9,7 @@ import { addPropertyToHtmlTag } from './add-property-to-html-tag/add-property-to import { astToHtml } from './ast-to-html/ast-to-html'; import * as prettier from 'prettier'; import * as parserHtml from 'prettier/parser-html'; - -// hack to allow esm to load -let angularHtmlParse: any; -(async function () { - const module = await import('angular-html-parser'); - angularHtmlParse = module.parse -})(); +import {parse as angularHtmlParse} from 'angular-html-parser'; export function convertToAngularHtmlAndPrettify(htmlAst: any): string { const htmlString = astToHtml(htmlAst.rootNodes);