ember-vite-hmr 1.5.2 → 1.5.3

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.
@@ -4,6 +4,7 @@ import type * as Babel from '@babel/core';
4
4
  import * as glimmer from '@glimmer/syntax';
5
5
  interface ASTPluginEnvironment {
6
6
  locals: string[];
7
+ filename: string;
7
8
  }
8
9
  declare class HotAstProcessor {
9
10
  options: {
@@ -99,11 +99,17 @@ class HotAstProcessor {
99
99
  this.meta.importBindings = new Set();
100
100
  }
101
101
  transform(env) {
102
+ var _a;
102
103
  if (process.env['EMBER_VITE_HMR_ENABLED'] !== 'true') {
103
104
  return {
104
105
  visitor: {},
105
106
  };
106
107
  }
108
+ if ((_a = env.filename) === null || _a === void 0 ? void 0 : _a.includes('node_modules')) {
109
+ return {
110
+ visitor: {},
111
+ };
112
+ }
107
113
  const meta = this.meta;
108
114
  const importVar = meta.importVar ||
109
115
  env.meta.jsutils.bindExpression('null', null, {
@@ -225,13 +231,16 @@ function hotReplaceAst(babel) {
225
231
  },
226
232
  visitor: {
227
233
  Program(path, state) {
228
- var _a, _b;
234
+ var _a, _b, _c;
229
235
  if (!exports.hotAstProcessor.meta.importVar) {
230
236
  return;
231
237
  }
232
238
  if (process.env['EMBER_VITE_HMR_ENABLED'] !== 'true') {
233
239
  return;
234
240
  }
241
+ if ((_a = state.filename) === null || _a === void 0 ? void 0 : _a.includes('node_modules')) {
242
+ return;
243
+ }
235
244
  const util = new babel_import_util_1.ImportUtil(babel, path);
236
245
  const tracked = util.import(path, '@glimmer/tracking', 'tracked');
237
246
  const GlimmerComponent = util.import(path, '@glimmer/component', 'default');
@@ -259,12 +268,12 @@ function hotReplaceAst(babel) {
259
268
  const importDeclaration = findImport(imp);
260
269
  const source = importDeclaration.source.value;
261
270
  const specifier = importDeclaration.specifiers.find((s) => s.local.name === imp);
262
- const specifierName = ((_a = specifier.imported) === null || _a === void 0 ? void 0 : _a.name) ||
263
- ((_b = specifier.imported) === null || _b === void 0 ? void 0 : _b.value) ||
271
+ const specifierName = ((_b = specifier.imported) === null || _b === void 0 ? void 0 : _b.name) ||
272
+ ((_c = specifier.imported) === null || _c === void 0 ? void 0 : _c.value) ||
264
273
  'default';
265
274
  const ast = (0, core_1.parse)(`
266
275
  (async () => {
267
- const c = await import('ember-vite-hmr/virtual/component:${source}:${specifierName}.gjs');
276
+ const c = await import('/ember-vite-hmr/virtual/component:${source}:${specifierName}.gjs');
268
277
  ${exports.hotAstProcessor.meta.importVar}.${imp} = c.default;
269
278
  })()
270
279
  import.meta.hot.accept('${source}');
package/dist/lib/hmr.js CHANGED
@@ -46,7 +46,7 @@ export default class HotComponent extends Component {
46
46
  </template>
47
47
  }
48
48
  `;
49
- const virtualPrefix = 'ember-vite-hmr/virtual/component:';
49
+ const virtualPrefix = '/ember-vite-hmr/virtual/component:';
50
50
  function hmr(enableViteHmrForModes = ['development']) {
51
51
  let conf;
52
52
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-vite-hmr",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "keywords": [
5
5
  "ember-addon"
6
6
  ],
@@ -43,7 +43,7 @@
43
43
  "@babel/traverse": "^7.23.2",
44
44
  "@babel/types": "^7.24.0",
45
45
  "@embroider/addon-shim": "^1.8.9",
46
- "@glimmer/syntax": "^0.88.1",
46
+ "@glimmer/syntax": "^0.92.3",
47
47
  "@types/supports-color": "^8.1.0",
48
48
  "babel-import-util": "^3.0.0",
49
49
  "babel-loader": "^9.1.3",
@@ -72,19 +72,19 @@
72
72
  "@types/fs-extra": "^11.0.4",
73
73
  "@types/lodash": "^4.14.170",
74
74
  "@types/mini-css-extract-plugin": "^2.5.1",
75
- "@types/node": "^20.14.10",
75
+ "@types/node": "^22.5.5",
76
76
  "@types/rsvp": "^4.0.9",
77
77
  "@types/semver": "^7.3.6",
78
78
  "assert-never": "^1.2.1",
79
79
  "babel-import-util": "^3.0.0",
80
80
  "babel-plugin-ember-template-compilation": "^2.3.0",
81
- "concurrently": "^8.0.1",
81
+ "concurrently": "^9.0.1",
82
82
  "content-tag": "^2.0.1",
83
83
  "ember-cli-htmlbars": "^6.3.0",
84
- "ember-resolver": "^11.0.1",
84
+ "ember-resolver": "^13.0.1",
85
85
  "ember-source": "^5.10.1",
86
86
  "@glimmer/component": "^1.1.2",
87
- "ember-template-lint": "^5.11.2",
87
+ "ember-template-lint": "^6.0.0",
88
88
  "eslint": "^8.33.0",
89
89
  "eslint-config-prettier": "^9.0.0",
90
90
  "eslint-plugin-ember": "^12.2.0",