Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove client/src #1976

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
32 changes: 16 additions & 16 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/src/www/build
run: npm run action client/web/build

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

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

linux_debug_build:
Expand Down Expand Up @@ -132,18 +132,18 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Tun2Socks (required for Test OutlineAppleLib)
run: npm run action client/src/tun2socks/build macos
run: npm run action client/tun2socks/build macos

- name: Test OutlineAppleLib
run: npm run action client/src/cordova/test macos
run: npm run action client/cordova/test macos

- name: Build MacOS Client
run: npm run action client/src/cordova/build macos
run: npm run action client/cordova/build macos

- uses: codecov/codecov-action@v3
with:
xcode: true
xcode_archive_path: ./client/src/output/coverage/apple/macos/TestResult.xcresult
xcode_archive_path: ./client/output/coverage/apple/macos/TestResult.xcresult
flags: unittests, apple, macos

ios_debug_build:
Expand Down Expand Up @@ -174,18 +174,18 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Tun2Socks (required for Test OutlineAppleLib)
run: npm run action client/src/tun2socks/build ios
run: npm run action client/tun2socks/build ios

- name: Test OutlineAppleLib
run: npm run action client/src/cordova/test ios
run: npm run action client/cordova/test ios

- name: Build iOS Client
run: npm run action client/src/cordova/build ios
run: npm run action client/cordova/build ios

- uses: codecov/codecov-action@v3
with:
xcode: true
xcode_archive_path: ./client/src/output/coverage/apple/ios/TestResult.xcresult
xcode_archive_path: ./client/output/coverage/apple/ios/TestResult.xcresult
flags: unittests, apple, ios

maccatalyst_debug_build:
Expand Down Expand Up @@ -216,18 +216,18 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Tun2Socks (required for Test OutlineAppleLib)
run: npm run action client/src/tun2socks/build maccatalyst
run: npm run action client/tun2socks/build maccatalyst

- name: Test OutlineAppleLib
run: npm run action client/src/cordova/test maccatalyst
run: npm run action client/cordova/test maccatalyst

- name: Build Mac Catalyst Client
run: npm run action client/src/cordova/build maccatalyst
run: npm run action client/cordova/build maccatalyst

- uses: codecov/codecov-action@v3
with:
xcode: true
xcode_archive_path: ./client/src/output/coverage/apple/maccatalyst/TestResult.xcresult
xcode_archive_path: ./client/output/coverage/apple/maccatalyst/TestResult.xcresult
flags: unittests, apple, maccatalyst

android_debug_build:
Expand Down Expand Up @@ -263,4 +263,4 @@ jobs:
run: bash ./client/tools/build/setup_linux_android.sh

- name: Build Android Client
run: npm run action client/src/cordova/build android -- --verbose
run: npm run action client/cordova/build android -- --verbose
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ node_modules
/server_manager/install_scripts/do_install_script.ts
/server_manager/install_scripts/gcp_install_script.ts
/output
/build
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set: [pipefail]
run: when_changed

includes:
client:tun2socks: ./client/src/tun2socks/Taskfile.yml
client:tun2socks: ./client/tun2socks/Taskfile.yml

tasks:
clean:
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
10 changes: 5 additions & 5 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/src/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/src/www/storybook
npm run action client/web/storybook
```

> [!NOTE]
Expand All @@ -55,7 +55,7 @@ npm run action client/src/www/storybook
Certain actions take configuration flags - but since we're running them through `npm`, you'll have to use the `--` seperator to funnel them through to the underlying process. For example, to set up a MacOS project in release mode, you'd run:

```sh
SENTRY_DSN=<your sentry dsn> npm run action client/src/cordova/setup macos -- --buildMode=release --versionName=<your version name>
SENTRY_DSN=<your sentry dsn> npm run action client/cordova/setup macos -- --buildMode=release --versionName=<your version name>
```

## Life of a Packet
Expand Down
59 changes: 59 additions & 0 deletions client/build/get_build_parameters.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2022 The Outline Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import minimist from 'minimist';

const VALID_PLATFORMS = ['linux', 'windows', 'ios', 'macos', 'maccatalyst', 'android', 'browser'];
const VALID_BUILD_MODES = ['debug', 'release'];

const MS_PER_HOUR = 1000 * 60 * 60;

/*
Inputs:
=> cliParameters: the list of action arguments passed in
Outputs:
=> an object containing the specificed platform and buildMode.
*/
export function getBuildParameters(cliArguments) {
const {
_: [platform = 'browser'],
buildMode = 'debug',
verbose = false,
versionName = '0.0.0',
sentryDsn = process.env.SENTRY_DSN,
} = minimist(cliArguments);

if (platform && !VALID_PLATFORMS.includes(platform)) {
throw new TypeError(
`Platform "${platform}" is not a valid target for Outline Client. Must be one of ${VALID_PLATFORMS.join(', ')}`
);
}

if (buildMode && !VALID_BUILD_MODES.includes(buildMode)) {
throw new TypeError(
`Build mode "${buildMode}" is not a valid build mode for Outline Client. Must be one of ${VALID_BUILD_MODES.join(
', '
)}`
);
}

return {
platform,
buildMode,
verbose,
versionName: buildMode === 'release' ? versionName : `${versionName}-${buildMode}`,
sentryDsn,
buildNumber: Math.floor(Date.now() / MS_PER_HOUR),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
/*
Inputs:
=> buildMode: the outline build mode

Outputs:
=> the appropriate webpack mode for this type of build
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export const runWebpack = webpackConfig =>
resolve(stats);
});
});

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
F63DC2162970AFE600D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ../../src/cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
F63DC2162970AFE600D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ..//cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = Outline/config.xml; sourceTree = "<group>"; };
FC55AB411F4F960A0056F12C /* VpnExtension-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "VpnExtension-Info.plist"; path = "Outline/VpnExtension-Info.plist"; sourceTree = SOURCE_ROOT; };
FC8C310A1FAA814A004262BE /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
70DAA8D91908785C00AF3749 /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = "<group>"; };
A508014170A1492DB0D800B3 /* Outline-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; path = "Outline-Bridging-Header.h"; sourceTree = "<group>"; };
AA09EA80E0C54DFFB24A1810 /* OutlinePlugin.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = OutlinePlugin.swift; path = "cordova-plugin-outline/OutlinePlugin.swift"; sourceTree = "<group>"; };
F63DC21E2970B23B00D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ../../src/cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
F63DC21E2970B23B00D92E0A /* OutlineAppleLib */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OutlineAppleLib; path = ..//cordova/apple/OutlineAppleLib; sourceTree = "<group>"; };
FC0799E62037532900A1C822 /* OutlineLauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OutlineLauncher.app; sourceTree = BUILT_PRODUCTS_DIR; };
FC0799E82037532A00A1C822 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
FC0799EF2037532A00A1C822 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand Down
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
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
Loading
Loading