diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 280ba018b..e71efce2e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,26 +23,8 @@ jobs: - name: lint run: npm run lint - # test_bundle: - # name: Test production - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: actions/setup-node@v3 - # with: - # node-version: 16 - # cache: 'npm' - # - name: Install - # run: npm install - # - name: Build - # run: npm run build - # - name: Build test app - # run: npm run build:test - # - name: Run tests - # run: npm run test:standalone - - test_prettier_v2: - name: Prettier V2 + test_bundle: + name: Test production runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -52,14 +34,12 @@ jobs: cache: 'npm' - name: Install run: npm install - - name: Build with Prettier V3 + - name: Build run: npm run build - - name: Downgrade Prettier to V2 - run: npm install prettier@2.8.8 - # - name: Build test app - # run: npm run build:test - # - name: Run standalone tests - # run: npm run test:standalone + - name: Build test app + run: npm run build:test + - name: Run tests + run: npm run test:standalone -- --runInBand test_linux: name: Test on Linux with Node ${{ matrix.node }} @@ -76,7 +56,7 @@ jobs: - name: Install run: npm install - name: Run tests - run: npm run test:all + run: npm run test:all -- --runInBand test_macos: name: Test on MacOS with Node 16 @@ -90,7 +70,7 @@ jobs: - name: Install run: npm install - name: Run tests - run: npm run test:all + run: npm run test:all -- --runInBand test_windows: name: Test on Windows with Node 16 @@ -104,4 +84,4 @@ jobs: - name: Install run: npm install - name: Run tests - run: npm run test:all + run: npm run test:all -- --runInBand diff --git a/README.md b/README.md index aa8c551f3..b75428beb 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Install both `prettier` and `prettier-plugin-solidity`: npm install --save-dev prettier prettier-plugin-solidity ``` +> :package: ** Make sure `prettier`'s version is at least `3.0.0`** + Run prettier in your contracts: ```Bash @@ -46,17 +48,12 @@ Or you can use it as part of your linting to check that all your code is prettif > Prettier Solidity only works with valid code. If there is a syntax error, nothing will be done and a parser error will be thrown. -### ~~Using in the Browser~~ _Disabled during v2.0.0-beta_ +### Using in the Browser _Added in v1.1.0_ To use this package in the browser, you need to load Prettier's standalone bundle before loading the build provided in this package. -```html - - -``` - Prettier's unpkg field points to `https://unpkg.com/prettier/standalone.js`, in a similar way this plugin points to `https://unpkg.com/prettier-plugin-solidity/dist/standalone.js`. Once the scripts are loaded you will have access the globals `prettier` and `prettierPlugins`. @@ -64,7 +61,14 @@ Once the scripts are loaded you will have access the globals `prettier` and `pre We follow Prettier's strategy for populating their plugins in the object `prettierPlugins`, you can load other plugins like `https://unpkg.com/prettier@2.8.0/parser-markdown.js` and Prettier will have access to multiple parsers. ```html -