apostrophe 3.18.0 → 3.18.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- # 3.18.0 (2022-05-03)
3
+ ## 3.18.1
4
+
5
+ ### Fixes
6
+
7
+ * The admin UI now rebuilds properly in a development environment when new npm modules are installed in a multisite project (`apos.rootDir` differs from `apos.npmRootDir`).
8
+
9
+ ## 3.18.0 (2022-05-03)
4
10
 
5
11
  ### Adds
6
12
 
@@ -632,11 +632,9 @@ module.exports = {
632
632
  async function lockFileIsNewer(name) {
633
633
  const timestamp = fs.readFileSync(`${bundleDir}/${name}-build-timestamp.txt`, 'utf8');
634
634
  let pkgStats;
635
-
636
- if (await fs.pathExists(`${self.apos.rootDir}/package-lock.json`)) {
637
- pkgStats = await fs.stat(`${self.apos.rootDir}/package-lock.json`);
638
- } else if (await fs.pathExists(`${self.apos.rootDir}/yarn.lock`)) {
639
- pkgStats = await fs.stat(`${self.apos.rootDir}/yarn.lock`);
635
+ const packageLock = await findPackageLock();
636
+ if (packageLock) {
637
+ pkgStats = await fs.stat(packageLock);
640
638
  }
641
639
 
642
640
  const pkgTimestamp = pkgStats && pkgStats.mtimeMs;
@@ -644,6 +642,18 @@ module.exports = {
644
642
  return pkgTimestamp > parseInt(timestamp);
645
643
  }
646
644
 
645
+ async function findPackageLock() {
646
+ const packageLockPath = path.join(self.apos.npmRootDir, 'package-lock.json');
647
+ const yarnPath = path.join(self.apos.npmRootDir, 'yarn.lock');
648
+ if (await fs.pathExists(packageLockPath)) {
649
+ return packageLockPath;
650
+ } else if (await fs.pathExists(yarnPath)) {
651
+ return yarnPath;
652
+ } else {
653
+ return false;
654
+ }
655
+ }
656
+
647
657
  function getComponentName(component, { enumerateImports } = {}, i) {
648
658
  return path
649
659
  .basename(component)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apostrophe",
3
- "version": "3.18.0",
3
+ "version": "3.18.1",
4
4
  "description": "The Apostrophe Content Management System.",
5
5
  "main": "index.js",
6
6
  "scripts": {