@lwc/sfdc-lwc-compiler 12.1.1-alpha.0 → 12.3.0
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.
|
@@ -27,9 +27,10 @@ describe('basic sanity tests for site local components', () => {
|
|
|
27
27
|
files: {
|
|
28
28
|
'foo.js': (0, common_tags_1.stripIndents) `
|
|
29
29
|
import { LightningElement } from 'lwc';
|
|
30
|
-
import
|
|
30
|
+
import labelTranslation from 'site/translate';
|
|
31
|
+
import label from '@salesforce/label/site.foo';
|
|
31
32
|
export default class Test extends LightningElement {
|
|
32
|
-
get lbl() { return label; }
|
|
33
|
+
get lbl() { return labelTranslation(label); }
|
|
33
34
|
}
|
|
34
35
|
`,
|
|
35
36
|
'foo.html': (0, common_tags_1.stripIndents) `
|
|
@@ -46,5 +47,67 @@ describe('basic sanity tests for site local components', () => {
|
|
|
46
47
|
expect(report.success).toBe(true);
|
|
47
48
|
expect(report.diagnostics.length).toBe(0);
|
|
48
49
|
});
|
|
50
|
+
describe('metadata', () => {
|
|
51
|
+
test('should collect metadata for site local components', async () => {
|
|
52
|
+
const report = await (0, main_1.compile)({
|
|
53
|
+
bundle: {
|
|
54
|
+
name: 'foo',
|
|
55
|
+
namespace: 'site',
|
|
56
|
+
type: 'platform',
|
|
57
|
+
files: {
|
|
58
|
+
'foo.js': (0, common_tags_1.stripIndents) `
|
|
59
|
+
import { LightningElement } from 'lwc';
|
|
60
|
+
import labelTranslation from 'site/translate';
|
|
61
|
+
import label from '@salesforce/label/site.foo';
|
|
62
|
+
import clabel from '@salesforce/label/c.foo';
|
|
63
|
+
export default class Test extends LightningElement {
|
|
64
|
+
get lbl() { return labelTranslation(label) + labelTranslation(clabel); }
|
|
65
|
+
}
|
|
66
|
+
`,
|
|
67
|
+
'foo.html': (0, common_tags_1.stripIndents) `
|
|
68
|
+
<template>
|
|
69
|
+
<site-child>{lbl}</site-child>
|
|
70
|
+
</template>
|
|
71
|
+
`,
|
|
72
|
+
'foo.css': `
|
|
73
|
+
@import "site/cssLibrary";
|
|
74
|
+
site-foo { color: red; }`,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
expect(report.success).toBe(true);
|
|
79
|
+
expect(report.diagnostics.length).toBe(0);
|
|
80
|
+
expect(report.metadata?.references.sort((ref1, ref2) => ref1.id.localeCompare(ref2.id))).toMatchObject([
|
|
81
|
+
{
|
|
82
|
+
type: 'label',
|
|
83
|
+
id: 'c.foo',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: 'module',
|
|
87
|
+
id: 'lwc',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'component',
|
|
91
|
+
id: 'site-child',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: 'component',
|
|
95
|
+
id: 'site-foo',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: 'label',
|
|
99
|
+
id: 'site.foo',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: 'module',
|
|
103
|
+
id: 'site/cssLibrary',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'module',
|
|
107
|
+
id: 'site/translate',
|
|
108
|
+
},
|
|
109
|
+
]);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
49
112
|
});
|
|
50
113
|
//# sourceMappingURL=compile-site-local.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-site-local.spec.js","sourceRoot":"","sources":["../../src/__tests__/compile-site-local.spec.ts"],"names":[],"mappings":";;AAAA,6CAA2C;AAE3C,kCAAkC;AAElC,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;IAC1D,IAAI,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,MAAM,GAAG,MAAM,IAAA,cAAO,EAAC;YACzB,MAAM,EAAE;gBACJ,IAAI,EAAE,KAAK;gBACX,SAAS,EAAE,MAAM;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EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CACnF,CAAC,aAAa,CAAC;gBACZ;oBACI,IAAI,EAAE,OAAO;oBACb,EAAE,EAAE,OAAO;iBACd;gBACD;oBACI,IAAI,EAAE,QAAQ;oBACd,EAAE,EAAE,KAAK;iBACZ;gBACD;oBACI,IAAI,EAAE,WAAW;oBACjB,EAAE,EAAE,YAAY;iBACnB;gBACD;oBACI,IAAI,EAAE,WAAW;oBACjB,EAAE,EAAE,UAAU;iBACjB;gBACD;oBACI,IAAI,EAAE,OAAO;oBACb,EAAE,EAAE,UAAU;iBACjB;gBACD;oBACI,IAAI,EAAE,QAAQ;oBACd,EAAE,EAAE,iBAAiB;iBACxB;gBACD;oBACI,IAAI,EAAE,QAAQ;oBACd,EAAE,EAAE,gBAAgB;iBACvB;aACJ,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lwc/sfdc-lwc-compiler",
|
|
3
3
|
"description": "LWC compiler for SFDC platform",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.3.0",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"typings": "dist/main.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"@babel/traverse": "7.25.9",
|
|
27
27
|
"@babel/types": "7.26.0",
|
|
28
28
|
"@komaci/esm-generator": "256.0.1",
|
|
29
|
-
"@lwc/dev-server-plugin-lex": "12.
|
|
29
|
+
"@lwc/dev-server-plugin-lex": "12.3.0",
|
|
30
30
|
"@lwc/eslint-plugin-lwc": "3.0.0-beta.2",
|
|
31
31
|
"@lwc/eslint-plugin-lwc-platform": "6.0.0-beta.7",
|
|
32
|
-
"@lwc/metadata": "12.
|
|
33
|
-
"@lwc/sfdc-compiler-utils": "12.
|
|
32
|
+
"@lwc/metadata": "12.3.0",
|
|
33
|
+
"@lwc/sfdc-compiler-utils": "12.3.0",
|
|
34
34
|
"@rollup/plugin-babel": "^6.0.4",
|
|
35
35
|
"@rollup/plugin-replace": "^6.0.1",
|
|
36
36
|
"@rollup/wasm-node": "~4.27.4",
|