Skip to content

Commit

Permalink
feat(deps): upgrade to prettier 3 (#1055,DT-1614) (#1183)
Browse files Browse the repository at this point in the history
Co-authored-by: lihbr <[email protected]>
  • Loading branch information
lihbr and lihbr authored Oct 20, 2023
1 parent 1899ff1 commit bf45175
Show file tree
Hide file tree
Showing 267 changed files with 1,494 additions and 1,137 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/customTypes/01-duplicate.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe.skip("Duplicate custom types", () => {
cy.get("[type=submit]").should("be.disabled");

cy.get("[data-cy=ct-name-input-error]").contains(
"Custom type name is already taken."
"Custom type name is already taken.",
);
});

Expand All @@ -34,7 +34,7 @@ describe.skip("Duplicate custom types", () => {
cy.get("[type=submit]").should("be.disabled");

cy.get("[data-cy=ct-id-input-error]").contains(
`ID "${customTypeId}" exists already.`
`ID "${customTypeId}" exists already.`,
);
});
});
10 changes: 5 additions & 5 deletions cypress/e2e/slices/00-create.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,33 @@ describe("Create Slices", () => {
cy.get("#simulator-button-tooltip").should("be.visible");
cy.get("#simulator-button-tooltip").should(
"contain",
"Save your work in order to simulate"
"Save your work in order to simulate",
);
cy.contains("button", "Update screenshot").should("have.attr", "disabled");
cy.contains("button", "Update screenshot").realHover();
cy.get("#update-screenshot-button-tooltip").should("be.visible");
cy.get("#update-screenshot-button-tooltip").should(
"contain",
"Save your work in order to update the screenshot"
"Save your work in order to update the screenshot",
);

cy.location("pathname", { timeout: 20000 }).should(
"eq",
`/slices/${lib}/${sliceName}/bar`
`/slices/${lib}/${sliceName}/bar`,
);
cy.get("button").contains("foo").click();
cy.contains("Default").click();
cy.location("pathname", { timeout: 20000 }).should(
"eq",
`/slices/${lib}/${sliceName}/default`
`/slices/${lib}/${sliceName}/default`,
);

cy.contains("Save").click();

cy.contains("button", "Simulate").should("not.have.attr", "disabled");
cy.contains("button", "Update screenshot").should(
"not.have.attr",
"disabled"
"disabled",
);

// simulator
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/slices/01-duplicates.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("Duplicate Slices", () => {
cy.get("input[data-cy=slice-name-input]").type(sliceName).blur();
cy.get("[type=submit]").should("be.disabled");
cy.get("[data-cy=slice-name-input-error]").contains(
"Slice name is already taken."
"Slice name is already taken.",
);
});
});
2 changes: 1 addition & 1 deletion cypress/e2e/slices/03-build-slices.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe.skip("I am a new SM user (with Next) who wants to build a slice with di
sliceBuilder.addNewWidgetField("SelectField", "Select");
sliceBuilder.addNewWidgetField(
"ContentRelationshipField",
"Content Relationship"
"Content Relationship",
);

sliceBuilder.openEditWidgetModal("SimpleTextField");
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/updates/changelog.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe.skip("changelog.warningBreakingChanges", () => {

it("shows warning if the selected release note has a breaking changes title.", () => {
mockChangelogCall(
"### Breaking Changes\n -this changes is breaking your slice machine"
"### Breaking Changes\n -this changes is breaking your slice machine",
);
cy.visit("/changelog");
cy.waitUntil(() => cy.contains("All versions"));
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/updates/simulator-tooltip.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("simulator tooltip", () => {
cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenSimulatorToolTip).equal(
true,
"userContext.hasSeenSimulatorToolTip should set in local storage"
"userContext.hasSeenSimulatorToolTip should set in local storage",
);
});
});
Expand Down Expand Up @@ -67,7 +67,7 @@ describe("simulator tooltip", () => {
cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenSimulatorToolTip).equal(
true,
"userContext.hasSeenSimulatorToolTip should set in local storage"
"userContext.hasSeenSimulatorToolTip should set in local storage",
);
});
});
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/updates/video-tooltip.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe.skip("video tooltip", () => {
cy.getSliceMachineUserContext().then((data) => {
expect(data.hasSeenTutorialsToolTip).equal(
true,
"userContext.hasSeenTutorialsToolTip should set in local storage"
"userContext.hasSeenTutorialsToolTip should set in local storage",
);
});
});
Expand All @@ -37,14 +37,14 @@ describe.skip("video tooltip", () => {
.should(
"have.attr",
"href",
"https://youtube.com/playlist?list=PLUVZjQltoA3wnaQudcqQ3qdZNZ6hyfyhH"
"https://youtube.com/playlist?list=PLUVZjQltoA3wnaQudcqQ3qdZNZ6hyfyhH",
)
.click();

cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenTutorialsToolTip).equal(
true,
"userContext.hasSeenTutorialsToolTip should set in local storage"
"userContext.hasSeenTutorialsToolTip should set in local storage",
);
});
});
Expand All @@ -68,7 +68,7 @@ describe.skip("video tooltip", () => {
cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenTutorialsToolTip).equal(
true,
"userContext.hasSeenTutorialsToolTip should set in local storage"
"userContext.hasSeenTutorialsToolTip should set in local storage",
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe.skip("Scenario 008", () => {
.invoke("attr", "aria-checked")
.then((currentValue) => {
cy.wrap(currentValue == "true" ? "false" : "true").as(
"newBooleanValue"
"newBooleanValue",
);
});

Expand All @@ -82,7 +82,7 @@ describe.skip("Scenario 008", () => {

cy.getInputByLabel("SimpleTextField").should(
"contain",
"SimpleTextContent"
"SimpleTextContent",
);
cy.getInputByLabel("RichTextField").should("contain", "RichTextContent");
cy.getInputByLabel("NumberField").should("have.value", "42");
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/user-flows/scenario_custom_screenshots.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ describe("I am an existing SM user and I want to upload screenshots on variation
fileName: "file.txt",
mimeType: "text/plain",
},
{ action: "drag-drop" }
{ action: "drag-drop" },
);
cy.contains("Only files of type png, jpg, jpeg are accepted.").should(
"be.visible"
"be.visible",
);

screenshotModal.verifyImageIsEmpty().close();
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/user-flows/scenario_slice_association.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ describe.skip("I am an existing SM user (Next) and I want to associate a Slice t
cy.addStaticFieldToSlice(
"Key Text",
"Static Key Text Field",
"static_key_text_id"
"static_key_text_id",
);

cy.addStaticFieldToSlice(
"Rich Text",
"Static Rich Text Field",
"static_rich_text_id"
"static_rich_text_id",
);

cy.addRepeatableFieldToSlice(
"Rich Text",
"Repeatable Rich Text Field",
"repeatable_rich_text_id"
"repeatable_rich_text_id",
);

cy.addRepeatableFieldToSlice(
"Key Text",
"Repeatable Key Text Field",
"repeatable_key_text_id"
"repeatable_key_text_id",
);

sliceBuilder.save();
Expand Down Expand Up @@ -115,7 +115,7 @@ describe.skip("I am an existing SM user (Next) and I want to associate a Slice t
cy.get("#review-form");
cy.get("[data-cy=review-form-score-3]").click();
cy.get("[data-cy=review-form-comment]").type(
"Cypress test - testing the comment of the survey"
"Cypress test - testing the comment of the survey",
);
cy.get("#review-form").submit();

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/user-flows/transactional-push.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe.skip("I am an existing SM user and I want to push local changes", () =>
changesPage.mockPushError(500).pushChanges();

cy.contains(
"Something went wrong when pushing your changes. Check your terminal logs."
"Something went wrong when pushing your changes. Check your terminal logs.",
);

cy.clearProject();
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/customTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function createCustomType(id, name) {

cy.location("pathname", { timeout: 15000 }).should(
"eq",
`/custom-types/${id}`
`/custom-types/${id}`,
);
cy.readFile(TYPES_FILE).should("contains", name);
cy.readFile(CUSTOM_TYPE_MODEL(id));
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ export function removeTypes() {
*/
export function modifyFile(filePath, updateContent) {
cy.readFile(filePath).then((content) =>
cy.writeFile(filePath, updateContent(content))
cy.writeFile(filePath, updateContent(content)),
);
}
2 changes: 1 addition & 1 deletion cypress/helpers/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function isSameImageAs(subject, fixtureImage) {
isCorrectDimensions(
subject,
fixtureImage.naturalWidth,
fixtureImage.naturalHeight
fixtureImage.naturalHeight,
);
resolve();
};
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/localStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function setSliceMachineUserContext({
lastSyncChange,
hasSeenSimulatorToolTip,
}),
})
}),
);
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/slices.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function createSlice(lib, id, name) {

cy.location("pathname", { timeout: 20000 }).should(
"eq",
`/slices/${lib}/${name}/default`
`/slices/${lib}/${name}/default`,
);
cy.readFile(TYPES_FILE).should("contains", name);
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/RenameModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CustomTypeRenameModal extends RenameModal {
constructor() {
super(
"[data-cy=rename-custom-type-modal]",
'[data-cy="custom-type-name-input"]'
'[data-cy="custom-type-name-input"]',
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/simulator/editorPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EditorPage {
.then((currentValue) => {
if (currentValue === value) {
throw new Error(
`Cannot toggle "${inputLabel}" to same value (${value})`
`Cannot toggle "${inputLabel}" to same value (${value})`,
);
}
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/slices/screenshotModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ScreenshotModal {
uploadImage(imageFixturePath) {
cy.get(`${this.root} input[type="file"]`).selectFile(
`${fixturePath}${imageFixturePath}`,
{ force: true }
{ force: true },
);
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/slices/sliceBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SliceBuilder extends BaseBuilder {
.callsFake((url) => {
simUrl = url;
console.log(
`window.open() won't be called as it currently generates a timeout in cypress. Calling cy.visit('${url}') instead.`
`window.open() won't be called as it currently generates a timeout in cypress. Calling cy.visit('${url}') instead.`,
);
// win.open.wrappedMethod.call(win, url, "_self");
});
Expand Down
6 changes: 3 additions & 3 deletions cypress/plugins/addAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const main = async () => {
headers: {
"Content-Type": "application/json",
},
}
},
);

if (!res.headers.has("Set-Cookie")) {
throw new Error(
"Could not authenticate to prismic. Please check the credentials."
"Could not authenticate to prismic. Please check the credentials.",
);
}

Expand All @@ -32,7 +32,7 @@ const main = async () => {
JSON.stringify({
base: new URL(PRISMIC_URL).toString(),
cookies: res.headers.get("Set-Cookie")?.split(", ").join("; ") || "",
})
}),
);
};

Expand Down
2 changes: 1 addition & 1 deletion cypress/plugins/createRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const [, , DOMAIN_NAME, PASSWORD, PRISMIC_URL] = process.argv;

const main = async () => {
const prismicAuthState = JSON.parse(
await fs.readFile(path.join(os.homedir(), ".prismic"), "utf8")
await fs.readFile(path.join(os.homedir(), ".prismic"), "utf8"),
);
const prismicAuthStateCookies = cookie.parse(prismicAuthState.cookies);

Expand Down
6 changes: 3 additions & 3 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as imageHelpers from "../helpers/images";
Object.keys(localStorageHelpers).forEach((localStorageHelper) => {
Cypress.Commands.add(
localStorageHelper,
localStorageHelpers[localStorageHelper]
localStorageHelpers[localStorageHelper],
);
});

Expand All @@ -21,7 +21,7 @@ Object.keys(filesystemHelpers).forEach((filesystemHelper) => {
Object.keys(customTypesHelpers).forEach((customTypesHelper) => {
Cypress.Commands.add(
customTypesHelper,
customTypesHelpers[customTypesHelper]
customTypesHelpers[customTypesHelper],
);
});

Expand All @@ -35,7 +35,7 @@ Object.keys(imageHelpers).forEach((imageHelper) => {
Cypress.Commands.add(
imageHelper,
{ prevSubject: true },
imageHelpers[imageHelper]
imageHelpers[imageHelper],
);
});

Expand Down
4 changes: 2 additions & 2 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ declare namespace Cypress {
hasSendAReview?: boolean,
viewedUpdates?: Record<string, unknown>,
hasSeenTutorialsToolTip?: boolean,
hasSeenSimulatorToolTip?: boolean
hasSeenSimulatorToolTip?: boolean,
): Chainable<undefined>;
getSliceMachineUSerContext(): Chainable<
undefined | Record<string, unknown>
>;
getInputByLabel<E extends Node = HTMLElement>(
label: string
label: string,
): Chainable<JQuery<E>>;
}
}
6 changes: 3 additions & 3 deletions e2e-projects/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "8.7.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.30.0",
"prettier": "2.8.4",
"prettier-plugin-svelte": "^2.10.1",
"prettier": "^3.0.3",
"prettier-plugin-svelte": "^3.0.3",
"slice-machine-ui": "workspace:*",
"svelte": "^4.0.5",
"svelte-check": "^3.4.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"husky": "8.0.3",
"lerna": "7.0.2",
"lint-staged": "13.2.0",
"prettier": "2.8.4",
"prettier": "3.0.3",
"start-server-and-test": "1.15.5"
},
"lint-staged": {
Expand Down
Loading

0 comments on commit bf45175

Please sign in to comment.