Skip to content

Commit 1874911

Browse files
committed
Add publint to CI
1 parent a8b8c03 commit 1874911

File tree

5 files changed

+51
-5
lines changed

5 files changed

+51
-5
lines changed

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

+6-2
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 --profile node16 --ignore-rules cjs-only-exports-default react-on-rails.tgz
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

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
react_on_rails (14.1.1)
4+
react_on_rails (14.2.0)
55
addressable
66
connection_pool
77
execjs (~> 2.5)

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "14.2.0",
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
"node": "./node_package/lib/ReactOnRails.node.js",
@@ -41,6 +42,7 @@
4142
"nps": "^5.9.3",
4243
"prettier": "^2.8.8",
4344
"prop-types": "^15.8.1",
45+
"publint": "^0.3.8",
4446
"react": "^19.0.0",
4547
"react-dom": "^19.0.0",
4648
"redux": "^4.2.1",

script/convert

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ 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": "[^"]*",}, "")
20+
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
21+
gsub_file_content("../package.json", /"publint": "[^"]*",/, "")
2122

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

yarn.lock

+40-1
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,11 @@
13471347
"@nodelib/fs.scandir" "2.1.3"
13481348
fastq "^1.6.0"
13491349

1350+
"@publint/pack@^0.1.2":
1351+
version "0.1.2"
1352+
resolved "https://registry.yarnpkg.com/@publint/pack/-/pack-0.1.2.tgz#1b9a9567423262093e4a73e77697b65bf622f8c9"
1353+
integrity sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==
1354+
13501355
"@sinclair/typebox@^0.27.8":
13511356
version "0.27.8"
13521357
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
@@ -4373,6 +4378,11 @@ minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8:
43734378
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
43744379
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
43754380

4381+
mri@^1.1.0:
4382+
version "1.2.0"
4383+
resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
4384+
integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==
4385+
43764386
43774387
version "2.1.2"
43784388
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@@ -4619,6 +4629,13 @@ p-try@^2.0.0:
46194629
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
46204630
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
46214631

4632+
package-manager-detector@^0.2.9:
4633+
version "0.2.11"
4634+
resolved "https://registry.yarnpkg.com/package-manager-detector/-/package-manager-detector-0.2.11.tgz#3af0b34f99d86d24af0a0620603d2e1180d05c9c"
4635+
integrity sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==
4636+
dependencies:
4637+
quansync "^0.2.7"
4638+
46224639
parent-module@^1.0.0:
46234640
version "1.0.1"
46244641
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
@@ -4702,7 +4719,7 @@ [email protected]:
47024719
dependencies:
47034720
through "~2.3"
47044721

4705-
picocolors@^1.0.0, picocolors@^1.1.0:
4722+
picocolors@^1.0.0, picocolors@^1.1.0, picocolors@^1.1.1:
47064723
version "1.1.1"
47074724
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
47084725
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
@@ -4809,6 +4826,16 @@ psl@^1.1.33:
48094826
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
48104827
integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==
48114828

4829+
publint@^0.3.8:
4830+
version "0.3.8"
4831+
resolved "https://registry.yarnpkg.com/publint/-/publint-0.3.8.tgz#32c40827f86dd6e56b16b1b91e6a0f29fc7d604b"
4832+
integrity sha512-qJyxCpQFf0j0uvlr7GizYZiQgAFgePbAVRV2uecAbNIXniDD/NMSNNBL8+DxLMMjhjgPuLJ3l2GbrB0F9MwvfA==
4833+
dependencies:
4834+
"@publint/pack" "^0.1.2"
4835+
package-manager-detector "^0.2.9"
4836+
picocolors "^1.1.1"
4837+
sade "^1.8.1"
4838+
48124839
punycode@^2.1.0, punycode@^2.1.1:
48134840
version "2.1.1"
48144841
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
@@ -4819,6 +4846,11 @@ pure-rand@^6.0.0:
48194846
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7"
48204847
integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==
48214848

4849+
quansync@^0.2.7:
4850+
version "0.2.8"
4851+
resolved "https://registry.yarnpkg.com/quansync/-/quansync-0.2.8.tgz#2e893d17bb754ba0988ea399ff0bc5f2a8467793"
4852+
integrity sha512-4+saucphJMazjt7iOM27mbFCk+D9dd/zmgMDCzRZ8MEoBfYp7lAvoN38et/phRQF6wOPMy/OROBGgoWeSKyluA==
4853+
48224854
querystringify@^2.1.1:
48234855
version "2.2.0"
48244856
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
@@ -5017,6 +5049,13 @@ rxjs@^7.8.1:
50175049
dependencies:
50185050
tslib "^2.1.0"
50195051

5052+
sade@^1.8.1:
5053+
version "1.8.1"
5054+
resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701"
5055+
integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==
5056+
dependencies:
5057+
mri "^1.1.0"
5058+
50205059
safe-array-concat@^1.0.1:
50215060
version "1.0.1"
50225061
resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c"

0 commit comments

Comments
 (0)