diff --git a/.github/workflows/release-and-publish.yml b/.github/workflows/release-and-publish.yml index 90ae7bf8..b1854eb6 100644 --- a/.github/workflows/release-and-publish.yml +++ b/.github/workflows/release-and-publish.yml @@ -56,6 +56,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: publish - run: pnpm publish-npm + run: pnpm publish --recursive --access public --no-git-checks env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.vscode/settings.json b/.vscode/settings.json index 402ecced..73e53e8b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,17 @@ { "cSpell.words": ["addon", "addons", "barfoo", "json", "websmith"], - "jest.jestCommandLine": "node_modules/.bin/jest", - "typescript.tsdk": "node_modules/typescript/lib", - "eslint.experimental.useFlatConfig": true, "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "eslint.experimental.useFlatConfig": true, "eslint.format.enable": true, - "eslint.lintTask.enable": true + "eslint.lintTask.enable": true, + // For those using file-nesting, nest the new files. E.g.: + "explorer.fileNesting.patterns": { + "package.json": "pnpm-workspace.yaml, pnpm-lock.yaml" + }, + "jest.jestCommandLine": "node_modules/.bin/jest", + "npm.packageManager": "pnpm", + "search.exclude": { + "pnpm-lock.yaml": true + }, + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/Release-Notes.md b/Release-Notes.md index 1abc503f..5836d8f4 100644 --- a/Release-Notes.md +++ b/Release-Notes.md @@ -16,6 +16,14 @@ Release notes follow the [keep a changelog](https://keepachangelog.com/en/1.0.0/ - TBA +## [0.5.2] - 2024-04-19 + +Bugfix release to address an issue with workspace internal dependencies with publishing npm packages. + +### Fixed + +- Fixes an issue with unresolved `workspace:` dependencies in published packages + ## [0.5.1] - 2024-04-18 Bugfix release to address an issue with publishing the npm packages. diff --git a/eslint.config.js b/eslint.config.js index 28c12ab4..6211cf43 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/no-var-requires */ /* * --------------------------------------------------------------------------------------------- * Copyright (c) Quatico Solutions AG. All rights reserved. @@ -10,7 +13,6 @@ const ts = require("typescript-eslint"); const jest = require("eslint-plugin-jest"); const prettier = require("eslint-config-prettier"); const nxPlugin = require("@nx/eslint-plugin"); -const jsoncParser = require("jsonc-eslint-parser"); // TODO: Enable the import when eslint-plugin-import supports FlatESLint // const importPlugin = require("eslint-plugin-import"); @@ -33,7 +35,6 @@ module.exports = [ ...globals.node, }, parserOptions: { - project: true, tsconfigRootDir: __dirname, project: __dirname + "/tsconfig.lint.json", ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features diff --git a/package.json b/package.json index 155f7ba2..e41b8aa0 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,7 @@ "license:check": "license-check-and-add check -f license-config.json", "license:add": "license-check-and-add add -f license-config.json", "license:remove": "license-check-and-add remove -f license-config.json", - "preinstall": "npx only-allow pnpm", - "publish-npm": "nx run-many --target=publish-npm" + "preinstall": "npx only-allow pnpm" }, "devDependencies": { "@cucumber/gherkin": "^28.0.0", @@ -74,5 +73,12 @@ "typescript": "5.4.5", "typescript-eslint": "^7.7.0", "webpack": "^5.91.0" + }, + "pnpm": { + "peerDependencyRules": { + "ignoreMissing": [ + "eslint" + ] + } } } \ No newline at end of file diff --git a/packages/api/package.json b/packages/api/package.json index 6a22348e..42dafede 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -4,8 +4,17 @@ "description": "Addon API library for the websmith compiler", "author": "Quatico Solutions AG", "license": "MIT", - "main": "./lib/index.js", - "types": "./lib/index.d.ts", + "main": "lib/index.js", + "publishConfig": { + "main": "lib/index.js", + "typings": "lib/index.d.ts" + }, + "files": [ + "LICENSE", + "README.md", + "lib", + "docs" + ], "repository": { "type": "git", "url": "git+https://github.com/quatico-solutions/websmith.git" @@ -14,12 +23,6 @@ "url": "https://github.com/quatico-solutions/websmith/issues" }, "homepage": "https://github.com/quatico-solutions/websmith#readme", - "files": [ - "LICENSE", - "README.md", - "lib", - "docs" - ], "scripts": { "clean": "rimraf lib bin coverage", "lint": "eslint \"{src,test}/**/*.ts\" --color", @@ -29,8 +32,7 @@ "watch:test": "jest --watch", "test": "jest --coverage --passWithNoTests", "test:update-snapshots": "pnpm test -u", - "dist": "pnpm clean && pnpm lint && pnpm test && cross-env-shell NODE_ENV=production \"pnpm build\"", - "publish-npm": "npm publish --access public" + "dist": "pnpm clean && pnpm lint && pnpm test && cross-env-shell NODE_ENV=production \"pnpm build\"" }, "devDependencies": { "@eslint/js": "^9.0.0", diff --git a/packages/compiler/package.json b/packages/compiler/package.json index c602a794..5b606035 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -4,11 +4,22 @@ "description": "A CLI for the websmith compiler", "author": "Quatico Solutions AG", "license": "MIT", - "main": "./bin/index.js", - "types": "./bin/index.d.ts", + "main": "bin/index.js", + "publishConfig": { + "main": "bin/index.js", + "typings": "bin/index.d.ts", + "executableFiles": [ + "bin/bin.js" + ] + }, "bin": { - "websmith": "./bin/bin.js" + "websmith": "src/bin.ts" }, + "files": [ + "LICENSE", + "README.md", + "bin" + ], "repository": { "type": "git", "url": "git+https://github.com/quatico-solutions/websmith.git" @@ -17,11 +28,6 @@ "url": "https://github.com/quatico-solutions/websmith/issues" }, "homepage": "https://github.com/quatico-solutions/websmith#readme", - "files": [ - "LICENSE", - "README.md", - "bin" - ], "scripts": { "clean": "rimraf lib bin coverage", "lint": "eslint \"{src,test}/**/*.ts\" --color", @@ -31,8 +37,7 @@ "watch:test": "jest --watch", "test": "jest --coverage", "test:update-snapshots": "pnpm test -u", - "dist": "cross-env-shell NODE_ENV=production \"pnpm clean && pnpm lint && pnpm test && pnpm build\"", - "publish-npm": "npm publish --access public" + "dist": "cross-env-shell NODE_ENV=production \"pnpm clean && pnpm lint && pnpm test && pnpm build\"" }, "devDependencies": { "@eslint/js": "^9.0.0", diff --git a/packages/compiler/src/bin.ts b/packages/compiler/src/bin.ts old mode 100644 new mode 100755 diff --git a/packages/core/package.json b/packages/core/package.json index 05487dc1..c612be0d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -4,8 +4,16 @@ "description": "A frontend for the TypeScript compiler", "author": "Quatico Solutions AG", "license": "MIT", - "main": "./lib/index.js", - "types": "./lib/index.d.ts", + "main": "lib/index.js", + "publishConfig": { + "main": "lib/index.js", + "typings": "lib/index.d.ts" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], "repository": { "type": "git", "url": "git+https://github.com/quatico-solutions/websmith.git" @@ -14,11 +22,6 @@ "url": "https://github.com/quatico-solutions/websmith/issues" }, "homepage": "https://github.com/quatico-solutions/websmith#readme", - "files": [ - "LICENSE", - "README.md", - "lib" - ], "scripts": { "clean": "rimraf lib bin coverage", "lint": "eslint \"{src,test}/**/*.ts\" --color", @@ -28,8 +31,7 @@ "watch:test": "jest --watch", "test": "jest --coverage", "test:update-snapshots": "pnpm test -u", - "dist": "cross-env-shell NODE_ENV=production \"pnpm clean && pnpm lint && pnpm test && pnpm build\"", - "publish-npm": "npm publish --access public" + "dist": "cross-env-shell NODE_ENV=production \"pnpm clean && pnpm lint && pnpm test && pnpm build\"" }, "devDependencies": { "@eslint/js": "^9.0.0", diff --git a/packages/webpack-test/jest.config.js b/packages/webpack-test/jest.config.js index 33e0fa0f..6b3e2877 100644 --- a/packages/webpack-test/jest.config.js +++ b/packages/webpack-test/jest.config.js @@ -6,14 +6,6 @@ */ module.exports = { - collectCoverageFrom: ["./src/**/*.{ts,tsx}"], - coverageDirectory: "coverage", - moduleNameMapper: { - "@quatico/websmith-api": "/../api/src", - "@quatico/websmith-compiler": "/../compiler/src", - "@quatico/websmith-core": "/../core/src", - "@quatico/websmith-webpack": "/../webpack/src", - }, roots: ["/src/"], moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], testEnvironment: "node", @@ -31,5 +23,4 @@ module.exports = { }, ], }, - resetMocks: true, }; diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 44c6e06c..d9e3f081 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -3,9 +3,17 @@ "description": "Webpack loader for @quatico/websmith-compiler", "version": "0.5.1", "author": "Quatico Solutions AG", - "main": "lib/index.js", - "types": "lib/index.d.ts", "license": "MIT", + "main": "lib/index.js", + "publishConfig": { + "main": "lib/index.js", + "typings": "lib/index.d.ts" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], "repository": { "type": "git", "url": "git+https://github.com/quatico-solutions/websmith.git" @@ -14,11 +22,6 @@ "url": "https://github.com/quatico-solutions/websmith/issues" }, "homepage": "https://github.com/quatico-solutions/websmith#readme", - "files": [ - "LICENSE", - "README.md", - "lib" - ], "scripts": { "clean": "rimraf lib coverage", "lint": "eslint \"{src,test}/**/*.{js,ts,tsx}\" --color", @@ -27,8 +30,7 @@ "watch": "tsc --watch", "watch:test": "jest --watch", "test": "jest --coverage", - "dist": "pnpm clean && pnpm lint && pnpm test && cross-env-shell NODE_ENV=production \"pnpm build\"", - "publish-npm": "npm publish --access public" + "dist": "pnpm clean && pnpm lint && pnpm test && cross-env-shell NODE_ENV=production \"pnpm build\"" }, "dependencies": { "@quatico/websmith-api": "workspace:^",