Skip to content
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

Update Yarn and Node #152

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
Copy link
Collaborator Author

@scinos scinos Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yarn does this automatically when migrating from Yarn 1.x. I think this is meant to be used by GitHub for language statistics (https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github)

/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
68 changes: 61 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Created by https://www.toptal.com/developers/gitignore/api/yarn,node
# Edit at https://www.toptal.com/developers/gitignore?templates=yarn,node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -41,8 +46,8 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
Expand All @@ -53,6 +58,9 @@ typings/
# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
Expand All @@ -68,29 +76,40 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

Expand All @@ -103,5 +122,40 @@ dist
# TernJS port file
.tern-port

# IDEs
.idea
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# SvelteKit build / generate output
.svelte-kit

### yarn ###
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

.yarn/*
!.yarn/releases
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# if you are NOT using Zero-installs, then:
# comment the following lines
# !.yarn/cache

# and uncomment the following lines
.pnp.*

# End of https://www.toptal.com/developers/gitignore/api/yarn,node
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.10.0
2 changes: 0 additions & 2 deletions .tool-versions

This file was deleted.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules
nmMode: hardlinks-local
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,17 @@ no_card: false
now: 2023-07-06T00:30:05+0300
debug_level: 0
```


## Development

### Prepare the environment

1. Install [`nvm`](https://github.com/nvm-sh/nvm) and run `nvm install && nvm use` to use the right Node.js version
2. Enable [corepack](https://github.com/nodejs/corepack). Run `corepack enable`
3. Install dependencies, run `yarn install`


### Build the project

Run `yarn build`
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "lovelace-horizon-card",
"version": "1.1.0",
"packageManager": "yarn@4.5.1",
"description": "Successor to Sun Card - Visualize the position of the sun over the horizon",
"type": "commonjs",
"main": "dist/index.js",
"scripts": {
"dev": "rollup -c rollup.config.dev.mjs --watch",
"build": "rimraf dist && yarn lint && yarn rollup",
"build": "rm -fr dist && yarn lint && yarn rollup",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modern yarn has its own shell, to guarantee that things like rm -fr works the same across all platforms, including Windows.

"lint": "eslint src tests",
"rollup": "rollup -c",
"test": "jest"
Expand Down Expand Up @@ -54,9 +55,9 @@
"suncalc3": "link:suncalc3"
},
"resolutions": {
"@formatjs/intl-utils": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.2.1.tgz"
"@formatjs/intl-utils": "npm:empty-npm-package@1.0.0"
},
"resolutionsComments": {
"@formatjs/intl-utils": "Outdated, producing a warning at build, unused by us, brought by custom-card-helpers => skip it"
"@formatjs/intl-utils": "Outdated, producing a warning at build (https://rollupjs.org/troubleshooting/#error-this-is-undefined), unused by us, brought by custom-card-helpers => skip it"
}
}
Loading
Loading