Skip to content

Commit

Permalink
refactor: improve compat with node16 resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
AviVahl committed Apr 21, 2024
1 parent f641070 commit ef0b9b4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/dashboard/src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '*.st.css' {
export * from '@stylable/runtime/stylesheet.js';
export * from '@stylable/runtime/stylesheet';

const defaultExport: unknown;
export default defaultExport;
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function engine() {
},
});

const { loadEngineConfig, runEngine } = await import('./engine-build');
const { loadEngineConfig, runEngine } = await import('./engine-build.js');

const engineConfig = await loadEngineConfig(process.cwd(), engineConfigCli.flags.engineConfigFilePath);

Expand Down
9 changes: 8 additions & 1 deletion packages/engine-cli/src/engine-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface RunEngineOptions {
publicConfigsRoute?: string;
configLoadingMode?: ConfigLoadingMode;
}

export async function runEngine({
verbose = false,
clean = true,
Expand All @@ -60,7 +61,13 @@ export async function runEngine({
writeMetadataFiles = !watch,
publicConfigsRoute = 'configs',
configLoadingMode = 'require',
}: RunEngineOptions = {}) {
}: RunEngineOptions = {}): Promise<{
featureEnvironmentsMapping: FeatureEnvironmentMapping;
configMapping: ConfigurationEnvironmentMapping;
devServer?: Awaited<ReturnType<typeof launchDashboardServer>>;
esbuildContextWeb?: esbuild.BuildContext;
esbuildContextNode?: esbuild.BuildContext;
}> {
const mode: '' | 'development' | 'production' = dev ? 'development' : 'production';
let esbuildContextWeb: esbuild.BuildContext | undefined;
let esbuildContextNode: esbuild.BuildContext | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-cli/src/launch-dashboard-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function launchDashboardServer(
waitForBuildReady?: (cb: () => void) => boolean,
buildConditions?: string[],
extensions?: string[],
) {
): Promise<ReturnType<typeof launchServer>> {
const staticMiddlewares = serveStatic.map(({ route, directoryPath }) => ({
path: route,
handlers: express.static(directoryPath),
Expand Down
8 changes: 7 additions & 1 deletion packages/engine-cli/src/start-dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ export async function launchServer({
httpServerPort = 3000,
socketServerOptions,
middlewares = [],
}: LaunchOptions = {}) {
}: LaunchOptions = {}): Promise<{
close: () => Promise<void>;
port: number;
app: express.Express;
httpServer: import('http').Server;
socketServer: io.Server;
}> {
const app = express();
app.use(cors());

Expand Down

0 comments on commit ef0b9b4

Please sign in to comment.