@marko/vite 5.0.8 → 5.0.9

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 +15 -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
@@ -849,9 +849,7 @@ function markoPlugin(opts = {}) {
849
849
  let serverManifest;
850
850
  let basePath = "/";
851
851
  let getMarkoAssetFns;
852
- const tagsAPI = !/^@marko\/translator-(?:default|interop-class-tags)$/.test(
853
- opts.translator || compiler2.globalConfig?.translator || "@marko/translator-default"
854
- );
852
+ let tagsAPI;
855
853
  const entryIds = /* @__PURE__ */ new Set();
856
854
  const cachedSources = /* @__PURE__ */ new Map();
857
855
  const transformWatchFiles = /* @__PURE__ */ new Map();
@@ -1239,6 +1237,20 @@ function markoPlugin(opts = {}) {
1239
1237
  }
1240
1238
  }
1241
1239
  }
1240
+ if (tagsAPI === void 0) {
1241
+ const translatorPackage = opts.translator || compiler2.globalConfig?.translator || "marko/translator";
1242
+ if (/^@marko\/translator-(?:default|interop-class-tags)$/.test(
1243
+ translatorPackage
1244
+ )) {
1245
+ tagsAPI = false;
1246
+ } else {
1247
+ try {
1248
+ tagsAPI = (await import(translatorPackage)).preferAPI !== "class";
1249
+ } catch {
1250
+ tagsAPI = true;
1251
+ }
1252
+ }
1253
+ }
1242
1254
  source = await server_entry_template_default({
1243
1255
  fileName,
1244
1256
  entryData,
package/package.json CHANGED
@@ -1,9 +1,45 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
+ "version": "5.0.9",
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
  }