Skip to content

Commit

Permalink
E Fixes publishConfig to publish package files with pnpm
Browse files Browse the repository at this point in the history
+ Add publishConfig to non private packages
+ Update pipeline to use pnpm publish
+ Remove npm publish task
+ Remove unit test config from e2e jest.config.js
+ Update vscode settings to improve pnpm experience
+ Update release notes
  • Loading branch information
jwloka committed Apr 19, 2024
1 parent 47102d0 commit 97f0e0c
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
16 changes: 12 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
}
8 changes: 8 additions & 0 deletions Release-Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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");

Expand All @@ -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
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -74,5 +73,12 @@
"typescript": "5.4.5",
"typescript-eslint": "^7.7.0",
"webpack": "^5.91.0"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"eslint"
]
}
}
}
22 changes: 12 additions & 10 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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",
Expand Down
25 changes: 15 additions & 10 deletions packages/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Empty file modified packages/compiler/src/bin.ts
100644 → 100755
Empty file.
20 changes: 11 additions & 9 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 0 additions & 9 deletions packages/webpack-test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
*/

module.exports = {
collectCoverageFrom: ["./src/**/*.{ts,tsx}"],
coverageDirectory: "coverage",
moduleNameMapper: {
"@quatico/websmith-api": "<rootDir>/../api/src",
"@quatico/websmith-compiler": "<rootDir>/../compiler/src",
"@quatico/websmith-core": "<rootDir>/../core/src",
"@quatico/websmith-webpack": "<rootDir>/../webpack/src",
},
roots: ["<rootDir>/src/"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
testEnvironment: "node",
Expand All @@ -31,5 +23,4 @@ module.exports = {
},
],
},
resetMocks: true,
};
20 changes: 11 additions & 9 deletions packages/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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:^",
Expand Down

0 comments on commit 97f0e0c

Please sign in to comment.