Skip to content

Commit

Permalink
Engineer - Build application start as an engine app (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Yahid authored Oct 1, 2020
1 parent 6599ed8 commit 35b2a6c
Show file tree
Hide file tree
Showing 98 changed files with 1,884 additions and 732 deletions.
90 changes: 39 additions & 51 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "node",
"request": "launch",
"name": "Mocha Current",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"${file}"
],
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "Mocha Pup Current",
"program": "${workspaceFolder}/node_modules/mocha-pup/cjs/cli.js",
"args": [
"${file}",
"--dev"
],
"outputCapture": "std",
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229
},
{
"type": "node",
"request": "launch",
"name": "Engine start",
"program": "${workspaceFolder}/node_modules/@wixc3/engine-scripts/cli.js",
"args": [
"start",
],
"runtimeArgs": [
"--inspect"
],
"outputCapture": "std",
"autoAttachChildProcesses": true
},
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Current",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--timeout", "999999", "${file}"],
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "Mocha Pup Current",
"program": "${workspaceFolder}/node_modules/mocha-pup/cjs/cli.js",
"args": ["${file}", "--dev"],
"outputCapture": "std",
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229
},
{
"type": "node",
"request": "launch",
"name": "Engine start",
"program": "${workspaceFolder}/node_modules/@wixc3/engine-scripts/cli.js",
"args": ["start"],
"runtimeArgs": ["--inspect"],
"outputCapture": "std",
"autoAttachChildProcesses": true
}
]
}
2 changes: 1 addition & 1 deletion examples/electron-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@example/electron-app",
"version": "14.4.5",
"version": "15.0.0-rc.7",
"main": "index.js",
"scripts": {
"start": "electron ."
Expand Down
2 changes: 1 addition & 1 deletion examples/file-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@example/file-server",
"version": "14.4.4",
"version": "15.0.0-rc.7",
"scripts": {
"start": "engine start",
"test": "yarn test:ix && yarn test:unit",
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@example/playground",
"version": "14.4.3",
"version": "15.0.0-rc.1",
"scripts": {
"start": "engine start"
},
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "14.4.5",
"version": "15.0.0-rc.7",
"npmClient": "yarn",
"useWorkspaces": true
}
4 changes: 2 additions & 2 deletions packages/core-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wixc3/engine-core-node",
"version": "14.4.5",
"version": "15.0.0-rc.1",
"main": "cjs/index.js",
"types": "cjs/index.d.ts",
"scripts": {
Expand All @@ -12,7 +12,7 @@
"prepack": "yarn build"
},
"dependencies": {
"@wixc3/engine-core": "^14.4.5",
"@wixc3/engine-core": "^15.0.0-rc.1",
"create-listening-server": "^1.0.0",
"express": "^4.17.1",
"socket.io": "^2.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wixc3/engine-core",
"version": "14.4.5",
"version": "15.0.0-rc.1",
"main": "cjs/index.js",
"types": "cjs/index.d.ts",
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions packages/engineer/bin/engineer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node
const { normalize, dirname } = require('path');

if (__dirname.endsWith(normalize('/packages/engineer/bin'))) {
const configFilePath = require.resolve('../../../tsconfig.json');
const { createNodeExtension } = require('@ts-tools/node');
const nodeExtension = createNodeExtension({ configFilePath });
require.extensions['.ts'] = nodeExtension;
require.extensions['.tsx'] = nodeExtension;

const { options: tsconfigPathsOptions } = require('tsconfig-paths/lib/options');
tsconfigPathsOptions.cwd = dirname(configFilePath);
require('tsconfig-paths/register');
require('../src/cli');
} else {
require('../cjs/src/cli');
}
13 changes: 13 additions & 0 deletions packages/engineer/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node
const { dirname } = require('path');

const configFilePath = require.resolve('../../tsconfig.json');
const { createNodeExtension } = require('@ts-tools/node');
const nodeExtension = createNodeExtension({ configFilePath });
require.extensions['.ts'] = nodeExtension;
require.extensions['.tsx'] = nodeExtension;

const { options: tsconfigPathsOptions } = require('tsconfig-paths/lib/options');
tsconfigPathsOptions.cwd = dirname(configFilePath);
require('tsconfig-paths/register');
require('./scripts/build');
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState, useCallback, memo } from 'react';
import { FeaturesSelection } from './feature-selection';
import { ServerState, isServerResponseMessage } from '../../../server-types';
import { ServerState, isServerResponseMessage } from '../../server-types';
import { classes } from './dashboard.st.css';
import { RuntimeOptionsContainer, IRuntimeOption } from './runtime-options-container';
import { ActionsContainer } from './actions-container';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useMemo, useCallback, memo } from 'react';
import Select from 'react-select';
import type { ServerFeatureDef } from '../../../../server-types';
import type { ServerFeatureDef } from '../../../server-types';
import { classes } from './feature-selection.st.css';
import { TitledElement } from '../titled-element';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IFeatureMessagePayload, IProcessMessage, ErrorResponse } from './types';
import type { IFeatureMessagePayload, IProcessMessage, ErrorResponse } from '@wixc3/engine-scripts';

export interface ServerResponse<T> extends IProcessMessage<T> {
id: 'error' | 'feature-initialized' | 'feature-closed';
Expand Down
Loading

0 comments on commit 35b2a6c

Please sign in to comment.