Skip to content

Commit

Permalink
update built-in web clients (picking today's changes)
Browse files Browse the repository at this point in the history
* closes #259
  • Loading branch information
vladimiry committed Feb 19, 2020
1 parent 5494933 commit ecf4d94
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
18 changes: 13 additions & 5 deletions scripts/prepare-webclient/protonmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const folderAsDomainEntries: Array<FolderAsDomainEntry<{
await promisify(fs.rename)(from, to);
})();

const hasSeenOboardingModalSuppressor = await (async () => {
const hasSeenOnboardingModalSuppressor = await (async () => {
const replacedMarkFile = path.join(cwd, `${new UUID(4).format()}-replaced-mark`);
const targetFile = path.resolve(cwd, "./src/app/core/controllers/secured.js");
if (!fsExtra.existsSync(targetFile)) {
Expand Down Expand Up @@ -104,7 +104,7 @@ const folderAsDomainEntries: Array<FolderAsDomainEntry<{
`
const webpackConfig = require("${originalWebpackConfigFile}");
${resolveWebpackConfigPatchingCode("webpackConfig")}
${hasSeenOboardingModalSuppressor.webpackConfigCodePatch}
${hasSeenOnboardingModalSuppressor.webpackConfigCodePatch}
module.exports = webpackConfig;
`,
);
Expand All @@ -115,8 +115,8 @@ const folderAsDomainEntries: Array<FolderAsDomainEntry<{

await execShell(["npm", ["run", "build", "--", "--api", configApiParam], {cwd}]);

if (!hasSeenOboardingModalSuppressor.isReplaced()) {
throw new Error(`Failed to patch the "${hasSeenOboardingModalSuppressor}" file`);
if (!hasSeenOnboardingModalSuppressor.isReplaced()) {
throw new Error(`Failed to patch the "${hasSeenOnboardingModalSuppressor}" file`);
}
})();
},
Expand All @@ -139,11 +139,19 @@ const folderAsDomainEntries: Array<FolderAsDomainEntry<{
flows: {
// TODO proton-v4: remove "npm install" code block
// https://github.com/ProtonMail/WebClient/issues/158
install: repoType === "proton-contacts" || repoType === "proton-calendar"
install: repoType === "proton-contacts" || repoType === "proton-mail-settings"
? async ({repoDir}) => {
const npmLockFile = path.join(repoDir, "./package-lock.json");

if (fsExtra.existsSync(npmLockFile)) {
if (repoType === "proton-mail-settings") {
// TODO prefer "npm ci" to "npm install"
// lock file of "proton-mail-settings" project got out of sync state
// so we gave to run "npm install" for now
// https://github.com/ProtonMail/WebClient/issues/158#issuecomment-588252103
await execShell(["npm", ["install"], {cwd: repoDir}]);
return;
}
throw new Error(`"${npmLockFile}" file exists, it's time for switching to "npm ci" call`);
}

Expand Down
6 changes: 3 additions & 3 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const PROVIDER_REPOS: ReadonlyDeep<Record<"WebClient" | "proton-mail-sett
repoRelativeDistDir: "./dist",
baseDir: "settings",
repo: "https://github.com/ProtonMail/proton-mail-settings.git",
commit: "e85825885138b0eab1de63785abe12072c004389",
commit: "41e625d21218f5a5ad767173fce41098e7176458",
version: "unknown",
protonPackAppConfig: {
clientId: "WebMailSettings",
Expand All @@ -93,7 +93,7 @@ export const PROVIDER_REPOS: ReadonlyDeep<Record<"WebClient" | "proton-mail-sett
repoRelativeDistDir: "./dist",
baseDir: "contacts",
repo: "https://github.com/ProtonMail/proton-contacts.git",
commit: "3a6fee911fea8a74e784e23e43de431324fb61b3",
commit: "aed8afb08426c6b7b12f3260da41e95e7ddca96e",
version: "unknown",
protonPackAppConfig: {
clientId: "WebContacts",
Expand All @@ -103,7 +103,7 @@ export const PROVIDER_REPOS: ReadonlyDeep<Record<"WebClient" | "proton-mail-sett
repoRelativeDistDir: "./dist",
baseDir: "calendar",
repo: "https://github.com/ProtonMail/proton-calendar.git",
commit: "e08716488589407643d96fe784d7933b92e556a5",
commit: "5ec480f0b0033264e3d423c75f5f550df151fc91",
version: "unknown",
protonPackAppConfig: {
clientId: "WebCalendar",
Expand Down

0 comments on commit ecf4d94

Please sign in to comment.