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