Skip to content

Commit

Permalink
build(local): add dedupe deps to fix aliased local setup
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrc committed Jul 2, 2024
1 parent a5d1da9 commit 58439b2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
uses: actions/checkout@v4
- name: Install formule dependencies
run: yarn install --frozen-lockfile
- name: Link
run: yarn link-local && cd formule-demo && yarn link-local-lib
- name: Install formule-demo dependencies
working-directory: ./formule-demo
run: yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion formule-demo/cypress/e2e/builder.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("test basic functionality", () => {
.should("have.length", 1);
});

it.only("allows deleting a field from the tree", () => {
it("allows deleting a field from the tree", () => {
cy.addField("text");

cy.getByDataCy("treeItem").should("have.length", 1);
Expand Down
2 changes: 0 additions & 2 deletions formule-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"link-local-lib": "yarn link react-formule && yarn link react && yarn link react-dom",
"unlink-local-lib": "yarn unlink react-formule && yarn unlink react && yarn unlink react-dom",
"test:e2e": "cypress open",
"test:e2e:run": "cypress run --headless --browser chrome"
},
Expand Down
2 changes: 2 additions & 0 deletions formule-demo/vite.config.local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { resolve } from "path";
import viteConfig from "./vite.config.ts";

// Enables hmr in development without having to rebuild the library
// and without having to yarn link anything
viteConfig.resolve = {
alias: {
"react-formule": resolve(__dirname, "../src/index.ts"),
},
dedupe: ["react", "react-dom"],
};
viteConfig.base = undefined;

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"link-local": "yarn link && cd node_modules/react && yarn link && cd ../react-dom && yarn link",
"unlink-local": "yarn unlink && cd node_modules/react && yarn unlink && cd ../react-dom && yarn unlink",
"test:unit": "vitest",
"coverage": "vitest run --coverage",
"build:watch": "vite build --watch --config vite.config.local.ts",
Expand Down

0 comments on commit 58439b2

Please sign in to comment.