@plasmicapp/cli 0.1.175 → 0.1.176

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.
@@ -0,0 +1,2 @@
1
+ import { PlasmicConfig } from "../utils/config-utils";
2
+ export declare function ensureImportModuleType(config: PlasmicConfig): PlasmicConfig;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ensureImportModuleType = void 0;
4
+ function ensureImportModuleType(config) {
5
+ for (const project of config.projects) {
6
+ for (const component of project.components) {
7
+ component.importSpec.moduleType = "local";
8
+ }
9
+ }
10
+ return config;
11
+ }
12
+ exports.ensureImportModuleType = ensureImportModuleType;
@@ -305,8 +305,10 @@ function makeImportPath(context, fromPath, toPath, stripExt, forceRelative = fal
305
305
  * a local file
306
306
  */
307
307
  function isLocalModulePath(modulePath) {
308
- // It is a local file reference if the importPath includes the file extension
309
- return !!upath_1.default.extname(modulePath);
308
+ // It is a local file reference if the importPath includes the file extension, and
309
+ // modulePath doesn't start with "@" (like an alias by convention, or scoped npm
310
+ // package). This is not a reliable way to detect scoped npm package, but :shrug:
311
+ return !!upath_1.default.extname(modulePath) && !modulePath.startsWith("@");
310
312
  }
311
313
  exports.isLocalModulePath = isLocalModulePath;
312
314
  exports.mkFixImportContext = (config) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/cli",
3
- "version": "0.1.175",
3
+ "version": "0.1.176",
4
4
  "description": "plasmic cli for syncing local code with Plasmic designs",
5
5
  "engines": {
6
6
  "node": ">=12"
@@ -405,8 +405,10 @@ function makeImportPath(
405
405
  * a local file
406
406
  */
407
407
  export function isLocalModulePath(modulePath: string) {
408
- // It is a local file reference if the importPath includes the file extension
409
- return !!path.extname(modulePath);
408
+ // It is a local file reference if the importPath includes the file extension, and
409
+ // modulePath doesn't start with "@" (like an alias by convention, or scoped npm
410
+ // package). This is not a reliable way to detect scoped npm package, but :shrug:
411
+ return !!path.extname(modulePath) && !modulePath.startsWith("@");
410
412
  }
411
413
 
412
414
  export interface ComponentUpdateSummary {