Skip to content

Commit

Permalink
Fix esm
Browse files Browse the repository at this point in the history
  • Loading branch information
vilicvane committed Oct 27, 2023
1 parent a248219 commit 456c13a
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 244 deletions.
6 changes: 5 additions & 1 deletion general/src/composables/@constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import * as Path from 'path';
import {fileURLToPath} from 'url';

export const BOILERPLATE_ROOT = Path.join(__dirname, '../..');
export const BOILERPLATE_ROOT = Path.join(
fileURLToPath(import.meta.url),
'../../..',
);

export const FILES_DIR = Path.join(BOILERPLATE_ROOT, 'files');
export const TEMPLATES_DIR = Path.join(BOILERPLATE_ROOT, 'templates');
Expand Down
3 changes: 2 additions & 1 deletion general/src/library/boilerplate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Path from 'path';
import {fileURLToPath} from 'url';

import type {BoilerplateBuilderContext} from '@magicspace/core';
import {boilerplate, composables, x} from '@magicspace/core';
Expand All @@ -8,7 +9,7 @@ export default boilerplate<Options>(async (options, context) => {
return {
composables: await composables(
{
root: Path.join(__dirname, '../composables'),
root: Path.join(fileURLToPath(import.meta.url), '../../composables'),
pattern: '(?!@)*.js',
},
resolveOptions(options, context),
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"test": "yarn lint-prettier && yarn build && yarn lint"
},
"dependencies": {
"@magicspace/core": "^0.3.3",
"@magicspace/utils": "^0.3.0",
"@magicspace/core": "^0.3.5",
"@magicspace/utils": "^0.3.4",
"lodash": "^4.17.20",
"npm-which": "^3.0.1",
"prettier": "^3.0.3",
Expand Down
6 changes: 5 additions & 1 deletion typescript/src/composables/@constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as Path from 'path';
import {fileURLToPath} from 'url';

export const BOILERPLATE_ROOT = Path.join(__dirname, '../..');
export const BOILERPLATE_ROOT = Path.join(
fileURLToPath(import.meta.url),
'../../..',
);

export const TEMPLATES_DIR = Path.join(BOILERPLATE_ROOT, 'templates');
3 changes: 2 additions & 1 deletion typescript/src/library/@boilerplate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Path from 'path';
import {fileURLToPath} from 'url';

import {boilerplate, composables} from '@magicspace/core';

Expand All @@ -11,7 +12,7 @@ export default boilerplate<Options>(async (options, context) => {
return {
extends: await general(options, context),
composables: await composables(
Path.join(__dirname, '../composables'),
Path.join(fileURLToPath(import.meta.url), '../../composables'),
resolveOptions(options, context),
),
};
Expand Down
Loading

0 comments on commit 456c13a

Please sign in to comment.