diff --git a/.gitattributes b/.gitattributes index 4346cc6581..804f6c2e33 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +*.snap linguist-generated /.gitattributes linguist-generated /.github/pull_request_template.md linguist-generated /.github/workflows/auto-merge.yml linguist-generated @@ -11,6 +12,7 @@ /.gitignore linguist-generated /.mergify.yml linguist-generated /.npmignore linguist-generated +/.npmrc linguist-generated /.nvmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -22,5 +24,5 @@ /docs/README.md linguist-generated /lerna.json linguist-generated /LICENSE linguist-generated -/package-lock.json linguist-generated -/package.json linguist-generated \ No newline at end of file +/package.json linguist-generated +/pnpm-lock.yaml linguist-generated \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 470cba037a..a06d128592 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,12 +22,16 @@ jobs: - name: Fetch tags if: ${{ github.workflow == 'build' }} run: if [ $(git rev-parse --is-shallow-repository) != "false" ] ; then git fetch origin main --tags --unshallow; fi + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: "8" - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - name: Install dependencies - run: npm install + run: pnpm i --no-frozen-lockfile - name: build run: npx projen build - name: Find mutations diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2275b2ec8c..3ccf700b21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,12 +28,16 @@ jobs: - name: Fetch tags if: ${{ github.workflow == 'build' }} run: if [ $(git rev-parse --is-shallow-repository) != "false" ] ; then git fetch origin main --tags --unshallow; fi + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: "8" - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - name: Install dependencies - run: npm ci + run: pnpm i --frozen-lockfile - name: release run: npx projen release - name: Check if version has already been tagged diff --git a/.github/workflows/upgrade-main.yml b/.github/workflows/upgrade-main.yml index 7336ddfe93..1a941f1db0 100644 --- a/.github/workflows/upgrade-main.yml +++ b/.github/workflows/upgrade-main.yml @@ -21,12 +21,16 @@ jobs: - name: Fetch tags if: ${{ github.workflow == 'build' }} run: if [ $(git rev-parse --is-shallow-repository) != "false" ] ; then git fetch origin main --tags --unshallow; fi + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: "8" - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - name: Install dependencies - run: npm ci + run: pnpm i --frozen-lockfile - name: Upgrade dependencies run: npx projen upgrade - name: Find mutations diff --git a/.gitignore b/.gitignore index 7123040a54..d162e49650 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ jspm_packages/ !/.mergify.yml !/.github/workflows/upgrade-main.yml !/.github/pull_request_template.md +!/.npmrc !/.nvmrc !/.github/workflows/auto-merge.yml !/lerna.json diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..6976a1f36b --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +resolution-mode=highest diff --git a/.projen/files.json b/.projen/files.json index 9796fd92f0..cc5c0e85c7 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -11,6 +11,7 @@ ".gitignore", ".mergify.yml", ".npmignore", + ".npmrc", ".nvmrc", ".projen/deps.json", ".projen/files.json", diff --git a/.projen/tasks.json b/.projen/tasks.json index 407d9cafad..9047648db7 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -117,7 +117,7 @@ "description": "Install project dependencies and update lockfile (non-frozen)", "steps": [ { - "exec": "npm install" + "exec": "pnpm i --no-frozen-lockfile" }, { "exec": "lerna run install --stream --since $(git describe --abbrev=0 --tags --match \"v*\")" @@ -129,7 +129,7 @@ "description": "Install project dependencies using frozen lockfile", "steps": [ { - "exec": "npm ci" + "exec": "pnpm i --frozen-lockfile" }, { "exec": "lerna run install:ci --stream --since $(git describe --abbrev=0 --tags --match \"v*\")" @@ -148,6 +148,9 @@ }, { "exec": "lerna-projen copy-dist packages/mondo-result-types/dist dist" + }, + { + "exec": "lerna-projen copy-dist packages/mondo-fetch/dist dist" } ] }, @@ -160,6 +163,9 @@ }, { "exec": "lerna-projen move-docs docs packages/mondo-result-types docs" + }, + { + "exec": "lerna-projen move-docs docs packages/mondo-fetch docs" } ] }, @@ -288,13 +294,13 @@ }, "steps": [ { - "exec": "npx npm-check-updates@16 --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=lerna,lerna-projen,projen,ts-node,typescript" + "exec": "pnpm dlx npm-check-updates@16 --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=lerna,lerna-projen,projen,ts-node,typescript" }, { - "exec": "npm install" + "exec": "pnpm i --no-frozen-lockfile" }, { - "exec": "npm update constructs lerna lerna-projen projen standard-version ts-node typescript" + "exec": "pnpm update constructs lerna lerna-projen projen standard-version ts-node typescript" }, { "exec": "npx projen" @@ -306,7 +312,7 @@ } }, "env": { - "PATH": "$(npx -c \"node --print process.env.PATH\")" + "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")" }, "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." } diff --git a/.projenrc.ts b/.projenrc.ts index 002b9ddd65..241e98760f 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -1,6 +1,8 @@ import {LernaProject} from 'lerna-projen' import {commonOptions, addNvmrc, addAutoMergeWorkflow} from './projects/common' import {getMondoResultTypeProject} from './projects/result-types' +import {getMondoFetchProject} from './projects/mondo-fetch' +import {NodePackageManager} from 'projen/lib/javascript' const workflowNodeVersion = '20' @@ -8,13 +10,15 @@ const project = new LernaProject({ ...commonOptions, projenrcTs: true, name: 'mondo-common-libs', + packageManager: NodePackageManager.PNPM, + pnpmVersion: '8', releaseToNpm: true, publishTasks: true, docgen: true, workflowNodeVersion, sinceLastRelease: true, devDeps: [ - 'lerna-projen' + 'lerna-projen', ], majorVersion: 1, stale: true, @@ -29,5 +33,6 @@ addNvmrc(project, workflowNodeVersion) addAutoMergeWorkflow(project) getMondoResultTypeProject(project) +getMondoFetchProject(project) -project.synth(); +project.synth() diff --git a/docs/README.md b/docs/README.md index 8b1ddeb96e..96a50fd75f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1 +1,2 @@ -- ## [@mondopower/result-types](../packages/mondo-result-types/README.md) \ No newline at end of file +- ## [@mondopower/result-types](../packages/mondo-result-types/README.md) +- ## [@mondopower/fetch](../packages/mondo-fetch/README.md) \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 6d4883b852..ae94440433 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,6 +7,11 @@ @mondopower/result-types +