Skip to content

Commit

Permalink
format everything
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-sg committed Dec 20, 2023
1 parent acc0e62 commit ff91432
Show file tree
Hide file tree
Showing 36 changed files with 2,615 additions and 1,562 deletions.
93 changes: 46 additions & 47 deletions .github/workflows/buildapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,53 +44,52 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

run: |
if [ "$GITHUB_REF" == "refs/heads/main" ] || [ -f ./force_release ]; then
export YARN_BUILD_CMD="release"
else
export YARN_BUILD_CMD="dist"
fi
if [ "$GITHUB_REF" == "refs/heads/main" ] || [ -f ./force_release ]; then
export YARN_BUILD_CMD="release"
else
export YARN_BUILD_CMD="dist"
fi
if [ "$RUNNER_OS" == "Linux" ]; then
if [ "$PLATFORM" == "linux" ]; then
#mkdir -p plugins-linux;
#pushd plugins-linux;
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/libpepflashplayer.so";
#popd;
if [ "$RUNNER_OS" == "Linux" ]; then
if [ "$PLATFORM" == "linux" ]; then
#mkdir -p plugins-linux;
#pushd plugins-linux;
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/libpepflashplayer.so";
#popd;
docker run --rm \
-e GH_TOKEN=${GH_TOKEN} \
-e YARN_BUILD_CMD=${YARN_BUILD_CMD} \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:16-wine \
/bin/bash -c "yarn --link-duplicates --pure-lockfile --ignore-engines install && yarn run $YARN_BUILD_CMD --linux --x64"
else
#mkdir -p plugins-win;
#pushd plugins-win;
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/pepflashplayer-x86_64.dll";
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/pepflashplayer-x86.dll";
#popd;
docker run --rm \
-e GH_TOKEN=${GH_TOKEN} \
-e YARN_BUILD_CMD=${YARN_BUILD_CMD} \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:16-wine \
/bin/bash -c "yarn --link-duplicates --pure-lockfile --ignore-engines install && yarn run $YARN_BUILD_CMD --linux --x64"
else
#mkdir -p plugins-win;
#pushd plugins-win;
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/pepflashplayer-x86_64.dll";
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/pepflashplayer-x86.dll";
#popd;
docker run --rm \
-e GH_TOKEN=${GH_TOKEN} \
-e WIN_CSC_LINK=${WIN_CSC_LINK} \
-e WIN_CSC_KEY_PASSWORD=${WIN_CSC_KEY_PASSWORD} \
-e YARN_BUILD_CMD=${YARN_BUILD_CMD} \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:16-wine \
/bin/bash -c "yarn --link-duplicates --pure-lockfile --ignore-engines install && yarn run $YARN_BUILD_CMD --win --x64 --ia32"
fi
else
#mkdir -p plugins-mac;
#pushd plugins-mac;
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/PepperFlashPlayer.plugin.zip";
#unzip PepperFlashPlayer.plugin.zip;
#rm PepperFlashPlayer.plugin.zip;
#popd;
yarn --link-duplicates --pure-lockfile --ignore-engines install
yarn run $YARN_BUILD_CMD
fi
docker run --rm \
-e GH_TOKEN=${GH_TOKEN} \
-e WIN_CSC_LINK=${WIN_CSC_LINK} \
-e WIN_CSC_KEY_PASSWORD=${WIN_CSC_KEY_PASSWORD} \
-e YARN_BUILD_CMD=${YARN_BUILD_CMD} \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:16-wine \
/bin/bash -c "yarn --link-duplicates --pure-lockfile --ignore-engines install && yarn run $YARN_BUILD_CMD --win --x64 --ia32"
fi
else
#mkdir -p plugins-mac;
#pushd plugins-mac;
#wget "https://s3.amazonaws.com/webrecorder-builds/flashplugin/PepperFlashPlayer.plugin.zip";
#unzip PepperFlashPlayer.plugin.zip;
#rm PepperFlashPlayer.plugin.zip;
#popd;
yarn --link-duplicates --pure-lockfile --ignore-engines install
yarn run $YARN_BUILD_CMD
fi
4 changes: 2 additions & 2 deletions .github/workflows/buildext.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'yarn'
node-version: "18.x"
cache: "yarn"

- name: Yarn Install
run: yarn install --frozen-lockfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/npm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
cache: "yarn"

- name: Yarn Install
run: yarn install --frozen-lockfile
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LICENSE.md
src/static
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"runem.lit-plugin",
"streetsidesoftware.code-spell-checker"
]
}
65 changes: 65 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"cSpell.languageSettings": [
{
"languageId": "typescript",
"allowCompoundWords": true,
"dictionaries": ["typescript", "node", "html", "fonts", "css"]
},
{
"languageId": "javascript",
"allowCompoundWords": true,
"dictionaries": ["typescript", "node", "html", "fonts", "css"]
},
{
"languageId": "markdown",
"allowCompoundWords": true,
"dictionaries": ["typescript", "node", "html", "fonts", "css"]
}
],
"cSpell.words": [
"authed",
"autoipfs",
"browsertrix",
"btrix",
"Bulma",
"canonicalization",
"cdxj",
"Collec",
"colls",
"electronuserland",
"flexsearch",
"gapi",
"gauth",
"gdrive",
"iframes",
"indexeddb",
"inited",
"ipfs",
"ival",
"kiwix",
"ndjson",
"pmarsceill",
"popd",
"pushd",
"pywb",
"reauth",
"recalc",
"replaybase",
"replayweb.page",
"sesh",
"Strs",
"surt",
"svgs",
"swmanager",
"swonly",
"Unfullscreen",
"unrewriting",
"wabac",
"WACZ",
"WARC",
"warcio",
"webrecorder",
"wrlogo"
],
"cSpell.ignorePaths": ["node_modules", ".git", "*.lock", "package.json"]
}
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ The extension makes use of the Chrome debugging protocol to capture and save net

The codebase for the extension and Electron app is shared, but they can be deployed in different ways.


### Requirements Building

To develop ArchiveWeb.page, Node 12+ and Yarn are needed.
Expand All @@ -41,15 +40,14 @@ If you want to make changes to the extension, it should be installed in this way

For development, it is recommended to use the dev build of the extension:

1. Run ``yarn install`` and then ``yarn run build-dev`
1. Run `yarn install` and then ``yarn run build-dev`

2. Run ``yarn run start-ext`` -- this will ensure the `wr-ext` directory is rebuilt after any changes to the source.
2. Run `yarn run start-ext` -- this will ensure the `wr-ext` directory is rebuilt after any changes to the source.

3. After making changes, the extension still needs to be reloaded in the browser. From the Chrome extensions page, click the reload button to load the latest version.

4. Click the extension icon to show the extension popup, start recording, etc... The dev build of the extension will be grey to differntiate from the production version.


## Using the Electron App (in beta)

The Electron app version is in beta and the latest release can be downloaded from the [Releases page](https://github.com/webrecorder/archiveweb.page/releases)
Expand All @@ -58,23 +56,21 @@ To run the Electron app development build:

1. Clone this repo.

2. Run ``yarn install`` and then ``yarn run build-dev``
2. Run `yarn install` and then `yarn run build-dev`

3. Run ``yarn run start-electron`` to start the app.
3. Run `yarn run start-electron` to start the app.

The Electron App version will open recording in a new window. It is is designed to support Flash, better support for IPFS sharing.
However, it is still in development and may not work yet until the initial release is out.


### Development workflow

After making changes, rerun ``yarn run build-dev`` and ``yarn run start-electron`` to load the app.
After making changes, rerun `yarn run build-dev` and `yarn run start-electron` to load the app.

### Standalone Build

To create a platform-specific binary, run:

``yarn run pack``
`yarn run pack`

The standalone app will then be available in the `./dist/` directory.

16 changes: 7 additions & 9 deletions build/notarize.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
const { notarize } = require('electron-notarize');
const { notarize } = require("electron-notarize");

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== "darwin") {
return;
}

if (process.env.CSC_IDENTITY_AUTO_DISCOVERY === "false") {
console.log('Skipped signing and notarizing');
console.log("Skipped signing and notarizing");
return;
}

if (!process.env.APPLE_ID || !process.env.APPLE_ID_PASSWORD) {
console.log('Notarize credentials missing, skipping');
console.log("Notarize credentials missing, skipping");
return;
}

console.log('Notarizing...');
console.log("Notarizing...");

const appName = context.packager.appInfo.productFilename;

return await notarize({
appBundleId: 'net.webrecorder.archiveweb.page',
appBundleId: "net.webrecorder.archiveweb.page",
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
});
};


5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { ArchiveWebApp } from './src/ui/app.js';
export { RecordEmbed } from './src/ui/recordembed.js';

export { ArchiveWebApp } from "./src/ui/app.js";
export { RecordEmbed } from "./src/ui/recordembed.js";
3 changes: 1 addition & 2 deletions src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

export const BEHAVIOR_WAIT_LOAD = "wait_load";
export const BEHAVIOR_READY_START = "ready";
export const BEHAVIOR_PAUSED = "paused";
export const BEHAVIOR_RUNNING = "running";
export const BEHAVIOR_DONE = "done";
export const BEHAVIOR_DONE = "done";
10 changes: 4 additions & 6 deletions src/electron/app-popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { CollectionLoader } from "@webrecorder/wabac/src/loaders";
import { listAllMsg } from "../utils";
import { setLocalOption } from "../localstorage";


// ===========================================================================
class AppRecPopup extends RecPopup
{
class AppRecPopup extends RecPopup {
constructor() {
super();

Expand Down Expand Up @@ -57,11 +55,11 @@ class AppRecPopup extends RecPopup
}

//ipcRenderer.send("popup-msg-" + this.tabId, message);
this.dispatchEvent(new CustomEvent("send-msg", {detail: message}));
this.dispatchEvent(new CustomEvent("send-msg", { detail: message }));
}

async makeNewColl(message) {
const newColl = await this.collLoader.initNewColl({title: message.title});
const newColl = await this.collLoader.initNewColl({ title: message.title });

await setLocalOption("defaultCollId", newColl.name);

Expand All @@ -83,4 +81,4 @@ class AppRecPopup extends RecPopup
}
}

customElements.define("wr-app-popup", AppRecPopup);
customElements.define("wr-app-popup", AppRecPopup);
3 changes: 1 addition & 2 deletions src/electron/electron-rec-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import path from "path";
import btoa from "btoa";
global.btoa = btoa;


// ===========================================================================
const recorderApp = new ElectronRecorderApp({
staticPath: path.join(__dirname, "./"),
profileName: process.env.AWP_PROFILE_NAME || "archivewebpage"
profileName: process.env.AWP_PROFILE_NAME || "archivewebpage",
});

recorderApp.init();

0 comments on commit ff91432

Please sign in to comment.