mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
chore: update references to translators
This commit is contained in:
parent
6889b0d4ee
commit
2be37f72d3
8
.changeset/tall-llamas-sin.md
Normal file
8
.changeset/tall-llamas-sin.md
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
"@marko/translator-interop-class-tags": minor
|
||||
"@marko/runtime-tags": minor
|
||||
"@marko/compiler": minor
|
||||
"marko": minor
|
||||
---
|
||||
|
||||
Merge translator packages into their respective runtime packages.
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"examples": {
|
||||
"counter": "./packages/translator-tags/src/__tests__/fixtures/basic-counter/template.marko",
|
||||
"comments": "./packages/translator-tags/src/__tests__/fixtures/basic-inert-collapsible-tree/template.marko"
|
||||
"counter": "./packages/runtime-tags/src/__tests__/fixtures/basic-counter/template.marko",
|
||||
"comments": "./packages/runtime-tags/src/__tests__/fixtures/basic-inert-collapsible-tree/template.marko"
|
||||
},
|
||||
"results": [
|
||||
{
|
||||
|
||||
98
package-lock.json
generated
98
package-lock.json
generated
@ -2975,10 +2975,6 @@
|
||||
"node": ">=6 <7 || >=8"
|
||||
}
|
||||
},
|
||||
"node_modules/@marko/babel-utils": {
|
||||
"resolved": "packages/babel-utils",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@marko/compiler": {
|
||||
"resolved": "packages/compiler",
|
||||
"link": true
|
||||
@ -2987,18 +2983,10 @@
|
||||
"resolved": "packages/runtime-tags",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@marko/translator-default": {
|
||||
"resolved": "packages/translator-default",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@marko/translator-interop-class-tags": {
|
||||
"resolved": "packages/translator-interop",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@marko/translator-tags": {
|
||||
"resolved": "packages/translator-tags",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@nicolo-ribaudo/chokidar-2": {
|
||||
"version": "2.1.8-no-fsevents.3",
|
||||
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz",
|
||||
@ -4057,9 +4045,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.24.2",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz",
|
||||
"integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==",
|
||||
"version": "4.24.3",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.3.tgz",
|
||||
"integrity": "sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@ -4076,9 +4064,9 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001669",
|
||||
"electron-to-chromium": "^1.5.41",
|
||||
"node-releases": "^2.0.18",
|
||||
"caniuse-lite": "^1.0.30001688",
|
||||
"electron-to-chromium": "^1.5.73",
|
||||
"node-releases": "^2.0.19",
|
||||
"update-browserslist-db": "^1.1.1"
|
||||
},
|
||||
"bin": {
|
||||
@ -6648,9 +6636,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/it-fails": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/it-fails/-/it-fails-1.0.8.tgz",
|
||||
"integrity": "sha512-ESGoV6kOX6QfDHouMOw15/KYhprCTR//ks8+BbdqnKPlpniRLIM+jmA9SFq2pUrShyZvhhTbAvTCeWddmIpCEA==",
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/it-fails/-/it-fails-1.0.9.tgz",
|
||||
"integrity": "sha512-tG508k+ciV1W1hRq79X+h08SGTPiASkgsLjPLIqgsB3fqR+i55o54yS3LZ49D3wemgQrASCnXnvQ0tlv5YqKSA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -6658,7 +6646,7 @@
|
||||
"ms": "^2.1.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"mocha": "4 - 10"
|
||||
"mocha": "4 - 11"
|
||||
}
|
||||
},
|
||||
"node_modules/jackspeak": {
|
||||
@ -7162,7 +7150,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/marko": {
|
||||
"resolved": "packages/marko",
|
||||
"resolved": "packages/runtime-class",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
@ -10333,20 +10321,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages/babel-utils": {
|
||||
"name": "@marko/babel-utils",
|
||||
"version": "6.6.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.26.3",
|
||||
"@babel/runtime": "^7.26.0",
|
||||
"jsesc": "^3.1.0",
|
||||
"relative-import-path": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@marko/compiler": "^5.38.5"
|
||||
}
|
||||
},
|
||||
"packages/compiler": {
|
||||
"name": "@marko/compiler",
|
||||
"version": "5.38.5",
|
||||
@ -10363,7 +10337,6 @@
|
||||
"@babel/traverse": "^7.26.4",
|
||||
"@babel/types": "^7.26.3",
|
||||
"@luxass/strip-json-comments": "^1.3.2",
|
||||
"@marko/babel-utils": "^6.6.3",
|
||||
"complain": "^1.6.1",
|
||||
"he": "^1.2.0",
|
||||
"htmljs-parser": "^5.5.3",
|
||||
@ -10372,20 +10345,22 @@
|
||||
"lasso-package-root": "^1.0.1",
|
||||
"raptor-regexp": "^1.0.1",
|
||||
"raptor-util": "^3.2.0",
|
||||
"relative-import-path": "^1.0.0",
|
||||
"resolve-from": "^5.0.0",
|
||||
"self-closing-tags": "^1.0.1",
|
||||
"source-map-support": "^0.5.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@marko/translator-default": "^6.1.3"
|
||||
"marko": "^5.36.5"
|
||||
}
|
||||
},
|
||||
"packages/marko": {
|
||||
"packages/runtime-class": {
|
||||
"name": "marko",
|
||||
"version": "5.36.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.26.0",
|
||||
"@marko/compiler": "^5.38.5",
|
||||
"@marko/translator-default": "^6.1.3",
|
||||
"app-module-path": "^2.2.0",
|
||||
"argly": "^1.2.0",
|
||||
"browser-refresh-client": "1.1.4",
|
||||
@ -10393,6 +10368,7 @@
|
||||
"csstype": "^3.1.3",
|
||||
"events-light": "^1.0.5",
|
||||
"listener-tracker": "^2.0.0",
|
||||
"magic-string": "^0.30.15",
|
||||
"minimatch": "^9.0.5",
|
||||
"raptor-util": "^3.2.0",
|
||||
"resolve-from": "^5.0.0",
|
||||
@ -10403,14 +10379,14 @@
|
||||
"markoc": "bin/markoc"
|
||||
}
|
||||
},
|
||||
"packages/marko/node_modules/brace-expansion": {
|
||||
"packages/runtime-class/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"packages/marko/node_modules/minimatch": {
|
||||
"packages/runtime-class/node_modules/minimatch": {
|
||||
"version": "9.0.5",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@ -10428,46 +10404,14 @@
|
||||
"version": "0.2.5",
|
||||
"license": "MIT"
|
||||
},
|
||||
"packages/translator-default": {
|
||||
"name": "@marko/translator-default",
|
||||
"version": "6.1.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.26.0",
|
||||
"@marko/babel-utils": "^6.6.3",
|
||||
"magic-string": "^0.30.15",
|
||||
"self-closing-tags": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@marko/compiler": "^5.38.5",
|
||||
"marko": "^5.36.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@marko/compiler": "^5.16.1",
|
||||
"marko": "^5.17.2"
|
||||
}
|
||||
},
|
||||
"packages/translator-interop": {
|
||||
"name": "@marko/translator-interop-class-tags",
|
||||
"version": "0.1.36",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@marko/babel-utils": "^6.6.3",
|
||||
"@marko/translator-default": "^6.1.3",
|
||||
"@marko/translator-tags": "^0.4.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@marko/compiler": "^5.23.0"
|
||||
}
|
||||
},
|
||||
"packages/translator-tags": {
|
||||
"name": "@marko/translator-tags",
|
||||
"version": "0.4.8",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@marko/babel-utils": "^6.6.3",
|
||||
"@marko/runtime-tags": "^0.2.5"
|
||||
"@marko/runtime-tags": "^0.2.5",
|
||||
"marko": "^5.36.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@marko/compiler": "^5.23.0"
|
||||
|
||||
2
packages/compiler/index.d.ts
vendored
2
packages/compiler/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import { Diagnostic, TaglibLookup } from "@marko/babel-utils";
|
||||
import { Diagnostic, TaglibLookup } from "@marko/compiler/babel-utils";
|
||||
import { SourceMap } from "magic-string";
|
||||
|
||||
import * as types from "./babel-types";
|
||||
|
||||
@ -23,6 +23,10 @@
|
||||
"types": "./index.d.ts",
|
||||
"default": "./src/index.js"
|
||||
},
|
||||
"./babel-utils": {
|
||||
"types": "./babel-utils.d.ts",
|
||||
"default": "./src/babel-utils/index.js"
|
||||
},
|
||||
"./config": {
|
||||
"types": "./config.d.ts",
|
||||
"default": "./src/config.js"
|
||||
@ -47,6 +51,7 @@
|
||||
"modules.js",
|
||||
"index.d.ts",
|
||||
"babel-types.d.ts",
|
||||
"babel-utils.d.ts",
|
||||
"register.js",
|
||||
"register.d.ts"
|
||||
],
|
||||
@ -66,7 +71,6 @@
|
||||
"@babel/traverse": "^7.26.4",
|
||||
"@babel/types": "^7.26.3",
|
||||
"@luxass/strip-json-comments": "^1.3.2",
|
||||
"@marko/babel-utils": "^6.6.3",
|
||||
"complain": "^1.6.1",
|
||||
"he": "^1.2.0",
|
||||
"htmljs-parser": "^5.5.3",
|
||||
@ -75,12 +79,13 @@
|
||||
"lasso-package-root": "^1.0.1",
|
||||
"raptor-regexp": "^1.0.1",
|
||||
"raptor-util": "^3.2.0",
|
||||
"relative-import-path": "^1.0.0",
|
||||
"resolve-from": "^5.0.0",
|
||||
"self-closing-tags": "^1.0.1",
|
||||
"source-map-support": "^0.5.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@marko/translator-default": "^6.1.3"
|
||||
"marko": "^5.36.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@ -90,6 +95,10 @@
|
||||
"types": "./index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"./babel-utils": {
|
||||
"types": "./babel-utils.d.ts",
|
||||
"default": "./dist/babel-utils/index.js"
|
||||
},
|
||||
"./config": {
|
||||
"types": "./config.d.ts",
|
||||
"default": "./dist/config.js"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import traverse from "@babel/traverse";
|
||||
import { diagnosticError, getTemplateId } from "@marko/babel-utils";
|
||||
import { diagnosticError, getTemplateId } from "@marko/compiler/babel-utils";
|
||||
import { createHash } from "crypto";
|
||||
import path from "path";
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
parseTypeArgs,
|
||||
parseTypeParams,
|
||||
parseVar,
|
||||
} from "@marko/babel-utils";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { createParser, TagType } from "htmljs-parser";
|
||||
|
||||
import * as t from "../babel-types";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getTagDef, getTagDefForTagName } from "@marko/babel-utils";
|
||||
import { getTagDef, getTagDefForTagName } from "@marko/compiler/babel-utils";
|
||||
|
||||
import * as t from "../../babel-types";
|
||||
import { enter, exit } from "../util/plugin-hooks";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getTagDef, getTagDefForTagName } from "@marko/babel-utils";
|
||||
import { getTagDef, getTagDefForTagName } from "@marko/compiler/babel-utils";
|
||||
|
||||
import * as t from "../../babel-types";
|
||||
import { enter, exit } from "../util/plugin-hooks";
|
||||
|
||||
@ -112,7 +112,7 @@ export function getMacroIdentifierForName(path, name) {
|
||||
|
||||
if (!id) {
|
||||
throw new Error(
|
||||
"<macro> was added programmatically, but was not registered via the 'registerMacro' api in @marko/babel-utils.",
|
||||
"<macro> was added programmatically, but was not registered via the 'registerMacro' api in @marko/compiler/babel-utils.",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ const config = {
|
||||
* Allows configuring Marko to compile to different runtimes.
|
||||
*/
|
||||
translator: (() => {
|
||||
const translatorReg = /^(@marko\/|marko-)translator-/;
|
||||
const translatorReg = /^(?:@marko\/|marko-)(?:translator|runtime)-/;
|
||||
let translator;
|
||||
let pkg;
|
||||
|
||||
@ -93,7 +93,11 @@ const config = {
|
||||
}
|
||||
}
|
||||
|
||||
return translator || "@marko/translator-default";
|
||||
if (translator && translator.endsWith("runtime")) {
|
||||
translator += "/translator";
|
||||
}
|
||||
|
||||
return translator || "marko/translator";
|
||||
})(),
|
||||
|
||||
/**
|
||||
|
||||
@ -3,7 +3,7 @@ import * as babel from "@babel/core";
|
||||
import tsSyntaxPlugin from "@babel/plugin-syntax-typescript";
|
||||
import cjsPlugin from "@babel/plugin-transform-modules-commonjs";
|
||||
import tsTransformPlugin from "@babel/plugin-transform-typescript";
|
||||
import { DiagnosticType } from "@marko/babel-utils";
|
||||
import { DiagnosticType } from "@marko/compiler/babel-utils";
|
||||
import path from "path";
|
||||
|
||||
import corePlugin from "./babel-plugin";
|
||||
|
||||
@ -4,28 +4,9 @@ const cache = {};
|
||||
|
||||
export default function (requested = config.translator) {
|
||||
if (typeof requested === "string") {
|
||||
const cached = cache[requested];
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
let translator;
|
||||
|
||||
try {
|
||||
translator = markoModules.require(requested);
|
||||
} catch (err) {
|
||||
try {
|
||||
translator = markoModules.require(`@marko/translator-${requested}`);
|
||||
} catch {
|
||||
try {
|
||||
translator = markoModules.require(`marko-translator-${requested}`);
|
||||
} catch {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (cache[requested] = translator);
|
||||
return (
|
||||
cache[requested] || (cache[requested] = markoModules.require(requested))
|
||||
);
|
||||
}
|
||||
|
||||
return requested;
|
||||
|
||||
@ -60,14 +60,16 @@
|
||||
"index-browser.marko",
|
||||
"index.js",
|
||||
"node-require.js",
|
||||
"tags-html.d.ts"
|
||||
"tags-html.d.ts",
|
||||
"translator/package.json",
|
||||
"translator/index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "babel ./src --out-dir ./dist --extensions .js --copy-files --config-file ../../babel.config.js --env-name=production"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.26.0",
|
||||
"@marko/compiler": "^5.38.5",
|
||||
"@marko/translator-default": "^6.1.3",
|
||||
"app-module-path": "^2.2.0",
|
||||
"argly": "^1.2.0",
|
||||
"browser-refresh-client": "1.1.4",
|
||||
@ -75,6 +77,7 @@
|
||||
"csstype": "^3.1.3",
|
||||
"events-light": "^1.0.5",
|
||||
"listener-tracker": "^2.0.0",
|
||||
"magic-string": "^0.30.15",
|
||||
"minimatch": "^9.0.5",
|
||||
"raptor-util": "^3.2.0",
|
||||
"resolve-from": "^5.0.0",
|
||||
|
||||
@ -30,11 +30,11 @@ exports.finder = compiler.taglib._finder;
|
||||
exports.lookup = {
|
||||
buildLookup: function (dir, translator) {
|
||||
if (!translator || !Array.isArray(translator.taglibs)) {
|
||||
translator = require("@marko/translator-default");
|
||||
translator = require("../translator");
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
if ("MARKO_DEBUG") {
|
||||
complain(
|
||||
"buildTaglibLookup now requires passing in a transltor as the second argument, eg `buildTaglibLookup(dir, require('@marko/translator-default'))`.",
|
||||
"buildTaglibLookup now requires passing in a transltor as the second argument, eg `buildTaglibLookup(dir, require('marko/translator'))`.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
findParentTag,
|
||||
getTagDef,
|
||||
@ -12,8 +13,7 @@ import {
|
||||
parseStatements,
|
||||
resolveRelativePath,
|
||||
resolveTagImport,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { version } from "marko/package.json";
|
||||
import { resolve } from "path";
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
computeNode,
|
||||
getTagDef,
|
||||
importDefault,
|
||||
importNamed,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import toString from "marko/src/runtime/helpers/to-string";
|
||||
import escapeScript from "marko/src/runtime/html/helpers/escape-script-placeholder";
|
||||
import escapeStyle from "marko/src/runtime/html/helpers/escape-style-placeholder";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { computeNode } from "@marko/babel-utils";
|
||||
import { computeNode } from "@marko/compiler/babel-utils";
|
||||
|
||||
import write from "../util/vdom-out-write";
|
||||
import withPreviousLocation from "../util/with-previous-location";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
findParentTag,
|
||||
@ -6,8 +7,7 @@ import {
|
||||
importNamed,
|
||||
isAttributeTag,
|
||||
isTransparentTag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { getAttrs } from "./util";
|
||||
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
import { computeNode, importDefault, isNativeTag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
computeNode,
|
||||
importDefault,
|
||||
isNativeTag,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import classToString from "marko/src/runtime/helpers/class-value";
|
||||
|
||||
import withPreviousLocation from "../../../util/with-previous-location";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getArgOrSequence } from "@marko/babel-utils";
|
||||
import { getArgOrSequence } from "@marko/compiler/babel-utils";
|
||||
|
||||
import noUpdateTransform from "./no-update";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getArgOrSequence } from "@marko/babel-utils";
|
||||
import { getArgOrSequence } from "@marko/compiler/babel-utils";
|
||||
|
||||
import noUpdateTransform from "./no-update";
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { isNativeTag, normalizeTemplateString } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
isNativeTag,
|
||||
normalizeTemplateString,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
const EMPTY_OBJECT = {};
|
||||
|
||||
export default {
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
import { computeNode, importDefault, isNativeTag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
computeNode,
|
||||
importDefault,
|
||||
isNativeTag,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import styleToString from "marko/src/runtime/helpers/style-value";
|
||||
|
||||
import withPreviousLocation from "../../../util/with-previous-location";
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
import { getTagDef, importDefault, isNativeTag } from "@marko/babel-utils";
|
||||
import {
|
||||
getTagDef,
|
||||
importDefault,
|
||||
isNativeTag,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import directives from "./directives";
|
||||
import modifiers from "./modifiers";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
getTagDef,
|
||||
@ -5,8 +6,7 @@ import {
|
||||
loadFileForTag,
|
||||
resolveRelativePath,
|
||||
resolveTagImport,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import withPreviousLocation from "../util/with-previous-location";
|
||||
import dynamicTag from "./dynamic-tag";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { importDefault } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { importDefault } from "@marko/compiler/babel-utils";
|
||||
|
||||
import withPreviousLocation from "../util/with-previous-location";
|
||||
import { buildEventHandlerArray, getAttrs } from "./util";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoVar,
|
||||
findAttributeTags,
|
||||
@ -8,8 +9,7 @@ import {
|
||||
isNativeTag,
|
||||
isTransparentTag,
|
||||
resolveTagImport,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import nodePath from "path";
|
||||
|
||||
import { getKeyManager } from "../util/key-manager";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getMacroIdentifier } from "@marko/babel-utils";
|
||||
import { getMacroIdentifier } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default function (path) {
|
||||
path.node.name = getMacroIdentifier(path);
|
||||
|
||||
@ -2,7 +2,7 @@ import {
|
||||
assertNoArgs,
|
||||
assertNoAttributeTags,
|
||||
assertNoParams,
|
||||
} from "@marko/babel-utils";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import nativeTagHtml from "./native-tag[html]";
|
||||
import nativeTagVdom from "./native-tag[vdom]";
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
importDefault,
|
||||
importNamed,
|
||||
normalizeTemplateString,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import attrHelper from "marko/src/runtime/html/helpers/attr";
|
||||
import { d as escapeDoubleQuotes } from "marko/src/runtime/html/helpers/escape-quotes";
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
getTagDef,
|
||||
importDefault,
|
||||
normalizeTemplateString,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { resolve } from "path";
|
||||
import SELF_CLOSING from "self-closing-tags";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { importDefault } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { importDefault } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { evaluateAttr } from "../util";
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { getTagDef, normalizeTemplateString } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
getTagDef,
|
||||
normalizeTemplateString,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import * as FLAGS from "../../util/runtime-flags";
|
||||
import write from "../../util/vdom-out-write";
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
import { computeNode, getTagDef, importNamed } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
computeNode,
|
||||
getTagDef,
|
||||
importNamed,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import classToString from "marko/src/runtime/helpers/class-value";
|
||||
import styleToString from "marko/src/runtime/helpers/style-value";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { assertNoAttributes } from "@marko/babel-utils";
|
||||
import { assertNoAttributes } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { buildIfStatement } from "./util";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { assertNoArgs, assertNoAttributes } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { assertNoArgs, assertNoAttributes } from "@marko/compiler/babel-utils";
|
||||
|
||||
export function exit(path) {
|
||||
assertNoArgs(path);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { assertNoAttributes } from "@marko/babel-utils";
|
||||
import { assertNoAttributes } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { buildIfStatement } from "./util";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { registerMacro } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { registerMacro } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default function (path) {
|
||||
const attrs = path.node.attributes;
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { diagnosticError, getMacroIdentifierForName } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
diagnosticError,
|
||||
getMacroIdentifierForName,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import withPreviousLocation from "../../../util/with-previous-location";
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
diagnosticDeprecate,
|
||||
diagnosticError,
|
||||
parseExpression,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import getComponentFiles from "../../util/get-component-files";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { parseStatements } from "@marko/babel-utils";
|
||||
import { parseStatements } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default function (path) {
|
||||
const {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { parseStatements } from "@marko/babel-utils";
|
||||
import { parseStatements } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default function (path) {
|
||||
const {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { parseStatements } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { parseStatements } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default function (path) {
|
||||
const {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getStart } from "@marko/babel-utils";
|
||||
import { getStart } from "@marko/compiler/babel-utils";
|
||||
import path from "path";
|
||||
|
||||
import getComponentFiles from "../../util/get-component-files";
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { assertAllowedAttributes, importDefault } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertAllowedAttributes,
|
||||
importDefault,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
export function exit(path) {
|
||||
const { node } = path;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoAttributes,
|
||||
assertNoParams,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import writeHTML from "../../util/html-out-write";
|
||||
import writeVDOM from "../../util/vdom-out-write";
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { assertNoAttributes, assertNoParams } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoAttributes,
|
||||
assertNoParams,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import path from "path";
|
||||
|
||||
export function enter(tag) {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoAttributes,
|
||||
assertNoParams,
|
||||
getArgOrSequence,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import withPreviousLocation from "../../util/with-previous-location";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { diagnosticDeprecate } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { diagnosticDeprecate } from "@marko/compiler/babel-utils";
|
||||
|
||||
import withPreviousLocation from "../../util/with-previous-location";
|
||||
const kHadAssignment = Symbol();
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
loadFileForImport,
|
||||
parseStatements,
|
||||
resolveRelativePath,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import MagicString from "magic-string";
|
||||
import path from "path";
|
||||
import resolveFrom from "resolve-from";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { normalizeTemplateString } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { normalizeTemplateString } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default function write(strings, ...expressions) {
|
||||
const template = normalizeTemplateString(strings, ...expressions);
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
isLoopTag,
|
||||
isTransparentTag,
|
||||
normalizeTemplateString,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
const KeyManagerLookup = new WeakMap();
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { normalizeTemplateString } from "@marko/babel-utils";
|
||||
import { normalizeTemplateString } from "@marko/compiler/babel-utils";
|
||||
|
||||
const mergeWriteCallsVisitor = {
|
||||
ExpressionStatement(path) {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
computeNode,
|
||||
getTagDef,
|
||||
importDefault,
|
||||
isLoopTag,
|
||||
isNativeTag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { decode } from "he";
|
||||
|
||||
import translateAttributes from "../tag/native-tag[vdom]/attributes";
|
||||
|
||||
@ -35,7 +35,10 @@ Module._resolveFilename = function (request, parent, isMain) {
|
||||
request = nodePath.join(rootDir, request.substring("marko/".length));
|
||||
} else if (request === "marko") {
|
||||
request = rootDir;
|
||||
} else if (request.startsWith("marko/")) {
|
||||
} else if (
|
||||
request !== "marko/package.json" &&
|
||||
request.startsWith("marko/")
|
||||
) {
|
||||
request = nodePath.join(markoDir, request.substring("marko/".length));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const { loadFileForTag } = require("@marko/babel-utils");
|
||||
const { loadFileForTag } = require("@marko/compiler/babel-utils");
|
||||
|
||||
module.exports = (helloTag, t) => {
|
||||
const messageTag = helloTag.getNextSibling();
|
||||
|
||||
@ -12,7 +12,7 @@ const cwdRegExp = new RegExp(
|
||||
"g",
|
||||
);
|
||||
|
||||
describe("translator-class", () => {
|
||||
describe("runtime-class/translator", () => {
|
||||
autotest("fixtures", {
|
||||
cjs: runTest({ output: "html", modules: "cjs" }),
|
||||
html: runTest({ output: "html" }),
|
||||
|
||||
@ -1,48 +1,5 @@
|
||||
{
|
||||
"name": "@marko/translator-default",
|
||||
"version": "6.1.3",
|
||||
"description": "Translates Marko templates to the default Marko runtime.",
|
||||
"keywords": [
|
||||
"babel",
|
||||
"htmljs",
|
||||
"marko",
|
||||
"parse",
|
||||
"parser",
|
||||
"plugin"
|
||||
],
|
||||
"homepage": "https://github.com/marko-js/marko/blob/main/packages/translator-default/README.md",
|
||||
"bugs": "https://github.com/marko-js/marko/issues/new?template=Bug_report.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/marko-js/marko/tree/main/packages/translator-default"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Dylan Piercey <dpiercey@ebay.com>",
|
||||
"main": "src/index.js",
|
||||
"main": "../src/translator/index.js",
|
||||
"types": "index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "babel ./src --out-dir ./dist --copy-files --config-file ../../babel.config.js --env-name=production"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.26.0",
|
||||
"@marko/babel-utils": "^6.6.3",
|
||||
"magic-string": "^0.30.15",
|
||||
"self-closing-tags": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@marko/compiler": "^5.38.5",
|
||||
"marko": "^5.36.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@marko/compiler": "^5.16.1",
|
||||
"marko": "^5.17.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main:override": "dist/index.js"
|
||||
"main:override": "../dist/translator/index.js"
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
"./*.d.marko": "./tag-types/*",
|
||||
"./translator": "./src/translator/index.ts",
|
||||
"./*": "./src/*.ts",
|
||||
"./debug/*": "./src/*.ts"
|
||||
},
|
||||
@ -29,7 +31,9 @@
|
||||
"build": "node -r ~ts ./scripts/bundle.ts"
|
||||
},
|
||||
"exports:override": {
|
||||
"./*.d.marko": "./tag-types/*",
|
||||
"./package.json": "./package.json",
|
||||
"./translator": "./dist/translator/index.js",
|
||||
"./*": {
|
||||
"types": "./dist/*.d.ts",
|
||||
"import": "./dist/*.mjs",
|
||||
|
||||
@ -4,8 +4,23 @@ import path from "path";
|
||||
|
||||
const absWorkingDir = path.join(__dirname, "..");
|
||||
|
||||
Promise.all(
|
||||
["dist/debug", "dist"].flatMap((env) =>
|
||||
Promise.all([
|
||||
// Build translator
|
||||
build({
|
||||
format: "cjs",
|
||||
bundle: true,
|
||||
absWorkingDir,
|
||||
outdir: "dist/translator",
|
||||
sourcemap: false,
|
||||
platform: "node",
|
||||
packages: "external",
|
||||
entryPoints: ["src/translator/index.ts"],
|
||||
define: {
|
||||
MARKO_DEBUG: "false",
|
||||
},
|
||||
}),
|
||||
// Build runtime
|
||||
...["dist/debug", "dist"].flatMap((env) =>
|
||||
["dom", "html"].flatMap((name) => {
|
||||
(["esm", "cjs"] as const).map(async (format) => {
|
||||
const isProd = env === "dist";
|
||||
@ -34,4 +49,7 @@ Promise.all(
|
||||
});
|
||||
}),
|
||||
),
|
||||
);
|
||||
]).catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { loadFileForTag } from "@marko/babel-utils";
|
||||
import type { types } from "@marko/compiler";
|
||||
import { loadFileForTag } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default (helloTag: types.NodePath<types.MarkoTag>, t: typeof types) => {
|
||||
const messageTag = (helloTag as any).getNextSibling();
|
||||
|
||||
@ -9,7 +9,7 @@ import path from "path";
|
||||
import glob from "tiny-glob";
|
||||
import { isDeepStrictEqual } from "util";
|
||||
|
||||
import * as translator from "..";
|
||||
import * as translator from "../translator";
|
||||
import { bundle } from "./utils/bundle";
|
||||
import createBrowser from "./utils/create-browser";
|
||||
import { isThrows, isWait } from "./utils/resolve";
|
||||
@ -53,7 +53,7 @@ const htmlConfig: compiler.Config = { ...baseConfig, output: "html" };
|
||||
const domConfig: compiler.Config = { ...baseConfig, output: "dom" };
|
||||
const snapCache = new Map<unknown, unknown>();
|
||||
|
||||
describe("translator-tags", () => {
|
||||
describe("runtime-tags/translator", () => {
|
||||
before(() => {
|
||||
register({ ...htmlConfig, modules: "cjs" });
|
||||
});
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoAttributes,
|
||||
@ -5,8 +6,7 @@ import {
|
||||
assertNoParams,
|
||||
diagnosticDeprecate,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { parseStatements } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { parseStatements } from "@marko/compiler/babel-utils";
|
||||
export default {
|
||||
parse(tag: t.NodePath<t.MarkoTag>) {
|
||||
const {
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
import { assertNoArgs, assertNoParams, type Tag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
type Tag,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
import evaluate from "../util/evaluate";
|
||||
@ -83,5 +87,5 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#const",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/const.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/const.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
assertNoVar,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
import { isOutputHTML } from "../util/marko-config";
|
||||
@ -60,5 +60,5 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#debug",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/debug.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/debug.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { assertNoArgs, type Tag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { assertNoArgs, type Tag } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { isOutputHTML } from "../util/marko-config";
|
||||
import {
|
||||
@ -87,5 +87,5 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#define",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/define.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/define.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertAllowedAttributes,
|
||||
assertNoArgs,
|
||||
@ -5,8 +6,7 @@ import {
|
||||
assertNoParams,
|
||||
diagnosticDeprecate,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent, assertNoSpreadAttrs } from "../util/assert";
|
||||
import withPreviousLocation from "../util/with-previous-location";
|
||||
@ -39,5 +39,5 @@ export default {
|
||||
},
|
||||
],
|
||||
attributes: {},
|
||||
types: "@marko/translator-tags/tag-types/effect.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/effect.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { parseStatements, type Tag } from "@marko/babel-utils";
|
||||
import { parseStatements, type Tag } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default {
|
||||
parse(tag) {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertAllowedAttributes,
|
||||
assertNoArgs,
|
||||
assertNoVar,
|
||||
getTagDef,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { AccessorChar, WalkCode } from "@marko/runtime-tags/common/types";
|
||||
|
||||
import { assertNoSpreadAttrs } from "../util/assert";
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoAttributes,
|
||||
assertNoParams,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { WalkCode } from "@marko/runtime-tags/common/types";
|
||||
|
||||
import { isOutputHTML } from "../util/marko-config";
|
||||
|
||||
@ -2,8 +2,12 @@
|
||||
// we should probably attempt to share that logic where possible.
|
||||
// Also need to ensure it stays in sync.
|
||||
|
||||
import { assertNoArgs, assertNoParams, type Tag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
type Tag,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import {
|
||||
getEventHandlerName,
|
||||
isEventHandler,
|
||||
|
||||
@ -2,8 +2,12 @@
|
||||
// we should probably attempt to share that logic where possible.
|
||||
// Also need to ensure it stays in sync.
|
||||
|
||||
import { assertNoArgs, assertNoParams, type Tag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
type Tag,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import {
|
||||
getEventHandlerName,
|
||||
isEventHandler,
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoAttributes,
|
||||
assertNoAttributeTags,
|
||||
assertNoParams,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
import { isOutputHTML } from "../util/marko-config";
|
||||
@ -68,5 +68,5 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#id",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/id.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/id.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
assertNoVar,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { AccessorChar, WalkCode } from "@marko/runtime-tags/common/types";
|
||||
|
||||
import { assertNoSpreadAttrs } from "../util/assert";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { parseStatements, type Tag } from "@marko/babel-utils";
|
||||
import { parseStatements, type Tag } from "@marko/compiler/babel-utils";
|
||||
|
||||
export default {
|
||||
parse(tag) {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
computeNode,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { AccessorChar } from "@marko/runtime-tags/common/types";
|
||||
|
||||
import { assertNoBodyContent, assertNoSpreadAttrs } from "../util/assert";
|
||||
@ -152,5 +152,5 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#let",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/let.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/let.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
assertNoVar,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
import { isOutputDOM } from "../util/marko-config";
|
||||
@ -113,5 +113,5 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#effect",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/lifecycle.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/lifecycle.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
assertNoVar,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
import { isOutputHTML } from "../util/marko-config";
|
||||
@ -70,5 +70,5 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#log",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/log.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/log.d.marko",
|
||||
} as Tag;
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertAllowedAttributes,
|
||||
assertNoArgs,
|
||||
assertNoParams,
|
||||
assertNoVar,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import { AccessorChar } from "@marko/runtime-tags/common/types";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoAttributeTags,
|
||||
assertNoParams,
|
||||
parseExpression,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { assertNoBodyContent } from "../util/assert";
|
||||
import { isOutputDOM } from "../util/marko-config";
|
||||
@ -160,7 +160,7 @@ export default {
|
||||
descriptionMoreURL: "https://markojs.com/docs/core-tags/#script",
|
||||
},
|
||||
],
|
||||
types: "@marko/translator-tags/tag-types/script.d.marko",
|
||||
types: "@marko/runtime-tags/tag-types/script.d.marko",
|
||||
} as Tag;
|
||||
|
||||
function isAwaitExpression(node: t.Node) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { parseStatements } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { parseStatements } from "@marko/compiler/babel-utils";
|
||||
export default {
|
||||
parse(tag: t.NodePath<t.MarkoTag>) {
|
||||
const {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { parseStatements } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { parseStatements } from "@marko/compiler/babel-utils";
|
||||
export default {
|
||||
parse(tag: t.NodePath<t.MarkoTag>) {
|
||||
const {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoAttributeTags,
|
||||
@ -6,8 +7,7 @@ import {
|
||||
getStart,
|
||||
importDefault,
|
||||
type Tag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import MagicString, { type SourceMap } from "magic-string";
|
||||
import path from "path";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { resolveRelativePath } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { resolveRelativePath } from "@marko/compiler/babel-utils";
|
||||
|
||||
declare module "@marko/compiler/dist/types" {
|
||||
export interface ProgramExtra {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { computeNode } from "@marko/babel-utils";
|
||||
import type { types as t } from "@marko/compiler";
|
||||
import { computeNode } from "@marko/compiler/babel-utils";
|
||||
|
||||
declare module "@marko/compiler/dist/types" {
|
||||
export interface NodeExtra {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getTagDef } from "@marko/babel-utils";
|
||||
import type { types as t } from "@marko/compiler";
|
||||
import { getTagDef } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { getTagName } from "./get-tag-name";
|
||||
export const taglibId = "marko-core";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { isAttributeTag, isLoopTag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { isAttributeTag, isLoopTag } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { currentProgramPath } from "../visitors/program";
|
||||
import { getParentTag } from "./get-parent-tag";
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import type {
|
||||
EnterExitPlugin,
|
||||
FunctionPlugin,
|
||||
ModulePlugin,
|
||||
Plugin,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
export function enter<T extends t.Node>(
|
||||
modulePlugin: Plugin | void,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { importStar } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { importStar } from "@marko/compiler/babel-utils";
|
||||
import {
|
||||
attr,
|
||||
classAttr,
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
isAttributeTag,
|
||||
isNativeTag,
|
||||
loadFileForTag,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { currentProgramPath } from "../visitors/program";
|
||||
import { isCoreTag } from "./is-core-tag";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getTemplateId } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { getTemplateId } from "@marko/compiler/babel-utils";
|
||||
import { AccessorChar } from "@marko/runtime-tags/common/types";
|
||||
|
||||
import { returnId } from "../core/return";
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import type { MarkoTagExtra } from "@marko/compiler/babel-types";
|
||||
import {
|
||||
isNativeTag,
|
||||
loadFileForTag,
|
||||
resolveTagImport,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import type { MarkoTagExtra } from "@marko/compiler/babel-types";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import withPreviousLocation from "./with-previous-location";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { isAttributeTag, isTransparentTag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { isAttributeTag, isTransparentTag } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { buildForRuntimeCall, getForType } from "../core/for";
|
||||
import { scopeIdentifier, type TemplateExports } from "../visitors/program";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getTemplateId, isNativeTag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import { getTemplateId, isNativeTag } from "@marko/compiler/babel-utils";
|
||||
|
||||
import { getFnRoot, getMarkoRoot } from "../util/get-root";
|
||||
import { isCoreTagName } from "../util/is-core-tag";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { resolveTagImport } from "@marko/babel-utils";
|
||||
import type { types as t } from "@marko/compiler";
|
||||
import { resolveTagImport } from "@marko/compiler/babel-utils";
|
||||
|
||||
import type { TemplateVisitor } from "../util/visitors";
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { loadFileForImport, resolveRelativePath } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
loadFileForImport,
|
||||
resolveRelativePath,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import path from "path";
|
||||
|
||||
import { bindingHasDownstreamExpressions } from "../../util/binding-has-downstream-expressions";
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
import { assertNoArgs, assertNoVar, findParentTag } from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertNoArgs,
|
||||
assertNoVar,
|
||||
findParentTag,
|
||||
} from "@marko/compiler/babel-utils";
|
||||
|
||||
import { isOutputHTML } from "../../util/marko-config";
|
||||
import { BindingType, trackParamsReferences } from "../../util/references";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { types as t } from "@marko/compiler";
|
||||
import {
|
||||
assertAttributesOrSingleArg,
|
||||
getTagTemplate,
|
||||
@ -6,8 +7,7 @@ import {
|
||||
isAttributeTag,
|
||||
loadFileForTag,
|
||||
resolveRelativePath,
|
||||
} from "@marko/babel-utils";
|
||||
import { types as t } from "@marko/compiler";
|
||||
} from "@marko/compiler/babel-utils";
|
||||
import path from "path";
|
||||
|
||||
import { getTagName } from "../../util/get-tag-name";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user