@lwc/lwc-dev-server 10.6.0 → 10.7.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/dist/bin.js +1 -2
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/bundler/lexBundler.d.ts +4 -4
- package/dist/server/bundler/lexBundler.js +14 -16
- package/dist/server/bundler/lexBundler.js.map +1 -1
- package/dist/server/bundler/lexBundler.spec.js +90 -48
- package/dist/server/bundler/lexBundler.spec.js.map +1 -1
- package/dist/server/connection/client.d.ts +5 -7
- package/dist/server/connection/client.js +24 -41
- package/dist/server/connection/client.js.map +1 -1
- package/dist/server/connection/client.spec.js +96 -59
- package/dist/server/connection/client.spec.js.map +1 -1
- package/dist/server/connection/connection.d.ts +4 -4
- package/dist/server/connection/connection.js +9 -3
- package/dist/server/connection/connection.js.map +1 -1
- package/dist/server/connection/connection.spec.js +7 -9
- package/dist/server/connection/connection.spec.js.map +1 -1
- package/dist/server/connection/web-socket-server.d.ts +2 -1
- package/dist/server/connection/web-socket-server.js +5 -6
- package/dist/server/connection/web-socket-server.js.map +1 -1
- package/dist/server/connection/web-socket-server.spec.js +2 -6
- package/dist/server/connection/web-socket-server.spec.js.map +1 -1
- package/dist/server/index.d.ts +5 -4
- package/dist/server/index.js +13 -13
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.spec.js +45 -32
- package/dist/server/index.spec.js.map +1 -1
- package/dist/server/moduleGraph/index.d.ts +18 -42
- package/dist/server/moduleGraph/index.js +72 -119
- package/dist/server/moduleGraph/index.js.map +1 -1
- package/dist/server/moduleGraph/index.spec.js +106 -52
- package/dist/server/moduleGraph/index.spec.js.map +1 -1
- package/dist/server/moduleGraph/module.d.ts +78 -0
- package/dist/server/moduleGraph/module.js +126 -0
- package/dist/server/moduleGraph/module.js.map +1 -0
- package/dist/server/moduleGraph/module.spec.d.ts +1 -0
- package/dist/server/moduleGraph/module.spec.js +70 -0
- package/dist/server/moduleGraph/module.spec.js.map +1 -0
- package/dist/server/moduleGraph/workspaceScanner/__tests__/fileReader.spec.js +3 -3
- package/dist/server/moduleGraph/workspaceScanner/__tests__/fileReader.spec.js.map +1 -1
- package/dist/server/moduleGraph/workspaceScanner/__tests__/internal.spec.js +8 -9
- package/dist/server/moduleGraph/workspaceScanner/__tests__/internal.spec.js.map +1 -1
- package/dist/server/moduleGraph/workspaceScanner/__tests__/mrt.spec.js +1 -6
- package/dist/server/moduleGraph/workspaceScanner/__tests__/mrt.spec.js.map +1 -1
- package/dist/server/moduleGraph/workspaceScanner/__tests__/sfcli.spec.js +1 -6
- package/dist/server/moduleGraph/workspaceScanner/__tests__/sfcli.spec.js.map +1 -1
- package/dist/server/moduleGraph/workspaceScanner/fileReader.d.ts +8 -2
- package/dist/server/moduleGraph/workspaceScanner/fileReader.js +16 -17
- package/dist/server/moduleGraph/workspaceScanner/fileReader.js.map +1 -1
- package/dist/server/moduleGraph/workspaceScanner/index.d.ts +2 -1
- package/dist/server/moduleGraph/workspaceScanner/index.js.map +1 -1
- package/dist/server/moduleGraph/workspaceScanner/salesforceCli.js +2 -14
- package/dist/server/moduleGraph/workspaceScanner/salesforceCli.js.map +1 -1
- package/dist/server/moduleGraph/workspaceScanner/scanner.d.ts +8 -34
- package/dist/server/moduleGraph/workspaceScanner/scanner.js +9 -18
- package/dist/server/moduleGraph/workspaceScanner/scanner.js.map +1 -1
- package/dist/server/util/module-util.d.ts +10 -0
- package/dist/server/util/module-util.js +10 -0
- package/dist/server/util/module-util.js.map +1 -0
- package/dist/server/watcher/index.js +1 -2
- package/dist/server/watcher/index.js.map +1 -1
- package/dist/server/watcher/index.spec.js +1 -1
- package/dist/server/watcher/index.spec.js.map +1 -1
- package/dist/types/devServer.d.ts +2 -4
- package/dist/types/serverConfig.d.ts +0 -12
- package/dist/types/serverConfig.js +0 -12
- package/dist/types/serverConfig.js.map +1 -1
- package/package.json +5 -5
- package/dist/server/consoleLogger.d.ts +0 -6
- package/dist/server/consoleLogger.js +0 -33
- package/dist/server/consoleLogger.js.map +0 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { LogLevel } from '../types/index.js';
|
|
2
1
|
import { LWCServer } from './index.js';
|
|
3
2
|
import { AuthenticatedWebSocketServer } from './connection/web-socket-server.js';
|
|
4
3
|
import { ModuleGraph } from './moduleGraph/index.js';
|
|
5
|
-
import ConsoleLogger from './consoleLogger.js';
|
|
6
4
|
import { Client } from './connection/client.js';
|
|
7
5
|
import { Connection } from './connection/connection.js';
|
|
8
6
|
vi.mock('./connection/web-socket-server.js', () => ({
|
|
@@ -11,27 +9,35 @@ vi.mock('./connection/web-socket-server.js', () => ({
|
|
|
11
9
|
close: vi.fn(),
|
|
12
10
|
})),
|
|
13
11
|
}));
|
|
14
|
-
vi.mock('./moduleGraph/index.js', () =>
|
|
15
|
-
ModuleGraph
|
|
16
|
-
|
|
12
|
+
vi.mock('./moduleGraph/index.js', () => {
|
|
13
|
+
const ModuleGraph = vi.fn();
|
|
14
|
+
ModuleGraph.prototype.on = vi.fn();
|
|
15
|
+
ModuleGraph.prototype.close = vi.fn();
|
|
16
|
+
return { ModuleGraph };
|
|
17
|
+
});
|
|
17
18
|
vi.mock('./consoleLogger.js');
|
|
18
|
-
vi.mock('./connection/client.js', () =>
|
|
19
|
-
Client
|
|
20
|
-
|
|
19
|
+
vi.mock('./connection/client.js', () => {
|
|
20
|
+
const Client = vi.fn(() => ({
|
|
21
|
+
send: vi.fn(),
|
|
22
|
+
onClose: vi.fn(),
|
|
23
|
+
}));
|
|
24
|
+
return { Client };
|
|
25
|
+
});
|
|
21
26
|
vi.mock('./connection/connection.js');
|
|
22
27
|
describe('LWCServer', () => {
|
|
23
28
|
let config;
|
|
24
|
-
|
|
29
|
+
const logger = {
|
|
30
|
+
info: vi.fn(),
|
|
31
|
+
error: vi.fn(),
|
|
32
|
+
};
|
|
25
33
|
let wss;
|
|
26
34
|
let lwcServer;
|
|
27
35
|
beforeEach(() => {
|
|
28
36
|
config = {
|
|
29
37
|
paths: ['/some/path'],
|
|
30
|
-
logLevel: LogLevel.info,
|
|
31
38
|
identityToken: 'test-token',
|
|
32
39
|
maxClientCount: 2,
|
|
33
40
|
};
|
|
34
|
-
logger = new ConsoleLogger(config.logLevel);
|
|
35
41
|
wss = new AuthenticatedWebSocketServer(config, logger);
|
|
36
42
|
lwcServer = new LWCServer(config, wss, logger);
|
|
37
43
|
});
|
|
@@ -57,34 +63,41 @@ describe('LWCServer', () => {
|
|
|
57
63
|
});
|
|
58
64
|
it('should close and stop server when moduleGraph closes', () => {
|
|
59
65
|
const onError = vi
|
|
60
|
-
.mocked(
|
|
61
|
-
.
|
|
66
|
+
.mocked(vi.mocked(ModuleGraph).mock.instances[0].on)
|
|
67
|
+
.mock.calls.find(([eventName]) => eventName === 'close')[1];
|
|
62
68
|
//@ts-ignore can't fix :(
|
|
63
69
|
onError();
|
|
64
70
|
expect(wss.close).toHaveBeenCalled();
|
|
65
71
|
});
|
|
72
|
+
it('should broadcast to all clients when moduleGraph update is emitted', () => {
|
|
73
|
+
const onNewConnection = vi.mocked(wss.onNewConnection).mock.calls[0][0];
|
|
74
|
+
// @ts-expect-error
|
|
75
|
+
onNewConnection(new Connection(), 'ws://localhost');
|
|
76
|
+
// @ts-expect-error
|
|
77
|
+
onNewConnection(new Connection(), 'ws://localhost');
|
|
78
|
+
const firstClient = vi.mocked(Client).mock.results[0].value;
|
|
79
|
+
const secondClient = vi.mocked(Client).mock.results[1].value;
|
|
80
|
+
const onUpdate = vi
|
|
81
|
+
.mocked(vi.mocked(ModuleGraph).mock.instances[0].on)
|
|
82
|
+
.mock.calls.find(([eventName]) => eventName === 'update')[1];
|
|
83
|
+
//@ts-ignore can't fix :(
|
|
84
|
+
onUpdate();
|
|
85
|
+
expect(firstClient.send).toHaveBeenCalled();
|
|
86
|
+
expect(secondClient.send).toHaveBeenCalled();
|
|
87
|
+
// close second client and clear its mocks
|
|
88
|
+
vi.mocked(secondClient.onClose).mock.calls[0][0]();
|
|
89
|
+
vi.mocked(secondClient.send).mockClear();
|
|
90
|
+
//@ts-ignore can't fix :(
|
|
91
|
+
onUpdate();
|
|
92
|
+
expect(firstClient.send).toHaveBeenCalled();
|
|
93
|
+
expect(secondClient.send).not.toHaveBeenCalled();
|
|
94
|
+
});
|
|
66
95
|
it('should stop the server and release resources', () => {
|
|
67
96
|
lwcServer.stopServer();
|
|
68
|
-
expect(logger.
|
|
69
|
-
expect(
|
|
97
|
+
expect(logger.info).toHaveBeenCalledWith('[LWC Dev Server] Stopping the dev server');
|
|
98
|
+
expect(vi.mocked(ModuleGraph).mock.instances[0].close).toHaveBeenCalled();
|
|
70
99
|
expect(lwcServer.wss.close).toHaveBeenCalled();
|
|
71
|
-
expect(logger.
|
|
72
|
-
});
|
|
73
|
-
it('should send update messages to all connected clients', () => {
|
|
74
|
-
const mockClient1 = new Client('client1', 'ws://localhost', {}, lwcServer.context);
|
|
75
|
-
const mockClient2 = new Client('client2', 'ws://localhost', {}, lwcServer.context);
|
|
76
|
-
lwcServer.clients.add(mockClient1);
|
|
77
|
-
lwcServer.clients.add(mockClient2);
|
|
78
|
-
const modulePath = '/some/module/path';
|
|
79
|
-
lwcServer.moduleUpdateHandler(modulePath);
|
|
80
|
-
expect(mockClient1.send).toHaveBeenCalledWith({
|
|
81
|
-
type: 'update',
|
|
82
|
-
data: [{ modulePath }],
|
|
83
|
-
});
|
|
84
|
-
expect(mockClient2.send).toHaveBeenCalledWith({
|
|
85
|
-
type: 'update',
|
|
86
|
-
data: [{ modulePath }],
|
|
87
|
-
});
|
|
100
|
+
expect(logger.info).toHaveBeenCalledWith('[LWC Dev Server] Succesfully stopped dev server');
|
|
88
101
|
});
|
|
89
102
|
});
|
|
90
103
|
//# sourceMappingURL=index.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../src/server/index.spec.ts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CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACpD,SAAS,CAAC,UAAU,EAAE,CAAC;QAEvB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,0CAA0C,CAAC,CAAC;QACrF,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAC1E,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAC/C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,iDAAiD,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,60 +1,36 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import { FSWatcher } from 'chokidar';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import type {
|
|
7
|
-
export type Module = any;
|
|
3
|
+
import { Logger } from '@salesforce/core';
|
|
4
|
+
import { ServerConfig } from '../../types/index.js';
|
|
5
|
+
import { Module, ModulePart } from './module.js';
|
|
6
|
+
import type { WorkspaceScanner } from './workspaceScanner/scanner';
|
|
8
7
|
export interface EventMap {
|
|
9
8
|
update: [string];
|
|
10
9
|
close: [];
|
|
10
|
+
delete: [string];
|
|
11
|
+
'delete-module': [string];
|
|
11
12
|
}
|
|
12
13
|
export declare class ModuleGraph extends EventEmitter<EventMap> {
|
|
13
14
|
logger: Logger;
|
|
14
15
|
watcher: FSWatcher;
|
|
15
16
|
workspaceScanner: WorkspaceScanner;
|
|
16
|
-
|
|
17
|
-
* All LWC modules and their parts with absolute file paths, for the current workspace.
|
|
18
|
-
*/
|
|
19
|
-
moduleMap: Map<string, ModuleMapEntry>;
|
|
20
|
-
fileToModulePathMap: {
|
|
21
|
-
[key: string]: string;
|
|
22
|
-
};
|
|
23
|
-
modulePathToModuleInfo: {
|
|
24
|
-
[key: string]: ModuleInfo;
|
|
25
|
-
};
|
|
17
|
+
modules: Map<string, Module>;
|
|
26
18
|
constructor(config: ServerConfig, logger: Logger);
|
|
27
|
-
init
|
|
28
|
-
getModulePathByFile(path: string): string | undefined;
|
|
29
|
-
getFileByModulePath(modulePath: string): string | undefined;
|
|
19
|
+
private init;
|
|
30
20
|
/**
|
|
31
21
|
* Gets the stale modules from the list of modules
|
|
32
22
|
* @param modules
|
|
33
23
|
* @returns Modules paths that are determined to be stale wrt the content monitored by the dev server
|
|
34
24
|
*/
|
|
35
|
-
getStaleModules(modules:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* Since JS hot swap is currently supporting components, this focused update of the main entry file
|
|
46
|
-
* is acceptable.
|
|
47
|
-
* @param modulePath The module that changed
|
|
48
|
-
* @return The modulePath of the boundary that needs to be updated.
|
|
49
|
-
*/
|
|
50
|
-
getModuleBoundary(modulePath: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* Fetch files and source related to the modulePath that is being hot loaded.
|
|
53
|
-
* @param {string} name Name of the component being compiled
|
|
54
|
-
* @param {string} namespace The namespace of the component
|
|
55
|
-
* @param {string} modulePath The formatted path for the file being compiled.
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
getModuleFiles(name: string, namespace: string, modulePath: string): BundleFiles;
|
|
25
|
+
getStaleModules(modules: {
|
|
26
|
+
id: string;
|
|
27
|
+
part: string;
|
|
28
|
+
hash: string;
|
|
29
|
+
}[]): Set<string>;
|
|
30
|
+
private fileChangeHandler;
|
|
31
|
+
private fileAddHandler;
|
|
32
|
+
private fileDeleteHandler;
|
|
33
|
+
getModulePart(modulePath: string): ModulePart | undefined;
|
|
34
|
+
private getModulePartByFile;
|
|
59
35
|
close(): void;
|
|
60
36
|
}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
1
|
import { EventEmitter } from 'events';
|
|
4
|
-
import
|
|
5
|
-
import { getModuleHash } from '../util/fileUtil.js';
|
|
2
|
+
import path from 'path';
|
|
6
3
|
import { startWatch } from '../watcher/index.js';
|
|
4
|
+
import { decodeModulePath } from '../util/module-util.js';
|
|
7
5
|
import { getWorkspaceScanner } from './workspaceScanner/index.js';
|
|
6
|
+
import { InvalidModuleError } from './module.js';
|
|
8
7
|
export class ModuleGraph extends EventEmitter {
|
|
9
8
|
constructor(config, logger) {
|
|
10
9
|
super();
|
|
11
|
-
|
|
12
|
-
* All LWC modules and their parts with absolute file paths, for the current workspace.
|
|
13
|
-
*/
|
|
14
|
-
this.moduleMap = new Map();
|
|
15
|
-
// Mapping from <absolute file path> => "<namespace>/<componentname>/component.js"
|
|
16
|
-
this.fileToModulePathMap = Object.create(null);
|
|
17
|
-
// Mapping from "<namespace>/<componentname>/component.js" => { moduleFilePath, moduleSourceHash }
|
|
18
|
-
this.modulePathToModuleInfo = Object.create(null);
|
|
10
|
+
this.modules = new Map();
|
|
19
11
|
this.watcher = startWatch(config.paths);
|
|
20
12
|
this.logger = logger;
|
|
21
13
|
this.workspaceScanner = getWorkspaceScanner(config, logger);
|
|
@@ -23,35 +15,25 @@ export class ModuleGraph extends EventEmitter {
|
|
|
23
15
|
this.init();
|
|
24
16
|
}
|
|
25
17
|
init() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.
|
|
18
|
+
const modules = this.workspaceScanner.getModules();
|
|
19
|
+
for (const module of modules) {
|
|
20
|
+
this.modules.set(module.id(), module);
|
|
21
|
+
}
|
|
22
|
+
if (modules.length) {
|
|
23
|
+
this.logger.debug(`[Module Graph] Found ${modules.length} LWC components in the current workspace.`);
|
|
29
24
|
}
|
|
30
25
|
else {
|
|
31
|
-
this.logger.
|
|
26
|
+
this.logger.debug(`[Module Graph] Found no LWC components in the current workspace.`);
|
|
32
27
|
}
|
|
33
|
-
this.moduleMap.forEach(({ moduleParts }) => {
|
|
34
|
-
Object.assign(this.modulePathToModuleInfo, moduleParts);
|
|
35
|
-
for (const [modulePath, moduleInfo] of Object.entries(moduleParts)) {
|
|
36
|
-
this.fileToModulePathMap[moduleInfo.moduleFilePath] = modulePath;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
28
|
this.watcher.on('change', this.fileChangeHandler.bind(this));
|
|
29
|
+
this.watcher.on('add', this.fileAddHandler.bind(this));
|
|
30
|
+
this.watcher.on('unlink', this.fileDeleteHandler.bind(this));
|
|
40
31
|
this.watcher.on('error', (event) => {
|
|
41
|
-
this.logger.
|
|
42
|
-
this.logger.
|
|
32
|
+
this.logger.error('[LWC Dev Server] Encountered error while watching files');
|
|
33
|
+
this.logger.debug(`[LWC Dev Server] File watcher error: ${event.message}`);
|
|
43
34
|
this.emit('close');
|
|
44
35
|
});
|
|
45
36
|
}
|
|
46
|
-
// Given absolute file path, get the modulePath
|
|
47
|
-
// Mapping from <absolute file path> => "<namespace>/<componentname>/component.js"
|
|
48
|
-
getModulePathByFile(path) {
|
|
49
|
-
return this.fileToModulePathMap[path];
|
|
50
|
-
}
|
|
51
|
-
// Given the modulePath, get the absolute file path for that module
|
|
52
|
-
getFileByModulePath(modulePath) {
|
|
53
|
-
return this.modulePathToModuleInfo[modulePath]?.moduleFilePath;
|
|
54
|
-
}
|
|
55
37
|
/**
|
|
56
38
|
* Gets the stale modules from the list of modules
|
|
57
39
|
* @param modules
|
|
@@ -60,111 +42,82 @@ export class ModuleGraph extends EventEmitter {
|
|
|
60
42
|
getStaleModules(modules) {
|
|
61
43
|
const staleModules = [];
|
|
62
44
|
const unTrackedModules = [];
|
|
63
|
-
modules.forEach((
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
45
|
+
modules.forEach(({ id, part, hash }) => {
|
|
46
|
+
const module = this.modules.get(id);
|
|
47
|
+
if (!module) {
|
|
48
|
+
unTrackedModules.push(id);
|
|
66
49
|
return;
|
|
67
|
-
const moduleInfo = this.modulePathToModuleInfo[modulePath];
|
|
68
|
-
if (!moduleInfo) {
|
|
69
|
-
unTrackedModules.push(modulePath);
|
|
70
50
|
}
|
|
71
|
-
|
|
72
|
-
staleModules.push(
|
|
51
|
+
if (!module.getPart(part) || module.getPart(part).moduleSourceHash !== hash) {
|
|
52
|
+
staleModules.push(module);
|
|
73
53
|
}
|
|
74
54
|
});
|
|
75
55
|
unTrackedModules.length &&
|
|
76
|
-
this.logger.
|
|
56
|
+
this.logger.debug(`[Module Graph] Following modules are unknown to dev server: \n\t ${unTrackedModules.join(',\n\t')}`);
|
|
77
57
|
staleModules.length &&
|
|
78
|
-
this.logger.
|
|
58
|
+
this.logger.debug(`[Module Graph] Following modules have a different version: \n\t ${staleModules.map((module) => module.id()).join(',\n\t')}`);
|
|
79
59
|
const staleModuleBoundaries = new Set();
|
|
80
|
-
for (const
|
|
81
|
-
staleModuleBoundaries.add(
|
|
60
|
+
for (const module of staleModules) {
|
|
61
|
+
staleModuleBoundaries.add(module.getEntryFile());
|
|
82
62
|
}
|
|
83
63
|
return staleModuleBoundaries;
|
|
84
64
|
}
|
|
85
65
|
fileChangeHandler(filePath) {
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
88
|
-
return;
|
|
89
|
-
const modulePath = this.getModulePathByFile(changedFile);
|
|
90
|
-
if (!modulePath)
|
|
66
|
+
const modulePart = this.getModulePartByFile(filePath);
|
|
67
|
+
if (!modulePart)
|
|
91
68
|
return;
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
69
|
+
const { module, part } = modulePart;
|
|
70
|
+
if (module.addOrUpdatePart(part)) {
|
|
71
|
+
this.logger.info(`[LWC Dev Server] File '${part}' modified - updating.`);
|
|
72
|
+
this.emit('update', module.getModuleBoundary(part));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
fileAddHandler(filePath) {
|
|
76
|
+
const modulePart = this.getModulePartByFile(filePath);
|
|
77
|
+
if (!modulePart)
|
|
95
78
|
return;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.emit('update', moduleBoundary);
|
|
79
|
+
const { module, part } = modulePart;
|
|
80
|
+
if (module.addOrUpdatePart(part)) {
|
|
81
|
+
this.logger.info(`[LWC Dev Server] File '${part}' added - updating.`);
|
|
82
|
+
this.emit('update', module.getEntryFile());
|
|
83
|
+
}
|
|
102
84
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
* @return The modulePath of the boundary that needs to be updated.
|
|
115
|
-
*/
|
|
116
|
-
getModuleBoundary(modulePath) {
|
|
117
|
-
const { ext } = path.parse(modulePath);
|
|
118
|
-
if (['.html', '.css'].includes(ext)) {
|
|
119
|
-
return modulePath;
|
|
85
|
+
fileDeleteHandler(filePath) {
|
|
86
|
+
const modulePart = this.getModulePartByFile(filePath);
|
|
87
|
+
if (!modulePart)
|
|
88
|
+
return;
|
|
89
|
+
const { module, part } = modulePart;
|
|
90
|
+
module.deletePart(part);
|
|
91
|
+
try {
|
|
92
|
+
// When files are deleted, we re-render the entire component, so we update the entry file itself
|
|
93
|
+
this.logger.info(`[LWC Dev Server] File '${filePath}' deleted - updating.`);
|
|
94
|
+
const entryFile = module.getEntryFile();
|
|
95
|
+
this.emit('update', entryFile);
|
|
120
96
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const { moduleParts } = moduleMapEntry;
|
|
127
|
-
const entryFile = [
|
|
128
|
-
`${namespace}/${name}/${name}.js`,
|
|
129
|
-
`${namespace}/${name}/${name}.ts`,
|
|
130
|
-
`${namespace}/${name}/${name}.css`,
|
|
131
|
-
].find((entry) => Object.hasOwnProperty.call(moduleParts, entry));
|
|
132
|
-
if (entryFile) {
|
|
133
|
-
return entryFile;
|
|
134
|
-
}
|
|
135
|
-
throw new Error(`[LWC Dev Server] Unable to determine entry file for path: ${modulePath}`);
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error instanceof InvalidModuleError) {
|
|
99
|
+
this.logger.info(`[LWC Dev Server] Entry File '${filePath}' deleted. Deleted module - updating.`);
|
|
100
|
+
this.modules.delete(module.id());
|
|
101
|
+
this.emit('delete-module', module.id());
|
|
136
102
|
}
|
|
137
103
|
}
|
|
138
|
-
throw new Error(`[LWC Dev Server] Unrecognized file type or file not part of LWC module: ${modulePath}`);
|
|
139
104
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const moduleFilePath = this.getFileByModulePath(modulePath);
|
|
152
|
-
const fileEntry = path.relative(moduleDir, modulePath);
|
|
153
|
-
// It can be assumed that the module file exists and the source can be read
|
|
154
|
-
const src = fs.readFileSync(moduleFilePath, 'utf-8');
|
|
155
|
-
return { [fileEntry]: src };
|
|
156
|
-
}
|
|
157
|
-
else if (['.js', '.ts'].includes(ext)) {
|
|
158
|
-
const ownerModuleId = this.modulePathToModuleInfo[modulePath].ownerModuleId;
|
|
159
|
-
const moduleMapEntry = this.moduleMap.get(ownerModuleId);
|
|
160
|
-
return Object.keys(moduleMapEntry.moduleParts).reduce((acc, key) => {
|
|
161
|
-
const part = path.relative(moduleDir, key);
|
|
162
|
-
const partSrc = fs.readFileSync(moduleMapEntry.moduleParts[key].moduleFilePath, 'utf-8');
|
|
163
|
-
acc[part] = partSrc;
|
|
164
|
-
return acc;
|
|
165
|
-
}, {});
|
|
105
|
+
getModulePart(modulePath) {
|
|
106
|
+
const { id, part } = decodeModulePath(modulePath);
|
|
107
|
+
const module = this.modules.get(id);
|
|
108
|
+
if (module)
|
|
109
|
+
return { module, part };
|
|
110
|
+
}
|
|
111
|
+
getModulePartByFile(file) {
|
|
112
|
+
let module;
|
|
113
|
+
for (const m of this.modules.values()) {
|
|
114
|
+
if (file.startsWith(m.baseDir))
|
|
115
|
+
module = m;
|
|
166
116
|
}
|
|
167
|
-
|
|
117
|
+
if (!module)
|
|
118
|
+
return;
|
|
119
|
+
const part = path.relative(module.baseDir, file);
|
|
120
|
+
return { module, part };
|
|
168
121
|
}
|
|
169
122
|
close() {
|
|
170
123
|
this.watcher.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/moduleGraph/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/moduleGraph/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAsB,MAAM,aAAa,CAAC;AAUrE,MAAM,OAAO,WAAY,SAAQ,YAAsB;IAMnD,YAAY,MAAoB,EAAE,MAAc;QAC5C,KAAK,EAAE,CAAC;QAHZ,YAAO,GAAwB,IAAI,GAAG,EAAE,CAAC;QAIrC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAE5D,2FAA2F;QAC3F,IAAI,CAAC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