@markopack/compiler 0.2.2 → 0.3.1
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/LICENSE +21 -0
- package/dist/index.cjs +1 -1
- package/dist/marko-loader.cjs +11 -9
- package/dist/marko-loader.js +10 -8
- package/package.json +5 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Priestch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __export(MarkoRspackPlugin_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(MarkoRspackPlugin_exports);
|
|
36
36
|
|
|
37
|
-
// ../../node_modules/tsup/assets/cjs_shims.js
|
|
37
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.30_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js
|
|
38
38
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
39
39
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
40
40
|
|
package/dist/marko-loader.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __export(marko_loader_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(marko_loader_exports);
|
|
36
36
|
|
|
37
|
-
// ../../node_modules/tsup/assets/cjs_shims.js
|
|
37
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.30_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js
|
|
38
38
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
39
39
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
40
40
|
|
|
@@ -64,7 +64,7 @@ function makeResolveVirtualDependency(root) {
|
|
|
64
64
|
const name = `${fromId}__${dep.virtualPath.replace(
|
|
65
65
|
/[^a-z0-9_.-]+/gi,
|
|
66
66
|
"_"
|
|
67
|
-
)}.js`;
|
|
67
|
+
)}${import_node_path.default.extname(dep.virtualPath) ? "" : ".js"}`;
|
|
68
68
|
const file = import_node_path.default.join(virtualDir, name);
|
|
69
69
|
import_node_fs.default.mkdirSync(virtualDir, { recursive: true });
|
|
70
70
|
import_node_fs.default.writeFileSync(file, dep.code);
|
|
@@ -97,13 +97,15 @@ function markoLoader(_source) {
|
|
|
97
97
|
output: outputFormat,
|
|
98
98
|
...isServer || isBrowserEntry ? { linkAssets: { runtime: linkAssetsRuntimePath, onAsset } } : {},
|
|
99
99
|
...isServerEntry || isBrowserEntry ? { entry: "page" } : {},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
// All outputs: the translator reports virtual dependencies through
|
|
101
|
+
// this callback — hydrate boundaries (browser), and extracted
|
|
102
|
+
// <style> blocks as `<file>.marko.css` deps (any output). Without
|
|
103
|
+
// it styles are silently dropped (no import is emitted). `root`
|
|
104
|
+
// exists at runtime but is missing from rspack's LoaderContext
|
|
105
|
+
// typings.
|
|
106
|
+
resolveVirtualDependency: makeResolveVirtualDependency(
|
|
107
|
+
this.root || process.cwd()
|
|
108
|
+
),
|
|
107
109
|
...options.babelConfig ? { babelConfig: options.babelConfig } : {},
|
|
108
110
|
sourceMaps: options.sourceMaps ?? false,
|
|
109
111
|
writeVersionComment: false,
|
package/dist/marko-loader.js
CHANGED
|
@@ -24,7 +24,7 @@ function makeResolveVirtualDependency(root) {
|
|
|
24
24
|
const name = `${fromId}__${dep.virtualPath.replace(
|
|
25
25
|
/[^a-z0-9_.-]+/gi,
|
|
26
26
|
"_"
|
|
27
|
-
)}.js`;
|
|
27
|
+
)}${path.extname(dep.virtualPath) ? "" : ".js"}`;
|
|
28
28
|
const file = path.join(virtualDir, name);
|
|
29
29
|
fs.mkdirSync(virtualDir, { recursive: true });
|
|
30
30
|
fs.writeFileSync(file, dep.code);
|
|
@@ -57,13 +57,15 @@ function markoLoader(_source) {
|
|
|
57
57
|
output: outputFormat,
|
|
58
58
|
...isServer || isBrowserEntry ? { linkAssets: { runtime: linkAssetsRuntimePath, onAsset } } : {},
|
|
59
59
|
...isServerEntry || isBrowserEntry ? { entry: "page" } : {},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
// All outputs: the translator reports virtual dependencies through
|
|
61
|
+
// this callback — hydrate boundaries (browser), and extracted
|
|
62
|
+
// <style> blocks as `<file>.marko.css` deps (any output). Without
|
|
63
|
+
// it styles are silently dropped (no import is emitted). `root`
|
|
64
|
+
// exists at runtime but is missing from rspack's LoaderContext
|
|
65
|
+
// typings.
|
|
66
|
+
resolveVirtualDependency: makeResolveVirtualDependency(
|
|
67
|
+
this.root || process.cwd()
|
|
68
|
+
),
|
|
67
69
|
...options.babelConfig ? { babelConfig: options.babelConfig } : {},
|
|
68
70
|
sourceMaps: options.sourceMaps ?? false,
|
|
69
71
|
writeVersionComment: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markopack/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Marko compiler plugin for rspack (used by @markopack/rspack)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,9 +37,6 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "tsup"
|
|
42
|
-
},
|
|
43
40
|
"dependencies": {
|
|
44
41
|
"@marko/compiler": "^5.42.11",
|
|
45
42
|
"@marko/runtime-tags": "^6.4.5"
|
|
@@ -53,5 +50,8 @@
|
|
|
53
50
|
"@types/node": "^24.0.13",
|
|
54
51
|
"tsup": "^8.3.0",
|
|
55
52
|
"typescript": "^5.9.3"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsup"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|