Skip to content

build(js): Migrate from yarn to npm #4252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
9b982a3
commit eslint config before migrating
schloerke Feb 3, 2025
43b4716
Remove outdated files
schloerke Feb 3, 2025
9dd81d2
Update eslint config file
schloerke Feb 3, 2025
e9702a3
Update some yarn to npm calls
schloerke Feb 3, 2025
6f5757e
Lint updates
schloerke Feb 3, 2025
b5b71b8
Update post css compilations
schloerke Feb 3, 2025
69d0960
Update many packages; Remove a few packages
schloerke Feb 3, 2025
28248ca
Build types
schloerke Feb 3, 2025
d87d459
Update deps
schloerke Jul 6, 2025
1fc6afb
Remove more yarn related items
schloerke Jul 6, 2025
ce3043a
Merge branch 'main' into yarn_to_npm
schloerke Jul 6, 2025
78125e6
Merge branch 'main' into yarn_to_npm
schloerke Aug 1, 2025
1da0469
Update .gitignore
schloerke Aug 1, 2025
c6b7004
Update config and build tool
schloerke Aug 1, 2025
60dcf67
Fix lints and build
schloerke Aug 1, 2025
2888cf9
Fix circular dep 1/4
schloerke Aug 1, 2025
6262d00
Fix circular dep 2/4
schloerke Aug 1, 2025
6c794c2
Fix circular dep 3/4
schloerke Aug 1, 2025
c2459a9
Remove circuler dep 4/4
schloerke Aug 1, 2025
a7fbe35
Fix build proc and build
schloerke Aug 1, 2025
df6e9ff
Build extras quickly
schloerke Aug 1, 2025
8861645
Fix sass warning about global functions not being available in future
schloerke Aug 1, 2025
c2967ff
Merge branch 'main' into yarn_to_npm
schloerke Aug 1, 2025
43e1f79
commas
schloerke Aug 1, 2025
1b3392e
use current version of nodejs
schloerke Aug 1, 2025
46fbd83
nuke and restore pakcage-lock.json
schloerke Aug 1, 2025
ad55d1c
Fix lint
schloerke Aug 1, 2025
1002238
Use `.x` versions
schloerke Aug 1, 2025
13d9e0a
Remove outdated jest POC integration
schloerke Aug 1, 2025
8e1dd0e
Remove unused packages
schloerke Aug 1, 2025
1877f34
Autoformat
schloerke Aug 1, 2025
5920ed9
Update .gitignore
schloerke Aug 1, 2025
98e7cd3
`npm run build` (GitHub Actions)
schloerke Aug 1, 2025
b5466f4
Gut `yarn` from readme
schloerke Aug 4, 2025
0a61585
Update iorangeslider install script
schloerke Aug 4, 2025
d35f935
Update updateStrftime.R
schloerke Aug 4, 2025
ff6a9d7
update jqueryui update script
schloerke Aug 4, 2025
695d4ce
Update jquery update script
schloerke Aug 4, 2025
422518c
Update bootstrap datepicker script
schloerke Aug 4, 2025
50c8dfd
Update README.md
schloerke Aug 4, 2025
d5e0027
Update README.md
schloerke Aug 4, 2025
b0daa00
`npm run build` (GitHub Actions)
schloerke Aug 4, 2025
3b5b031
Merge branch 'main' into yarn_to_npm
schloerke Aug 4, 2025
727cae8
Ignore sass cache keys
schloerke Aug 4, 2025
e0a868c
Install via npm before inspecting node_modules
schloerke Aug 4, 2025
35825d0
`postcss-preset-env` is a dev dep
schloerke Aug 4, 2025
39d6486
Apply suggestions from code review
schloerke Aug 4, 2025
67b8093
Use helper method made to remove circular dep
schloerke Aug 4, 2025
78a8142
`npm run build` (GitHub Actions)
schloerke Aug 4, 2025
3c94ad7
Remove browserslist
schloerke Aug 4, 2025
d853ed8
Remove module target and module includes. Bundle using module es2020
schloerke Aug 4, 2025
c42caad
Merge branch 'yarn_to_npm' of https://github.com/rstudio/shiny into y…
schloerke Aug 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@
^manualtests$
^\.github$

^\.yarn$
^\.vscode$
^\.madgerc$
^\.prettierrc\.yml$
^jest\.config\.js$
^package\.json$
^tsconfig\.json$
^yarn\.lock$
^package-lock\.json$
^node_modules$
^coverage$
^.ignore$
^\.browserslistrc$
^\.eslintrc\.yml$
^\.yarnrc\.yml$
^_dev$
8 changes: 0 additions & 8 deletions .browserslistrc

This file was deleted.

110 changes: 0 additions & 110 deletions .eslintrc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/shiny-workflows/routine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ echo "Updating package.json version to match DESCRIPTION Version"
Rscript ./tools/updatePackageJsonVersion.R
if [ -n "$(git status --porcelain package.json)" ]
then
echo "package.json has changed after running ./tools/updatePackageJsonVersion.R. Re-running 'yarn build'"
yarn build
echo "package.json has changed after running ./tools/updatePackageJsonVersion.R. Re-running 'npm run build'"
npm run build
git add ./inst package.json && git commit -m 'Sync package version (GitHub Actions)' || echo "No package version to commit"
else
echo "No package version difference detected; package.json is current."
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [main]
schedule:
- cron: '0 5 * * 1' # every monday
- cron: "0 5 * * 1" # every monday

name: Package checks

Expand All @@ -17,7 +17,5 @@ jobs:
uses: rstudio/shiny-workflows/.github/workflows/website.yaml@v1
routine:
uses: rstudio/shiny-workflows/.github/workflows/routine.yaml@v1
with:
node-version: "14.x"
R-CMD-check:
uses: rstudio/shiny-workflows/.github/workflows/R-CMD-check.yaml@v1
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@
shinyapps/
README.html
.*.Rnb.cached
tools/yarn-error.log
/_dev/
.sass_cache_keys

# TypeScript / yarn
# TypeScript
/node_modules/
.cache
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
coverage/
madge.svg


# GHA remotes installation
.github/r-depends.rds
.claude/settings.local.json
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"prettier.prettierPath": "./node_modules/prettier",
"typescript.enablePromptUseWorkspaceTsdk": true,
Expand Down
77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

29 changes: 0 additions & 29 deletions .yarn/plugins/@yarnpkg/plugin-outdated.cjs

This file was deleted.

783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.3.cjs

This file was deleted.

10 changes: 0 additions & 10 deletions .yarnrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion R/version_bs_date_picker.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Generated by tools/updateBootstrapDatepicker.R; do not edit by hand
version_bs_date_picker <- "1.9.0"
version_bs_date_picker <- "1.10.0"
108 changes: 108 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import prettier from "eslint-plugin-prettier";
import unicorn from "eslint-plugin-unicorn";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/*.d.ts"],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
prettier,
unicorn,
},

languageOptions: {
globals: {
...globals.browser,
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},

parser: tsParser,
ecmaVersion: 2021,
sourceType: "module",

parserOptions: {
project: ["./tsconfig.json"],
},
},

rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "error",
"default-case": ["error"],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double", "avoid-escape"],
semi: ["error", "always"],
"dot-location": ["error", "property"],
camelcase: ["off"],

"unicorn/filename-case": ["error", {
case: "camelCase",
}],

"@typescript-eslint/array-type": ["error", {
default: "array-simple",
readonly: "array-simple",
}],

"@typescript-eslint/consistent-indexed-object-style": ["error", "index-signature"],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-floating-promises": "error",

"@typescript-eslint/naming-convention": ["error", {
selector: "default",
format: ["camelCase"],
}, {
selector: "method",
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require",
}, {
selector: "method",
modifiers: ["protected"],
format: ["camelCase"],
leadingUnderscore: "require",
}, {
selector: "variable",
format: ["camelCase"],
trailingUnderscore: "forbid",
leadingUnderscore: "forbid",
}, {
selector: "parameter",
format: ["camelCase"],
trailingUnderscore: "allow",
leadingUnderscore: "forbid",
}, {
selector: ["enum", "enumMember"],
format: ["PascalCase"],
}, {
selector: "typeLike",
format: ["PascalCase"],

custom: {
regex: "(t|T)ype$",
match: false,
},
}],
},
}];
Loading
Loading