Skip to content

Commit f43f7de

Browse files
committed
Add publint to CI
1 parent aefc545 commit f43f7de

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

.github/workflows/lint-js-and-ruby.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,15 @@ jobs:
8787
run: yarn start format.listDifferent
8888
- name: Type-check TypeScript
8989
run: yarn run type-check
90-
- name: Lint package publishing
90+
- name: Pack for attw and publint
91+
run: yarn pack -f react-on-rails.tgz
92+
- name: Lint package types
9193
# --profile because we don't care about node10
9294
# --ignore-rules CJS default export can't be resolved at the moment,
9395
# revisit in 15.0.0
94-
run: yarn run attw --pack . --profile node16 --ignore-rules cjs-only-exports-default
96+
run: yarn run attw react-on-rails.tgz --profile node16 --ignore-rules cjs-only-exports-default
97+
- name: Lint package publishing
98+
run: yarn run publint --strict react-on-rails.tgz
9599
# We only download and run Actionlint if there is any difference in GitHub Action workflows
96100
# https://github.com/rhysd/actionlint/blob/main/docs/usage.md#on-github-actions
97101
- name: Check for GitHub Actions changes

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "15.0.0-alpha.2",
44
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
55
"main": "node_package/lib/ReactOnRails.full.js",
6+
"type": "commonjs",
67
"exports": {
78
".": {
89
"react-server": "./node_package/lib/ReactOnRailsRSC.js",
@@ -49,6 +50,7 @@
4950
"nps": "^5.9.3",
5051
"prettier": "^2.8.8",
5152
"prop-types": "^15.8.1",
53+
"publint": "^0.3.8",
5254
"react": "^19.0.0",
5355
"react-dom": "^19.0.0",
5456
"react-on-rails-rsc": "19.0.0",

script/convert

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ File.rename(old_config, new_config)
1616
gsub_file_content("../Gemfile.development_dependencies", 'gem "shakapacker", "8.0.0"', 'gem "shakapacker", "6.6.0"')
1717

1818
# The below packages don't work on the oldest supported Node version and aren't needed there anyway
19-
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
2019
gsub_file_content("../package.json", %r{"@arethetypeswrong/cli": "[^"]*",}, "")
2120
gsub_file_content("../package.json", %r{"@testing-library/dom": "[^"]*",}, "")
2221
gsub_file_content("../package.json", %r{"@testing-library/react": "[^"]*",}, "")
22+
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
23+
gsub_file_content("../package.json", /"publint": "[^"]*",/, "")
2324

2425
gsub_file_content("../spec/dummy/package.json", '"shakapacker": "8.0.0",', '"shakapacker": "6.6.0",')
2526

yarn.lock

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,11 @@
13801380
"@nodelib/fs.scandir" "2.1.3"
13811381
fastq "^1.6.0"
13821382

1383+
"@publint/pack@^0.1.2":
1384+
version "0.1.2"
1385+
resolved "https://registry.yarnpkg.com/@publint/pack/-/pack-0.1.2.tgz#1b9a9567423262093e4a73e77697b65bf622f8c9"
1386+
integrity sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==
1387+
13831388
"@sinclair/typebox@^0.27.8":
13841389
version "0.27.8"
13851390
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
@@ -4568,6 +4573,11 @@ minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8:
45684573
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
45694574
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
45704575

4576+
mri@^1.1.0:
4577+
version "1.2.0"
4578+
resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
4579+
integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==
4580+
45714581
ms@2.1.2:
45724582
version "2.1.2"
45734583
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@@ -4831,6 +4841,13 @@ p-try@^2.0.0:
48314841
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
48324842
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
48334843

4844+
package-manager-detector@^0.2.9:
4845+
version "0.2.11"
4846+
resolved "https://registry.yarnpkg.com/package-manager-detector/-/package-manager-detector-0.2.11.tgz#3af0b34f99d86d24af0a0620603d2e1180d05c9c"
4847+
integrity sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==
4848+
dependencies:
4849+
quansync "^0.2.7"
4850+
48344851
parent-module@^1.0.0:
48354852
version "1.0.1"
48364853
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
@@ -4926,7 +4943,7 @@ picocolors@^1.0.0:
49264943
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
49274944
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
49284945

4929-
picocolors@^1.1.0:
4946+
picocolors@^1.1.0, picocolors@^1.1.1:
49304947
version "1.1.1"
49314948
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
49324949
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
@@ -5047,6 +5064,16 @@ psl@^1.1.33:
50475064
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
50485065
integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==
50495066

5067+
publint@^0.3.8:
5068+
version "0.3.9"
5069+
resolved "https://registry.yarnpkg.com/publint/-/publint-0.3.9.tgz#4d0bea2fa6caf6b20f6940a121111287c7264868"
5070+
integrity sha512-irTwfRfYW38vomkxxoiZQtFtUOQKpz5m0p9Z60z4xpXrl1KmvSrX1OMARvnnolB5usOXeNfvLj6d/W3rwXKfBQ==
5071+
dependencies:
5072+
"@publint/pack" "^0.1.2"
5073+
package-manager-detector "^0.2.9"
5074+
picocolors "^1.1.1"
5075+
sade "^1.8.1"
5076+
50505077
punycode@^2.1.0, punycode@^2.1.1:
50515078
version "2.1.1"
50525079
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
@@ -5062,6 +5089,11 @@ pure-rand@^6.0.0:
50625089
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7"
50635090
integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==
50645091

5092+
quansync@^0.2.7:
5093+
version "0.2.8"
5094+
resolved "https://registry.yarnpkg.com/quansync/-/quansync-0.2.8.tgz#2e893d17bb754ba0988ea399ff0bc5f2a8467793"
5095+
integrity sha512-4+saucphJMazjt7iOM27mbFCk+D9dd/zmgMDCzRZ8MEoBfYp7lAvoN38et/phRQF6wOPMy/OROBGgoWeSKyluA==
5096+
50655097
querystringify@^2.1.1:
50665098
version "2.2.0"
50675099
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
@@ -5304,6 +5336,13 @@ rxjs@^7.8.1:
53045336
dependencies:
53055337
tslib "^2.1.0"
53065338

5339+
sade@^1.8.1:
5340+
version "1.8.1"
5341+
resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701"
5342+
integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==
5343+
dependencies:
5344+
mri "^1.1.0"
5345+
53075346
safe-array-concat@^1.0.1:
53085347
version "1.0.1"
53095348
resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c"

0 commit comments

Comments
 (0)