Skip to content

Commit

Permalink
AG-30370 convert to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
maximtop committed Mar 25, 2024
1 parent 55b0402 commit 801daad
Show file tree
Hide file tree
Showing 17 changed files with 670 additions and 4,020 deletions.
2 changes: 1 addition & 1 deletion bamboo-specs/adguard-api-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Build:
pnpm --filter @adguard/api build
cd packages/adguard-api
pnpm pack && mv $(ls adguard-api-*.tgz) adguard-api.tgz
pnpm pack && mv adguard-api-*.tgz adguard-api.tgz
- inject-variables:
file: ./packages/adguard-api/dist/build.txt
scope: RESULT
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/agtree-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Build:
# Pack the AGTree package into a tarball
cd packages/agtree
pnpm pack && mv $(ls adguard-agtree-*.tgz) agtree.tgz
pnpm pack && mv adguard-agtree-*.tgz agtree.tgz
- inject-variables:
file: ./packages/agtree/dist/build.txt
scope: RESULT
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/css-tokenizer-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Build:
cd packages/css-tokenizer
# Pack
pnpm pack && mv $(ls adguard-css-tokenizer-*.tgz) css-tokenizer.tgz
pnpm pack && mv adguard-css-tokenizer-*.tgz css-tokenizer.tgz
- inject-variables:
file: ./packages/css-tokenizer/dist/build.txt
scope: RESULT
Expand Down
13 changes: 5 additions & 8 deletions bamboo-specs/logger-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ Build:
ls -alt
# Install dependencies
npx lerna@6 bootstrap --scope @adguard/logger
pnpm install
# Build
npx lerna@6 run --scope @adguard/logger build
npx lerna run --scope @adguard/logger build
# Pack the logger package into a tarball
cd packages/logger/
yarn pack --filename logger.tgz
pnpm pack && mv adguard-logger-*.tgz logger.tgz
- inject-variables:
file: ./packages/logger/dist/build.txt
scope: RESULT
Expand All @@ -69,11 +69,8 @@ Build:
ls -la
echo "Size before cleanup:" && du -h | tail -n 1
# cleanup parent
rm -rf node_modules
# cleanup child packages
npx lerna@6 clean -y
pnpm clean
echo "Size after cleanup:" && du -h | tail -n 1
# Store the logger package tarball as an artifact
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/logger-increment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Increment:
ls -alt
npx lerna@6 run --scope @adguard/logger increment
pnpm --filter @adguard/logger increment
- any-task:
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.commit
configuration:
Expand Down
15 changes: 6 additions & 9 deletions bamboo-specs/logger-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ Test:
ls -alt
# Install deps for project
npx lerna@6 bootstrap --scope @adguard/logger
pnpm install
# Build the package
npx lerna@6 run --scope @adguard/logger build
pnpm --filter @adguard/logger build
# Lint code
npx lerna@6 run --scope @adguard/logger lint
pnpm --filter @adguard/logger lint
# Run tests
npx lerna@6 run --scope @adguard/logger test
pnpm --filter @adguard/logger test
# Run smoke tests
npx lerna@6 run --scope @adguard/logger test:smoke
pnpm --filter @adguard/logger test:smoke
final-tasks:
- script:
interpreter: SHELL
Expand All @@ -64,10 +64,7 @@ Test:
echo "Size before cleanup:" && du -h | tail -n 1
# cleanup parent
rm -rf node_modules
# cleanup child packages
npx lerna@6 clean -y
pnpm clean
echo "Size after cleanup:" && du -h | tail -n 1
requirements:
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/tsurlfilter-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Build:
pnpm --filter @adguard/tsurlfilter build
cd packages/tsurlfilter
pnpm pack && mv $(ls adguard-tsurlfilter-*.tgz) tsurlfilter.tgz
pnpm pack && mv adguard-tsurlfilter-*.tgz tsurlfilter.tgz
- inject-variables:
file: ./packages/tsurlfilter/dist/build.txt
scope: RESULT
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/tswebextension-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Build:
pnpm --filter @adguard/tswebextension build
cd packages/tswebextension
pnpm pack && mv $(ls adguard-tswebextension-*.tgz) tswebextension.tgz
pnpm pack && mv adguard-tswebextension-*.tgz tswebextension.tgz
- inject-variables:
file: ./packages/tswebextension/dist/build.txt
scope: RESULT
Expand Down
8 changes: 4 additions & 4 deletions packages/logger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ To contribute to the development of AdGuard Logger, follow these steps:

### Install dependencies
```bash
yarn install
pnpm install
```

### Run tests
```bash
yarn test
pnpm test
```

### Build
```bash
yarn build
pnpm build
```

### Lint
```bash
yarn lint
pnpm lint
```

## Limitations
Expand Down
9 changes: 5 additions & 4 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "1.0.0",
"scripts": {
"prebuild": "rimraf dist",
"build": "rollup -c rollup.config.ts --configPlugin typescript && yarn build:types && yarn build:txt",
"build": "pnpm prebuild && rollup -c rollup.config.ts --configPlugin typescript && pnpm build:types && pnpm build:txt",
"build:txt": "ts-node scripts/build-txt",
"build:types": "tsc --project tsconfig.base.json --declaration --emitDeclarationOnly --outdir dist/types",
"test": "jest",
"lint": "eslint --cache . && tsc --noEmit",
"test:smoke": "(cd tests/smoke/esm && yarn test) && (cd tests/smoke/cjs && yarn test) && (cd tests/smoke/typescript && yarn test)",
"increment": "yarn version --patch --no-git-tag-version"
"test:smoke": "(cd tests/smoke/esm && pnpm test) && (cd tests/smoke/cjs && pnpm test) && (cd tests/smoke/typescript && pnpm test)",
"increment": "pnpm version patch --no-git-tag-version"
},
"engines": {
"node": ">=18.19.0"
Expand Down Expand Up @@ -43,12 +43,12 @@
"log",
"logger"
],
"dependencies": {},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.56.0",
Expand All @@ -57,6 +57,7 @@
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsdoc": "^48.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.5",
"rollup": "^4.13.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/tests/smoke/cjs/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ cleanup() {
# Set trap to execute the cleanup function on script exit
trap cleanup EXIT

(cd ../../.. && yarn pack --filename $curr_path/$logger)
(cd ../../.. && pnpm pack && mv adguard-logger-*.tgz "$curr_path/$logger")

# unzip to @adguard/tsurlfilter to node_modules
logger_node_modules=$nm_path"/@adguard/logger"
mkdir -p $logger_node_modules
tar -xzf $logger --strip-components=1 -C $logger_node_modules

yarn start
pnpm start
echo "Test successfully built."
4 changes: 2 additions & 2 deletions packages/logger/tests/smoke/esm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ cleanup() {
# Set trap to execute the cleanup function on script exit
trap cleanup EXIT

(cd ../../.. && yarn pack --filename $curr_path/$logger)
(cd ../../.. && pnpm pack && mv adguard-logger-*.tgz "$curr_path/$logger")

# unzip to @adguard/tsurlfilter to node_modules
logger_node_modules=$nm_path"/@adguard/logger"
mkdir -p $logger_node_modules
tar -xzf $logger --strip-components=1 -C $logger_node_modules

yarn start
pnpm start
echo "Test successfully built."
4 changes: 2 additions & 2 deletions packages/logger/tests/smoke/typescript/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ cleanup() {
# Set trap to execute the cleanup function on script exit
trap cleanup EXIT

(cd ../../.. && yarn pack --filename $curr_path/$logger)
(cd ../../.. && pnpm pack && mv adguard-logger-*.tgz "$curr_path/$logger")

# unzip to @adguard/tsurlfilter to node_modules
logger_node_modules=$nm_path"/@adguard/logger"
mkdir -p $logger_node_modules
tar -xzf $logger --strip-components=1 -C $logger_node_modules

yarn start
pnpm start
echo "Test successfully built."
Loading

0 comments on commit 801daad

Please sign in to comment.