Skip to content

Commit

Permalink
feat: introduce @lavamoat/allow-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Feb 27, 2023
1 parent aeff618 commit 62dff25
Show file tree
Hide file tree
Showing 17 changed files with 345 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
node-version: "16"
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn setup
- name: Install Playwright Browsers
run: npx playwright install chromium
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
node-version: "16"
cache: "yarn"

- run: yarn install --frozen-lockfile
- run: yarn setup
- run: |
echo 'module.exports = { basePath: "/argent-x" }' > packages/dapp/next.config.js
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
node-version: "16"
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn setup
- run: yarn build
- name: Release npm packages
# if flow is triggered by a tag, publish to npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn setup

- name: Lint
run: yarn lint
Expand Down
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-scripts true
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enableScripts: false
2 changes: 1 addition & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _[Use GitHub interface](https://blog.sapegin.me/all/open-source-for-everyone/) f

- If it’s your first pull request, watch [this amazing course](http://makeapullrequest.com/) by [Kent C. Dodds](https://twitter.com/kentcdodds).
- Fork the repository and clone your fork.
- Install dependencies: `yarn install`.
- Setup project: `yarn setup`.

## Development workflow

Expand Down
10 changes: 7 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
- [🧒 Example dapp](#-example-dapp)
- [🌐 Usage with your dapp](#-usage-with-your-dapp)
- [🚀 Install from sources](#-install-from-sources)
- [Chrome](#chrome)
- [Firefox](#firefox)
- [👩🏾‍💻 Development](#-development)
- [🧪 Testing](#-testing)
- [Setup](#setup)
- [Run devnet locally](#run-devnet-locally)
- [Run tests](#run-tests)
- [Tools to help with testing](#tools-to-help-with-testing)
- [✏️ Contributing](#️-contributing)
- [❤️ Family and friends](#️-family-and-friends)
- [👨🏼‍🎨 Authors and license](#-authors-and-license)
Expand Down Expand Up @@ -80,7 +84,7 @@ Checkout [starknet.js](https://github.com/0xs34n/starknet.js) to learn more abou
First clone this repository on your machine then run:

```bash
yarn # setup dependencies
yarn setup # setup dependencies
yarn build # run build process for all packages
```

Expand Down Expand Up @@ -110,8 +114,8 @@ To contribute to this repository please read the [contributing guidelines](Contr
To setup the repo on your machine just run:

```bash
yarn # setup dependencies
yarn dev # run build process for all packages in watch mode
yarn setup # setup dependencies
yarn dev # run build process for all packages in watch mode
```

This project contains 3 packages:
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"repository": "github:argentlabs/argent-x",
"homepage": "https://github.com/argentlabs/argent-x/#readme",
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.0",
"@lavamoat/preinstall-always-fail": "^1.0.0",
"bundlewatch": "^0.3.3",
"husky": "^8.0.0",
"import-sort-style-module": "^6.0.0",
Expand Down Expand Up @@ -35,8 +37,7 @@
"test": "lerna run test --stream",
"test:watch": "lerna run test:watch --stream",
"test:e2e": "lerna run test:e2e --stream",
"prepare": "husky install && lerna run prepare --stream",
"postinstall": "patch-package && lerna run postinstall --stream",
"setup": "yarn install --frozen-lockfile && yarn allow-scripts && husky install && patch-package && lerna run setup --stream",
"storybook": "cd packages/storybook && yarn storybook",
"devnet:upgrade-helper": "NODE_NO_WARNINGS=1 ts-node ./scripts/devnet-upgrade-helper.ts",
"devnet:setup-contracts": "NODE_NO_WARNINGS=1 ts-node ./scripts/devnet-setup-contracts.ts"
Expand All @@ -60,5 +61,14 @@
"lint-staged": {
"*.{js,jsx,ts,tsx,css,md,yml,json}": "prettier --write",
"*.{ts,tsx}": "eslint --cache --ext .ts,.tsx"
},
"lavamoat": {
"allowScripts": {
"$root$": true,
"@lavamoat/preinstall-always-fail": false,
"nx": false,
"nx>@parcel/watcher": false,
"nx>@swc/core": false
}
}
}
2 changes: 1 addition & 1 deletion packages/get-starknet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dist/"
],
"scripts": {
"prepare": "rollup -c",
"setup": "rollup -c",
"build": "rollup -c",
"dev": "rollup -c -w"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/guardian/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"build": "vite build",
"dev": "vite build --watch",
"prepare": "yarn build"
"setup": "yarn build"
},
"dependencies": {
"jose": "^4.11.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/multicall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"test": "vitest run",
"test:watch": "vitest",
"dev": "vite build --watch",
"prepare": "vite build",
"setup": "vite build",
"build": "vite build"
},
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sessions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"test": "vitest run",
"test:watch": "vitest",
"dev": "vite build --watch",
"prepare": "vite build",
"setup": "vite build",
"build": "vite build"
},
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/stack-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"test:watch": "vitest",
"lint": "eslint . --cache --ext .ts,.tsx",
"dev": "vite build --watch",
"prepare": "vite build",
"setup": "vite build",
"build": "vite build",
"example": "cd example && react-scripts start"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/swap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"dev": "vite build --watch",
"prepare": "vite build",
"setup": "vite build",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint . --cache --ext .ts,.tsx --fix"
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@
"gen:theme-typings": "chakra-cli tokens ./src/theme",
"gen:icons": "ts-node ./scripts/generate-icons.ts",
"lint": "eslint . --cache --ext .ts,.tsx",
"postinstall": "yarn gen:theme-typings",
"setup": "yarn gen:theme-typings && vite build",
"dev": "vite build --watch",
"prepare": "vite build",
"build": "vite build"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 62dff25

Please sign in to comment.