Skip to content

Commit

Permalink
more path updates
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Apr 17, 2024
1 parent ce6fdc1 commit f0193d4
Show file tree
Hide file tree
Showing 32 changed files with 68 additions and 68 deletions.
34 changes: 17 additions & 17 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,37 @@
"from": ".",
"except": ["./src/infrastructure", "./node_modules"]
},
// Similar to above but for src/www/model, but you can use files from both the
// src/www/model and src/www/infrastructure paths.
// Similar to above but for web/model, but you can use files from both the
// web/model and web/infrastructure paths.
{
"target": "./src/www/model",
"target": "./web/model",
"from": ".",
"except": ["./src/www/model", "./src/infrastructure", "./node_modules"]
"except": ["./web/model", "./src/infrastructure", "./node_modules"]
},
// Prevents the internals of the outline_server_repository from being used publicly in the app.
{
"target": "./src/www/app/*.ts",
"from": "./src/www/app/outline_server_repository/server.ts"
"target": "./web/app/*.ts",
"from": "./web/app/outline_server_repository/server.ts"
},
{
"target": "./src/www/app/*.ts",
"from": "./src/www/app/outline_server_repository/access_key_serialization.ts"
"target": "./web/app/*.ts",
"from": "./web/app/outline_server_repository/access_key_serialization.ts"
},
{
"target": "./src/www/views",
"from": "./src/www/model"
"target": "./web/views",
"from": "./web/model"
},
{
"target": "./src/www/ui_components",
"from": "./src/www/model"
"target": "./web/ui_components",
"from": "./web/model"
},
{
"target": "./src/www/views",
"from": "./src/www/app"
"target": "./web/views",
"from": "./web/app"
},
{
"target": "./src/www/ui_components",
"from": "./src/www/app"
"target": "./web/ui_components",
"from": "./web/app"
}
]
}
Expand Down Expand Up @@ -94,7 +94,7 @@
},
// No need to check browser compatibility for electron files
{
"files": ["./src/www/app/electron_main.ts"],
"files": ["./web/app/electron_main.ts"],
"rules": {
"compat/compat": "off"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
/third_party/ @Jigsaw-Code/outline-networking-owners
/tools/ @Jigsaw-Code/outline-networking-owners

/src/www/model/ @fortuna
/web/model/ @fortuna
6 changes: 3 additions & 3 deletions .github/workflows/build_and_test_debug_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
run: npm run action lint

- name: Build Web App
run: npm run action client/www/build
run: npm run action client/web/build

- name: Test Web App
run: npm run action client/www/test
run: npm run action client/web/test

- uses: codecov/codecov-action@v3
with:
files: ./client/output/coverage/www/coverage-final.json
files: ./client/output/coverage/web/coverage-final.json
flags: unittests, www

linux_debug_build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
LICENSE
package-lock.json
resources
src/www/assets/**
src/www/messages/**
web/assets/**
web/messages/**
third_party/**
with:
sizes: >
Expand Down
1 change: 0 additions & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/node_modules
/build
/output
/platforms
/plugins
Expand Down
8 changes: 4 additions & 4 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ npm install

## Building the shared web app

Outline clients share the same web app across all platforms. This code is located in the src/www directory. If you are making changes to the shared web app and do not need to test platform-specific functionality, you can test in a desktop browser by running:
Outline clients share the same web app across all platforms. This code is located in the web directory. If you are making changes to the shared web app and do not need to test platform-specific functionality, you can test in a desktop browser by running:

```sh
npm run action client/www/start
npm run action client/web/start
```

The latter command will open a browser instance running the app. Browser platform development will use fake servers to test successful and unsuccessful connections.

The app logic is located in [src/www/app](src/www/app). UI components are located in [src/www/ui_components](src/www/ui_components). If you want to work specifically on an individual UI element, try the storybook!:
The app logic is located in [web/app](web/app). UI components are located in [web/ui_components](web/ui_components). If you want to work specifically on an individual UI element, try the storybook!:

```sh
npm run action client/www/storybook
npm run action client/web/storybook
```

> [!NOTE]
Expand Down
4 changes: 2 additions & 2 deletions client/cordova/apple/xcode/macos/osx.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
"modules": [
{
"id": "cordova-plugin-clipboard.Clipboard",
"file": "plugins/cordova-plugin-clipboard/www/clipboard.js",
"file": "plugins/cordova-plugin-clipboard/web/clipboard.js",
"pluginId": "cordova-plugin-clipboard",
"clobbers": [
"cordova.plugins.clipboard"
]
},
{
"id": "cordova-webintent.WebIntent",
"file": "plugins/cordova-webintent/www/webintent.js",
"file": "plugins/cordova-webintent/web/webintent.js",
"pluginId": "cordova-webintent",
"clobbers": [
"WebIntent"
Expand Down
4 changes: 2 additions & 2 deletions client/cordova/apple/xcode/macos/www/cordova_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"id": "cordova-plugin-clipboard.Clipboard",
"file": "plugins/cordova-plugin-clipboard/www/clipboard.js",
"file": "plugins/cordova-plugin-clipboard/web/clipboard.js",
"pluginId": "cordova-plugin-clipboard",
"clobbers": [
"cordova.plugins.clipboard"
]
},
{
"id": "cordova-webintent.WebIntent",
"file": "plugins/cordova-webintent/www/webintent.js",
"file": "plugins/cordova-webintent/web/webintent.js",
"pluginId": "cordova-webintent",
"clobbers": [
"WebIntent"
Expand Down
4 changes: 2 additions & 2 deletions client/cordova/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {getBuildParameters} from '../build/get_build_parameters.mjs';
export async function main(...parameters) {
const {platform, buildMode, verbose} = getBuildParameters(parameters);

await runAction('client/www/build', ...parameters);
await runAction('client/web/build', ...parameters);
await runAction('client/tun2socks/build', ...parameters);
await runAction('client/cordova/setup', ...parameters);

Expand Down Expand Up @@ -95,7 +95,7 @@ function getXcodeBuildArgs(platform) {
}
return [
'-workspace',
path.join(getRootDir(), 'client', 'src', 'cordova', 'apple', workspaceFilename),
path.join(getRootDir(), 'client', 'cordova', 'apple', workspaceFilename),
'-scheme',
'Outline',
'-destination',
Expand Down
2 changes: 1 addition & 1 deletion client/cordova/setup.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const WORKING_CORDOVA_OSX_COMMIT = '07e62a53aa6a8a828fd988bc9e884c38c3495a67';
export async function main(...parameters) {
const {platform, buildMode, verbose, buildNumber, versionName} = getBuildParameters(parameters);

await runAction('client/www/build', ...parameters);
await runAction('client/web/build', ...parameters);
await runAction('client/tun2socks/build', ...parameters);

await rmfr(path.resolve(getRootDir(), 'platforms'));
Expand Down
2 changes: 1 addition & 1 deletion client/cordova/test.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import rmfr from 'rmfr';
import {getRootDir} from '../..//src/build/get_root_dir.mjs';
import {spawnStream} from '../..//src/build/spawn_stream.mjs';

const APPLE_ROOT = path.join(getRootDir(), 'client', 'src', 'cordova', 'apple');
const APPLE_ROOT = path.join(getRootDir(), 'client', 'cordova', 'apple');
const APPLE_LIBRARY_NAME = 'OutlineAppleLib';

const SUPPORTED_PLATFORMS = new Set(['ios', 'macos', 'maccatalyst']);
Expand Down
2 changes: 1 addition & 1 deletion client/electron/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function main(...parameters) {
);
}

await runAction('client/www/build', ...parameters);
await runAction('client/web/build', ...parameters);
await runAction('client/tun2socks/build', ...parameters);
await runAction('src/electron/build_main', ...parameters);

Expand Down
2 changes: 1 addition & 1 deletion client/electron/build_main.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function main(...parameters) {
);
}

await runAction('client/www/build', ...parameters);
await runAction('client/web/build', ...parameters);

// TODO(daniellacosse): separate building the preload script out into its own separate step
await runWebpack(
Expand Down
2 changes: 1 addition & 1 deletion client/electron/connectivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import * as dns from 'dns';

import {timeoutPromise} from '../../client/infrastructure/timeout_promise';
import * as errors from '../../client/www/model/errors';
import * as errors from '../../client/web/model/errors';

const DNS_LOOKUP_TIMEOUT_MS = 10000;

Expand Down
6 changes: 3 additions & 3 deletions client/electron/go_vpn_tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {powerMonitor} from 'electron';
import {platform} from 'os';

import {pathToEmbeddedBinary} from '../../client/infrastructure/electron/app_paths';
import {ShadowsocksSessionConfig} from '../../client/www/app/tunnel';
import {TunnelStatus} from '../../client/www/app/tunnel';
import {ErrorCode, fromErrorCode, UnexpectedPluginError} from '../../client/www/model/errors';
import {ShadowsocksSessionConfig} from '../../client/web/app/tunnel';
import {TunnelStatus} from '../../client/web/app/tunnel';
import {ErrorCode, fromErrorCode, UnexpectedPluginError} from '../../client/web/model/errors';

import {ChildProcessHelper, ProcessTerminatedExitCodeError, ProcessTerminatedSignalError} from './process';
import {RoutingDaemon} from './routing_service';
Expand Down
8 changes: 4 additions & 4 deletions client/electron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import * as process from 'process';
import * as url from 'url';
import autoLaunch = require('auto-launch'); // tslint:disable-line

import * as errors from '../../client/www/model/errors';
import * as errors from '../../client/web/model/errors';

import {ShadowsocksSessionConfig} from '../../client/www/app/tunnel';
import {TunnelStatus} from '../../client/www/app/tunnel';
import {ShadowsocksSessionConfig} from '../../client/web/app/tunnel';
import {TunnelStatus} from '../../client/web/app/tunnel';
import {GoVpnTunnel} from './go_vpn_tunnel';
import {installRoutingServices, RoutingDaemon} from './routing_service';
import {TunnelStore, SerializableTunnel} from './tunnel_store';
Expand Down Expand Up @@ -145,7 +145,7 @@ function setupWindow(): void {
mainWindow.setIcon(path.join(app.getAppPath(), 'build', 'icons', 'png', '64x64.png'));
}

const pathToIndexHtml = path.join(app.getAppPath(), 'client', 'www', 'index_electron.html');
const pathToIndexHtml = path.join(app.getAppPath(), 'client', 'web', 'index_electron.html');
const webAppUrl = new url.URL(`file://${pathToIndexHtml}`);

// Debug mode, etc.
Expand Down
4 changes: 2 additions & 2 deletions client/electron/routing_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import * as path from 'path';
import * as sudo from 'sudo-prompt';

import {getAppPath} from '../../client/infrastructure/electron/app_paths';
import {TunnelStatus} from '../../client/www/app/tunnel';
import {ErrorCode, SystemConfigurationException} from '../../client/www/model/errors';
import {TunnelStatus} from '../../client/web/app/tunnel';
import {ErrorCode, SystemConfigurationException} from '../../client/web/model/errors';

const isLinux = platform() === 'linux';
const isWindows = platform() === 'win32';
Expand Down
4 changes: 2 additions & 2 deletions client/electron/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../client/www/tsconfig.json",
"extends": "../web/tsconfig.json",
"compilerOptions": {
"outDir": "../../build/electron"
"outDir": "../output/electron"
}
}
2 changes: 1 addition & 1 deletion client/electron/tunnel_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import * as fs from 'fs';
import * as path from 'path';

import {ShadowsocksSessionConfig} from '../../client/www/app/tunnel';
import {ShadowsocksSessionConfig} from '../../client/web/app/tunnel';

// Format to store a tunnel configuration.
export interface SerializableTunnel {
Expand Down
2 changes: 1 addition & 1 deletion client/electron/vpn_tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import {TunnelStatus} from '../../client/www/app/tunnel';
import {TunnelStatus} from '../../client/web/app/tunnel';

// Represents a VPN tunnel to a proxy server.
export interface VpnTunnel {
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"comments": {
"version": "The 'version' in this file is just a placeholder for 'npx generate-license-file', please do not change it.",
"codrova-osx": "Version-controlled platform config files at src/cordova/apple/xcode/osx/Outline/config.xml, src/cordova/apple/xcode/osx/osx.json, and src/cordova/apple/xcode/osx/www/cordova_plugins.js as a workaround for https://github.com/apache/cordova-osx/issues/106. Delete these files when the issue is fixed."
"codrova-osx": "Version-controlled platform config files at src/cordova/apple/xcode/osx/Outline/config.xml, src/cordova/apple/xcode/osx/osx.json, and src/cordova/apple/xcode/osx/web/cordova_plugins.js as a workaround for https://github.com/apache/cordova-osx/issues/106. Delete these files when the issue is fixed."
},
"dependencies": {
"@material/mwc-button": "^0.25.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class OutlineClientSession : public std::enable_shared_from_this<OutlineClientSe
boost::asio::awaitable<void> MonitorNetworkChanges();

private:
/** @brief `TunnelStatus` in "src/www/app/tunnel.ts" */
/** @brief `TunnelStatus` in "web/app/tunnel.ts" */
enum class ConnectionState : int {
kConnected = 0,
kDisconnected = 1,
Expand Down
2 changes: 1 addition & 1 deletion client/tools/outline_proxy_controller/outline_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace outline {

/**
* @brief The standard error code constants used by outline.
* @remarks The codes are copied from "/src/www/model/errors.ts".
* @remarks The codes are copied from "/web/model/errors.ts".
*/
enum class ErrorCode {
kOk = 0,
Expand Down
2 changes: 1 addition & 1 deletion client/tun2socks/outline/neterrors/neterrors.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (e Error) Number() int {
return int(e)
}

// Outline error codes. Must be kept in sync with definitions in https://github.com/Jigsaw-Code/outline-apps/blob/master/src/www/model/errors.ts
// Outline error codes. Must be kept in sync with definitions in https://github.com/Jigsaw-Code/outline-apps/blob/master/web/model/errors.ts
const (
NoError Error = 0
Unexpected Error = 1
Expand Down
4 changes: 2 additions & 2 deletions client/web/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export async function main(...parameters) {
}
}

await fs.mkdir(path.resolve(getRootDir(), 'client', 'www'), {recursive: true});
await fs.mkdir(path.resolve(getRootDir(), 'client', 'web'), {recursive: true});

await fs.writeFile(
path.resolve(getRootDir(), 'client', 'www', 'environment.json'),
path.resolve(getRootDir(), 'client', 'web', 'environment.json'),
JSON.stringify({
SENTRY_DSN: sentryDsn,
APP_VERSION: versionName,
Expand Down
1 change: 1 addition & 0 deletions client/web/environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"APP_VERSION":"0.0.0-debug","APP_BUILD_NUMBER":475939}
2 changes: 1 addition & 1 deletion client/web/start.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {getBrowserWebpackConfig} from './get_browser_webpack_config.mjs';
* @description Starts the web app for development.
*/
export async function main() {
await runAction('client/www/build', 'browser');
await runAction('client/web/build', 'browser');

// TODO(daniellacosse): Browser-only webpack setup that's extended both by electron and cordova.
// Currently, only the cordova web build works in standalone mode.
Expand Down
2 changes: 1 addition & 1 deletion client/web/test.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import puppeteer from 'puppeteer';
import path from 'path';
import {getRootDir} from '../..//src/build/get_root_dir.mjs';

const KARMA_CONFIG_PATH = ['client', 'src', 'www', 'karma.conf.js'];
const KARMA_CONFIG_PATH = ['client', 'web', 'karma.conf.js'];

/**
* @description Runs the Karma tests against the web UI.
Expand Down
4 changes: 2 additions & 2 deletions client/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../../www",
"outDir": "../www",
"lib": ["es2022", "dom", "dom.iterable"]
}
}
4 changes: 2 additions & 2 deletions client/web/ui_components/licenses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- `cd` to the root of your clone of this repo.
- Ensure `node_modules` is up to date by running `npm ci`.
- `npx generate-license-file --input package.json --output src/www/ui_components/licenses/licenses.txt`
- `./src/www/ui_components/licenses/third_party.sh >> ./src/www/ui_components/licenses/licenses.txt`
- `npx generate-license-file --input package.json --output web/ui_components/licenses/licenses.txt`
- `./web/ui_components/licenses/third_party.sh >> ./web/ui_components/licenses/licenses.txt`

Done!
2 changes: 1 addition & 1 deletion client/web/webpack_base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const baseConfig = {
export const browserConfig = {
entry: [path.resolve(__dirname, 'style.css')],
output: {
path: path.resolve(__dirname, '..', '..', 'www'),
path: path.resolve(__dirname, '..', 'www'),
filename: 'main.js',
},
module: {
Expand Down
Loading

0 comments on commit f0193d4

Please sign in to comment.