@komaci/esm-generator 242.1.3 → 242.1.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.
@@ -525,10 +525,10 @@ describe('addImportStatements', () => {
525
525
  const scriptModuleOnlyStatements = [];
526
526
  const combinedModuleStatements = [];
527
527
  (0, genericAstGeneration_1.addImportStatements)(moduleMetadata, scriptModuleOnlyStatements, {
528
- calledFromGenerateCombinedModule: false,
528
+ isComposingFromBundle: false,
529
529
  });
530
530
  (0, genericAstGeneration_1.addImportStatements)(moduleMetadata, combinedModuleStatements, {
531
- calledFromGenerateCombinedModule: true,
531
+ isComposingFromBundle: true,
532
532
  });
533
533
  it('can compose an import with a default and a normal import together', () => {
534
534
  validateForEachList([scriptModuleOnlyStatements, combinedModuleStatements], (statements) => {
@@ -26,11 +26,11 @@ export declare function generateResolvableModule(input: GeneratorInput, scriptKo
26
26
  *
27
27
  * @param {ModuleMetadata} moduleMetadata metadata about the lwc module we are building a resolvable module for
28
28
  * @param {Statement[]} statements Array of Statement to be modified by this method for this program
29
- * @param {{ calledFromGenerateCombinedModule: boolean }} options flag to distinguish whether we have been called
30
- * to generate a combined module or not.
29
+ * @param {{ isComposingFromBundle: boolean }} options flag to distinguish if we are composing a resolvable module from a bundle or a file.
30
+ * this influences the way import statements are composed.
31
31
  */
32
32
  export declare function addImportStatements(moduleMetadata: ModuleMetadata, statements: t.Statement[], options: {
33
- calledFromGenerateCombinedModule: boolean;
33
+ isComposingFromBundle: boolean;
34
34
  }): void;
35
35
  /**
36
36
  * Make ast statements for the details about an error we received
@@ -114,7 +114,7 @@ function generateResolvableModule(input, scriptKomaciDoc, templateKomaciDocMap,
114
114
  const program = t.program(statements);
115
115
  const file = t.file(program);
116
116
  addImportStatements(moduleMetadata, statements, {
117
- calledFromGenerateCombinedModule: combinedModule,
117
+ isComposingFromBundle: isBundle,
118
118
  });
119
119
  // template only resolvable modules are composed completely differently (for now)
120
120
  if (!combinedModule && hasTemplateKomaciDoc) {
@@ -177,8 +177,8 @@ exports.generateResolvableModule = generateResolvableModule;
177
177
  *
178
178
  * @param {ModuleMetadata} moduleMetadata metadata about the lwc module we are building a resolvable module for
179
179
  * @param {Statement[]} statements Array of Statement to be modified by this method for this program
180
- * @param {{ calledFromGenerateCombinedModule: boolean }} options flag to distinguish whether we have been called
181
- * to generate a combined module or not.
180
+ * @param {{ isComposingFromBundle: boolean }} options flag to distinguish if we are composing a resolvable module from a bundle or a file.
181
+ * this influences the way import statements are composed.
182
182
  */
183
183
  function addImportStatements(moduleMetadata, statements, options) {
184
184
  if (moduleMetadata.importsByName.size > 0) {
@@ -224,7 +224,7 @@ function addImportStatements(moduleMetadata, statements, options) {
224
224
  i++;
225
225
  }
226
226
  if ((0, static_analyzer_1.isSupportedNamespace)(resourceName) && specifiers.length > 0) {
227
- if (options.calledFromGenerateCombinedModule &&
227
+ if (options.isComposingFromBundle &&
228
228
  resourceName.startsWith('@salesforce/komaci')) {
229
229
  // @salesforce/komaci/c__foo__foo.js -> @salesforce/komaci/c__foo
230
230
  const lastIndex = resourceName.lastIndexOf('__');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@komaci/esm-generator",
3
- "version": "242.1.3",
3
+ "version": "242.1.4",
4
4
  "description": "Komaci generator for ADG ES modules",
5
5
  "homepage": "https://komaci.dev/",
6
6
  "repository": {
@@ -28,13 +28,13 @@
28
28
  "dependencies": {
29
29
  "@babel/core": "^7.9.0",
30
30
  "@babel/generator": "^7.9.0",
31
- "@komaci/common-shared": "242.1.3",
32
- "@komaci/static-analyzer": "242.1.3",
31
+ "@komaci/common-shared": "242.1.4",
32
+ "@komaci/static-analyzer": "242.1.4",
33
33
  "o11y": "^240.7.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@babel/types": "^7.9.0",
37
- "@komaci/types": "242.1.3",
37
+ "@komaci/types": "242.1.4",
38
38
  "@lwc-platform/sfdc-lwc-compiler": "^2.18.0-240.2"
39
39
  }
40
40
  }