@plumeria/compiler 0.18.3 → 0.18.4

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 (2) hide show
  1. package/dist/index.js +21 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -46,16 +46,28 @@ else {
46
46
  }
47
47
  }
48
48
  let coreFilePath;
49
- try {
50
- const corePackageJsonPath = require.resolve('@plumeria/core/package.json', {
51
- paths: [projectRoot, process.cwd()],
52
- });
53
- coreFilePath = path.join(path.dirname(corePackageJsonPath), 'stylesheet.css');
49
+ const coreSourcePackageJsonPath = path.join(process.cwd(), 'package.json');
50
+ const coreSourcePackageJson = JSON.parse(fs.readFileSync(coreSourcePackageJsonPath, 'utf-8'));
51
+ const dependencies = {
52
+ ...coreSourcePackageJson.dependencies,
53
+ ...coreSourcePackageJson.devDependencies,
54
+ };
55
+ const coreVersion = dependencies['@plumeria/core'];
56
+ const resolvedCorePackageJsonPath = require.resolve('@plumeria/core/package.json', {
57
+ paths: [projectRoot, process.cwd()],
58
+ });
59
+ if (workspaceRootFile) {
60
+ if (coreVersion.includes('workspace')) {
61
+ coreFilePath = path.join(path.dirname(resolvedCorePackageJsonPath), 'stylesheet.css');
62
+ }
63
+ else {
64
+ const corePackageJson = JSON.parse(fs.readFileSync(resolvedCorePackageJsonPath, 'utf-8'));
65
+ const exactCoreVersion = corePackageJson.version;
66
+ coreFilePath = path.join(projectRoot, 'node_modules', '.pnpm', `@plumeria+core@${exactCoreVersion}`, 'node_modules', '@plumeria', 'core', 'stylesheet.css');
67
+ }
54
68
  }
55
- catch (error) {
56
- console.error('Could not find "@plumeria/core/stylesheet.css". Please make sure it is installed.' +
57
- error);
58
- process.exit(1);
69
+ else {
70
+ coreFilePath = path.join(path.dirname(resolvedCorePackageJsonPath), 'stylesheet.css');
59
71
  }
60
72
  const cleanUp = async () => {
61
73
  if (process.env.CI && existsSync(coreFilePath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/compiler",
3
- "version": "0.18.3",
3
+ "version": "0.18.4",
4
4
  "description": "Plumeria Rust-based compiler",
5
5
  "repository": {
6
6
  "type": "git",