ember-codemod-v1-to-v2 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-codemod-v1-to-v2",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Codemod to convert Ember addons to v2 addon format",
5
5
  "keywords": [
6
6
  "codemod",
@@ -1,11 +1,21 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { join } from 'node:path';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
3
4
 
4
5
  import glob from 'glob';
5
6
 
6
7
  import { createFiles } from '../../../utils/files.js';
7
8
  import { processTemplate } from '../../../utils/process-template.js';
8
9
 
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+
13
+ function getBlueprintRoot() {
14
+ const codemodRoot = join(__dirname, '../../../..');
15
+
16
+ return join(codemodRoot, 'src/blueprints/ember-addon');
17
+ }
18
+
9
19
  function getFilePath(blueprintFilePath, options) {
10
20
  const { locations } = options;
11
21
 
@@ -36,7 +46,7 @@ function getFilesToSkip(options) {
36
46
  }
37
47
 
38
48
  export function createFilesFromBlueprint(context, options) {
39
- const blueprintRoot = 'src/blueprints/ember-addon';
49
+ const blueprintRoot = getBlueprintRoot();
40
50
 
41
51
  const filesToSkip = getFilesToSkip(options);
42
52