@marko/compiler 5.20.3 → 5.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.js CHANGED
@@ -170,8 +170,8 @@ var _fs2 = require("./taglib/fs");let config;const globalThis = typeof window ==
170
170
  * This API is sticking around for compatibility purposes.
171
171
  */meta: false, /**
172
172
  * Allows configuring Marko to compile to different runtimes.
173
- */translator: (() => {const translatorReg = /^(@\/marko\/|marko-)translator-/;let translator = "@marko/translator-default";let pkg;try {pkg = (0, _lassoPackageRoot.getRootPackage)(process.cwd()); // eslint-disable-next-line no-empty
174
- } catch {}if (pkg) {for (const name in pkg.dependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.peerDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.devDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}}return translator;})(), /**
173
+ */translator: (() => {const translatorReg = /^(@marko\/|marko-)translator-/;let translator;let pkg;try {pkg = (0, _lassoPackageRoot.getRootPackage)(process.cwd()); // eslint-disable-next-line no-empty
174
+ } catch {}if (pkg) {for (const name in pkg.dependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.peerDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.devDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}}return translator || "@marko/translator-default";})(), /**
175
175
  * Use a different file system object, eg webpacks CachedInputFileSystem or lasso-caching-fs
176
176
  */fileSystem: _fs.default, /**
177
177
  * By default Marko 5 outputs esm, you can optionally specify commonjs.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/config.js"],"names":["config","globalThis","window","global","MARKO_CONFIG_KEY","Symbol","output","runtimeId","undefined","ast","code","writeVersionComment","ignoreUnrecognizedTags","sourceMaps","meta","translator","translatorReg","pkg","process","cwd","name","dependencies","test","peerDependencies","devDependencies","fileSystem","fs","modules","optimize","resolveVirtualDependency","cache","Map","hydrateIncludeImports","hot","env","MARKO_CONFIG","Object","assign","JSON","parse"],"mappings":"qJAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsJA,kCApJA,IAAIA,MAAJ,CACA,MAAMC,UAAU,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,MAAhC,GAAyCD,MAA5D,CACA,MAAME,gBAAgB,GAAGC,MAAM,CAAC,+BAAD,CAA/B,CAEA,IAAIJ,UAAU,CAACG,gBAAD,CAAd,EAAkC,CAChCJ,MAAM,GAAGC,UAAU,CAACG,gBAAD,CAAnB,CACD,CAFD,MAEO,CACLJ,MAAM,GAAGC,UAAU,CAACG,gBAAD,CAAV,GAA+B,EACtC;AACAE,IAAAA,MAAM,EAAE,MAF8B,EAItC;AACAC,IAAAA,SAAS,EAAEC,SAL2B,EAOtC;AACAC,IAAAA,GAAG,EAAE,KARiC,EAUtC;AACAC,IAAAA,IAAI,EAAE,IAXgC,EAatC;AACJ;AACA;AACA,OACIC,mBAAmB,EAAE,IAjBiB,EAmBtC;AACJ;AACA;AACA,OACIC,sBAAsB,EAAE,KAvBc,EAyBtC;AACJ;AACA;AACA;AACA;AACA,OACIC,UAAU,EAAE,KA/B0B,EAiCtC;AACJ;AACA;AACA;AACA,OACIC,IAAI,EAAE,KAtCgC,EAwCtC;AACJ;AACA,OACIC,UAAU,EAAE,CAAC,MAAM,CACjB,MAAMC,aAAa,GAAG,iCAAtB,CACA,IAAID,UAAU,GAAG,2BAAjB,CACA,IAAIE,GAAJ,CAEA,IAAI,CACFA,GAAG,GAAG,sCAAeC,OAAO,CAACC,GAAR,EAAf,CAAN,CADE,C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C5BC,MAAM,CAACC,MAAP,CAAcrC,MAAd,EAAsBsC,IAAI,CAACC,KAAL,CAAWrB,OAAO,CAACgB,GAAR,CAAYC,YAAvB,CAAtB,EACD,CACF,C,eAEcnC,M,4BAGf,gBAAMA,MAAM,CAACyB,UAAb","sourcesContent":["import fs from \"fs\";\nimport { getRootPackage } from \"lasso-package-root\";\n\nlet config;\nconst globalThis = typeof window === \"undefined\" ? global : window;\nconst MARKO_CONFIG_KEY = Symbol(\"Default Marko Compiler Config\");\n\nif (globalThis[MARKO_CONFIG_KEY]) {\n config = globalThis[MARKO_CONFIG_KEY];\n} else {\n config = globalThis[MARKO_CONFIG_KEY] = {\n // The default output mode for compiled templates\n output: \"html\",\n\n // Override the runtimeid used when calling `marko/components.init` in the `hydrate` output.\n runtimeId: undefined,\n\n // Have Marko provide the final AST in the compile result.\n ast: false,\n\n // Set the false to have Marko not generate the final code string, useful if just reading metadata or AST.\n code: true,\n\n /**\n * Whether the version should be written to the template as a comment e.g.\n * // Compiled using marko@x.x.x - DO NOT EDIT\n */\n writeVersionComment: true,\n\n /**\n * Whether unrecognized tags should be ignored or not. This flag will\n * be enabled by default when compiling XML.\n */\n ignoreUnrecognizedTags: false,\n\n /**\n * Whether source maps should be output with the compiled templates.\n * When `true` a `map` property will be available on the compile result.\n * When `\"inline\"` the sourcemap will be inlined as a comment in the output code.\n * When `\"both\"` both of the above will be used.\n */\n sourceMaps: false,\n\n /**\n * This option inlines all of the meta data in the template.\n * You can also access this metadata via `compile(...).meta`.\n * This API is sticking around for compatibility purposes.\n */\n meta: false,\n\n /**\n * Allows configuring Marko to compile to different runtimes.\n */\n translator: (() => {\n const translatorReg = /^(@\\/marko\\/|marko-)translator-/;\n let translator = \"@marko/translator-default\";\n let pkg;\n\n try {\n pkg = getRootPackage(process.cwd());\n // eslint-disable-next-line no-empty\n } catch {}\n\n if (pkg) {\n for (const name in pkg.dependencies) {\n if (translatorReg.test(name)) {\n if (translator && translator !== name) {\n return;\n }\n\n translator = name;\n }\n }\n\n for (const name in pkg.peerDependencies) {\n if (translatorReg.test(name)) {\n if (translator && translator !== name) {\n return;\n }\n\n translator = name;\n }\n }\n\n for (const name in pkg.devDependencies) {\n if (translatorReg.test(name)) {\n if (translator && translator !== name) {\n return;\n }\n\n translator = name;\n }\n }\n }\n\n return translator;\n })(),\n\n /**\n * Use a different file system object, eg webpacks CachedInputFileSystem or lasso-caching-fs\n */\n fileSystem: fs,\n /**\n * By default Marko 5 outputs esm, you can optionally specify commonjs.\n *\n * Valid options: esm | cjs\n */\n modules: \"esm\",\n\n /**\n * Enables production mode optimizations if true, or not if false.\n * If left as undefined checks for env === \"production\".\n */\n optimize: undefined,\n\n /**\n * This option should be set if `hydrate` output is specified.\n * Maps a virtual dependency to a resolved file which can be implemented\n * for specific bundlers.\n */\n resolveVirtualDependency: undefined,\n\n /**\n * Compiling a Marko template may require other (used) Marko templates to compile.\n * To prevent compiling templates more than once, most of the compilation is cached.\n *\n * The default cache strategy is to clear the cache on every macrotask.\n * If the default cache is overwritten it is up to the user to determine when the\n * cache is cleared.\n */\n cache: new Map(),\n\n /**\n * A regexp or function that receives an import path that matches file types known to be client side assets.\n */\n hydrateIncludeImports:\n /\\.(css|less|s[ac]ss|styl|png|jpe?g|gif|svg|ico|webp|avif|mp4|webm|ogg|mp3|wav|flac|aac|woff2?|eot|ttf|otf)$/,\n\n /**\n * Set to true in order to bring in the hot module replacement runtime.\n */\n hot: false\n };\n\n if (process.env.MARKO_CONFIG) {\n Object.assign(config, JSON.parse(process.env.MARKO_CONFIG));\n }\n}\n\nexport default config;\n\nimport { setFS } from \"./taglib/fs\";\nsetFS(config.fileSystem);\n"],"file":"config.js"}
1
+ {"version":3,"sources":["../src/config.js"],"names":["config","globalThis","window","global","MARKO_CONFIG_KEY","Symbol","output","runtimeId","undefined","ast","code","writeVersionComment","ignoreUnrecognizedTags","sourceMaps","meta","translator","translatorReg","pkg","process","cwd","name","dependencies","test","peerDependencies","devDependencies","fileSystem","fs","modules","optimize","resolveVirtualDependency","cache","Map","hydrateIncludeImports","hot","env","MARKO_CONFIG","Object","assign","JSON","parse"],"mappings":"qJAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsJA,kCApJA,IAAIA,MAAJ,CACA,MAAMC,UAAU,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,MAAhC,GAAyCD,MAA5D,CACA,MAAME,gBAAgB,GAAGC,MAAM,CAAC,+BAAD,CAA/B,CAEA,IAAIJ,UAAU,CAACG,gBAAD,CAAd,EAAkC,CAChCJ,MAAM,GAAGC,UAAU,CAACG,gBAAD,CAAnB,CACD,CAFD,MAEO,CACLJ,MAAM,GAAGC,UAAU,CAACG,gBAAD,CAAV,GAA+B,EACtC;AACAE,IAAAA,MAAM,EAAE,MAF8B,EAItC;AACAC,IAAAA,SAAS,EAAEC,SAL2B,EAOtC;AACAC,IAAAA,GAAG,EAAE,KARiC,EAUtC;AACAC,IAAAA,IAAI,EAAE,IAXgC,EAatC;AACJ;AACA;AACA,OACIC,mBAAmB,EAAE,IAjBiB,EAmBtC;AACJ;AACA;AACA,OACIC,sBAAsB,EAAE,KAvBc,EAyBtC;AACJ;AACA;AACA;AACA;AACA,OACIC,UAAU,EAAE,KA/B0B,EAiCtC;AACJ;AACA;AACA;AACA,OACIC,IAAI,EAAE,KAtCgC,EAwCtC;AACJ;AACA,OACIC,UAAU,EAAE,CAAC,MAAM,CACjB,MAAMC,aAAa,GAAG,+BAAtB,CACA,IAAID,UAAJ,CACA,IAAIE,GAAJ,CAEA,IAAI,CACFA,GAAG,GAAG,sCAAeC,OAAO,CAACC,GAAR,EAAf,CAAN,CADE,CAEF;AACD,OAHD,CAGE,MAAM,CAAE,CAEV,IAAIF,GAAJ,EAAS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C,IAAI,CAACC,KAAL,CAAWrB,OAAO,CAACgB,GAAR,CAAYC,YAAvB,CAAtB,EACD,CACF,C,eAEcnC,M,4BAGf,gBAAMA,MAAM,CAACyB,UAAb","sourcesContent":["import fs from \"fs\";\nimport { getRootPackage } from \"lasso-package-root\";\n\nlet config;\nconst globalThis = typeof window === \"undefined\" ? global : window;\nconst MARKO_CONFIG_KEY = Symbol(\"Default Marko Compiler Config\");\n\nif (globalThis[MARKO_CONFIG_KEY]) {\n config = globalThis[MARKO_CONFIG_KEY];\n} else {\n config = globalThis[MARKO_CONFIG_KEY] = {\n // The default output mode for compiled templates\n output: \"html\",\n\n // Override the runtimeid used when calling `marko/components.init` in the `hydrate` output.\n runtimeId: undefined,\n\n // Have Marko provide the final AST in the compile result.\n ast: false,\n\n // Set the false to have Marko not generate the final code string, useful if just reading metadata or AST.\n code: true,\n\n /**\n * Whether the version should be written to the template as a comment e.g.\n * // Compiled using marko@x.x.x - DO NOT EDIT\n */\n writeVersionComment: true,\n\n /**\n * Whether unrecognized tags should be ignored or not. This flag will\n * be enabled by default when compiling XML.\n */\n ignoreUnrecognizedTags: false,\n\n /**\n * Whether source maps should be output with the compiled templates.\n * When `true` a `map` property will be available on the compile result.\n * When `\"inline\"` the sourcemap will be inlined as a comment in the output code.\n * When `\"both\"` both of the above will be used.\n */\n sourceMaps: false,\n\n /**\n * This option inlines all of the meta data in the template.\n * You can also access this metadata via `compile(...).meta`.\n * This API is sticking around for compatibility purposes.\n */\n meta: false,\n\n /**\n * Allows configuring Marko to compile to different runtimes.\n */\n translator: (() => {\n const translatorReg = /^(@marko\\/|marko-)translator-/;\n let translator;\n let pkg;\n\n try {\n pkg = getRootPackage(process.cwd());\n // eslint-disable-next-line no-empty\n } catch {}\n\n if (pkg) {\n for (const name in pkg.dependencies) {\n if (translatorReg.test(name)) {\n if (translator && translator !== name) {\n return;\n }\n\n translator = name;\n }\n }\n\n for (const name in pkg.peerDependencies) {\n if (translatorReg.test(name)) {\n if (translator && translator !== name) {\n return;\n }\n\n translator = name;\n }\n }\n\n for (const name in pkg.devDependencies) {\n if (translatorReg.test(name)) {\n if (translator && translator !== name) {\n return;\n }\n\n translator = name;\n }\n }\n }\n\n return translator || \"@marko/translator-default\";\n })(),\n\n /**\n * Use a different file system object, eg webpacks CachedInputFileSystem or lasso-caching-fs\n */\n fileSystem: fs,\n /**\n * By default Marko 5 outputs esm, you can optionally specify commonjs.\n *\n * Valid options: esm | cjs\n */\n modules: \"esm\",\n\n /**\n * Enables production mode optimizations if true, or not if false.\n * If left as undefined checks for env === \"production\".\n */\n optimize: undefined,\n\n /**\n * This option should be set if `hydrate` output is specified.\n * Maps a virtual dependency to a resolved file which can be implemented\n * for specific bundlers.\n */\n resolveVirtualDependency: undefined,\n\n /**\n * Compiling a Marko template may require other (used) Marko templates to compile.\n * To prevent compiling templates more than once, most of the compilation is cached.\n *\n * The default cache strategy is to clear the cache on every macrotask.\n * If the default cache is overwritten it is up to the user to determine when the\n * cache is cleared.\n */\n cache: new Map(),\n\n /**\n * A regexp or function that receives an import path that matches file types known to be client side assets.\n */\n hydrateIncludeImports:\n /\\.(css|less|s[ac]ss|styl|png|jpe?g|gif|svg|ico|webp|avif|mp4|webm|ogg|mp3|wav|flac|aac|woff2?|eot|ttf|otf)$/,\n\n /**\n * Set to true in order to bring in the hot module replacement runtime.\n */\n hot: false\n };\n\n if (process.env.MARKO_CONFIG) {\n Object.assign(config, JSON.parse(process.env.MARKO_CONFIG));\n }\n}\n\nexport default config;\n\nimport { setFS } from \"./taglib/fs\";\nsetFS(config.fileSystem);\n"],"file":"config.js"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
3
  "description": "Marko template to JS compiler.",
4
- "version": "5.20.3",
4
+ "version": "5.20.4",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/marko/issues/new?template=Bug_report.md",
7
7
  "dependencies": {
@@ -13,7 +13,7 @@
13
13
  "@babel/runtime": "^7.16.0",
14
14
  "@babel/traverse": "^7.16.0",
15
15
  "@babel/types": "^7.16.0",
16
- "@marko/babel-utils": "^5.20.3",
16
+ "@marko/babel-utils": "^5.20.4",
17
17
  "complain": "^1.6.0",
18
18
  "he": "^1.2.0",
19
19
  "htmljs-parser": "^2.11.1",
@@ -28,7 +28,7 @@
28
28
  "strip-json-comments": "^3.1.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@marko/translator-default": "^5.20.3"
31
+ "@marko/translator-default": "^5.20.4"
32
32
  },
33
33
  "files": [
34
34
  "dist",
@@ -59,5 +59,5 @@
59
59
  "url": "https://github.com/marko-js/marko/tree/master/packages/compiler"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "gitHead": "19f0a44a1e33e865ecf04eb5b9acfb8b610e51bd"
62
+ "gitHead": "5b79719f76e0c090f5c3ca7f94b8aee961dc1e41"
63
63
  }