@marko/vite 5.0.8 → 5.0.10

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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/dist/index.mjs +17 -3
  3. package/package.json +40 -40
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 eBay Inc. and contributors
3
+ Copyright (c) 2024 eBay Inc. and contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.mjs CHANGED
@@ -4,6 +4,7 @@ import anyMatch from "anymatch";
4
4
  import crypto from "crypto";
5
5
  import glob2 from "fast-glob";
6
6
  import fs4 from "fs";
7
+ import { createRequire } from "module";
7
8
  import path6 from "path";
8
9
  import { pathToFileURL } from "url";
9
10
 
@@ -849,9 +850,7 @@ function markoPlugin(opts = {}) {
849
850
  let serverManifest;
850
851
  let basePath = "/";
851
852
  let getMarkoAssetFns;
852
- const tagsAPI = !/^@marko\/translator-(?:default|interop-class-tags)$/.test(
853
- opts.translator || compiler2.globalConfig?.translator || "@marko/translator-default"
854
- );
853
+ let tagsAPI;
855
854
  const entryIds = /* @__PURE__ */ new Set();
856
855
  const cachedSources = /* @__PURE__ */ new Map();
857
856
  const transformWatchFiles = /* @__PURE__ */ new Map();
@@ -1239,6 +1238,21 @@ function markoPlugin(opts = {}) {
1239
1238
  }
1240
1239
  }
1241
1240
  }
1241
+ if (tagsAPI === void 0) {
1242
+ const translatorPackage = opts.translator || compiler2.globalConfig?.translator || "marko/translator";
1243
+ if (/^@marko\/translator-(?:default|interop-class-tags)$/.test(
1244
+ translatorPackage
1245
+ )) {
1246
+ tagsAPI = false;
1247
+ } else {
1248
+ try {
1249
+ const require2 = createRequire(import.meta.url);
1250
+ tagsAPI = require2(translatorPackage).preferAPI !== "class";
1251
+ } catch {
1252
+ tagsAPI = true;
1253
+ }
1254
+ }
1255
+ }
1242
1256
  source = await server_entry_template_default({
1243
1257
  fileName,
1244
1258
  entryData,
package/package.json CHANGED
@@ -1,9 +1,45 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
+ "version": "5.0.10",
3
4
  "description": "A Marko plugin for Vite",
4
- "version": "5.0.8",
5
- "author": "Dylan Piercey <dpiercey@ebay.com>",
5
+ "keywords": [
6
+ "loader",
7
+ "marko",
8
+ "plugin",
9
+ "transform",
10
+ "vite"
11
+ ],
12
+ "homepage": "https://github.com/marko-js/vite",
6
13
  "bugs": "https://github.com/marko-js/vite/issues",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/marko-js/vite"
17
+ },
18
+ "license": "MIT",
19
+ "author": "Dylan Piercey <dpiercey@ebay.com>",
20
+ "main": "./dist/index.mjs",
21
+ "types": "dist/index.d.ts",
22
+ "files": [
23
+ "dist",
24
+ "!**/__tests__",
25
+ "!**/*.tsbuildinfo"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsc -b && tsx build.mts",
29
+ "change": "changeset add",
30
+ "ci:test": "nyc npm test -- --forbid-only",
31
+ "format": "npm run lint:eslint -- --fix && npm run lint:prettier -- --write",
32
+ "lint": "tsc -b && npm run lint:eslint && npm run lint:prettier -- -l",
33
+ "lint:eslint": "eslint -f unix .",
34
+ "lint:prettier": "prettier \"./**/*{.ts,.js,.json,.md,.yml,rc}\"",
35
+ "prepare": "husky",
36
+ "release": "npm run build && changeset publish",
37
+ "report": "open ./coverage/lcov-report/index.html",
38
+ "test": "cross-env NODE_ENV=test mocha \"./src/**/__tests__/*.test.ts\"",
39
+ "test:inspect": "npm test -- --inspect",
40
+ "test:update": "npm test -- --update",
41
+ "version": "changeset version && npm i --package-lock-only"
42
+ },
7
43
  "dependencies": {
8
44
  "@chialab/cjs-to-esm": "^0.18.0",
9
45
  "anymatch": "^3.1.3",
@@ -34,7 +70,6 @@
34
70
  "eslint": "^9.15.0",
35
71
  "eslint-formatter-unix": "^8.40.0",
36
72
  "eslint-plugin-simple-import-sort": "^12.1.1",
37
- "fixpack": "^4.0.0",
38
73
  "globals": "^15.12.0",
39
74
  "husky": "^9.1.7",
40
75
  "jsdom": "^25.0.1",
@@ -46,50 +81,15 @@
46
81
  "nyc": "^17.1.0",
47
82
  "playwright": "^1.49.0",
48
83
  "prettier": "^3.4.1",
84
+ "prettier-plugin-packagejson": "^2.5.6",
49
85
  "serve-handler": "^6.1.6",
50
86
  "tsx": "^4.19.2",
51
87
  "typescript": "^5.7.2",
52
88
  "typescript-eslint": "^8.16.0",
53
89
  "vite": "^6.0.0"
54
90
  },
55
- "files": [
56
- "dist",
57
- "!**/__tests__",
58
- "!**/*.tsbuildinfo"
59
- ],
60
- "homepage": "https://github.com/marko-js/vite",
61
- "keywords": [
62
- "loader",
63
- "marko",
64
- "plugin",
65
- "transform",
66
- "vite"
67
- ],
68
- "license": "MIT",
69
- "main": "./dist/index.mjs",
70
91
  "peerDependencies": {
71
92
  "@marko/compiler": "^5",
72
93
  "vite": "4 - 6"
73
- },
74
- "repository": {
75
- "type": "git",
76
- "url": "https://github.com/marko-js/vite"
77
- },
78
- "scripts": {
79
- "build": "tsc -b && tsx build.mts",
80
- "change": "changeset add",
81
- "ci:test": "nyc npm test -- --forbid-only",
82
- "format": "npm run lint:eslint -- --fix && npm run lint:prettier -- --write && (fixpack || true)",
83
- "lint": "tsc -b && npm run lint:eslint && npm run lint:prettier -- -l && fixpack",
84
- "lint:eslint": "eslint -f unix .",
85
- "lint:prettier": "prettier \"./**/*{.ts,.js,.json,.md,.yml,rc}\"",
86
- "prepare": "husky",
87
- "release": "npm run build && changeset publish",
88
- "report": "open ./coverage/lcov-report/index.html",
89
- "test": "cross-env NODE_ENV=test mocha \"./src/**/__tests__/*.test.ts\"",
90
- "test:inspect": "npm test -- --inspect",
91
- "test:update": "npm test -- --update",
92
- "version": "changeset version && npm i --package-lock-only"
93
- },
94
- "types": "dist/index.d.ts"
94
+ }
95
95
  }