Skip to content

Commit

Permalink
Establish the repository
Browse files Browse the repository at this point in the history
This commit sets up a Node.js project with Yarn as the package manager:

```shell
yarn init -2
```
  • Loading branch information
spdiswal committed Apr 4, 2023
0 parents commit e30e351
Show file tree
Hide file tree
Showing 16 changed files with 1,115 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Normalise some basic formatting settings across IDEs.
#
# Read more:
# https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true

# YAML does not support tabs for indentation.
[*.{yaml,yml}]
indent_size = 2
indent_style = space
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Normalise line endings in the repository and in the working directory.
#
# Read more:
# https://git-scm.com/docs/gitattributes
# https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

* text=auto eol=lf


# Exclude certain files from the language statistics in GitHub.
#
# Read more:
# https://github.com/github/linguist

/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Exclude certain files and directories from version control.
#
# Read more:
# https://git-scm.com/docs/gitignore
# https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# IntelliJ IDEA.
.idea/*
!.idea/runConfigurations/
!.idea/*.iml
!.idea/externalDependencies.xml
!.idea/modules.xml
!.idea/vcs.xml

# Visual Studio Code.
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/tasks.json

# AsciiDoctor.
.asciidoctor/
.asciidoctorconfig

# Local environment.
*.local
*.local.*

# Dependency management.
.yarn/*
!.yarn/cache/
!.yarn/patches/
!.yarn/plugins/
!.yarn/releases/
!.yarn/sdks/
!.yarn/versions/
node_modules/

# Operating system artifacts.
*~
.DS_Store
Thumbs.db
6 changes: 6 additions & 0 deletions .idea/externalDependencies.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/github-action-deploy-with-rsync-over-ssh.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"asciidoctor.asciidoctor-vscode"
],
"unwantedRecommendations": []
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"search.exclude": {
"**/.yarn": true,
"**/yarn.lock": true
}
}
3 changes: 3 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tasks": []
}
873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-3.5.0.cjs
101 changes: 101 additions & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
= Contribution Guidelines
:experimental:
:source-highlighter: highlight.js
:toc: preamble

Thank you for investing your time in contributing to our project!
If you are a first-time contributor to this project, please take a look at the <<get_started>> section 😀

CAUTION: All commands in this README document are to be executed from the project root directory (where this document resides).

[[get_started]]
== Get Started
This project uses the https://yarnpkg.com/features/zero-installs[zero-install feature] of the Yarn package manager.
Upon cloning the Git repository, the `.yarn/cache` directory already contains a cache of the third-party dependencies, effectively replacing the usual `node_modules` directory.

=== Install Node.js and Yarn
* *macOS* and *Linux* users should install https://nodejs.org/en[Node.js] via https://github.com/nvm-sh/nvm[Node Version Manager] and opt for https://yarnpkg.com/getting-started/install[Yarn] via https://nodejs.org/api/corepack.html[Corepack]:
+
[source,shell]
----
$ curl https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
$ source ~/.bashrc
$ nvm install --lts
$ corepack enable yarn
----

* *Windows* users should install https://nodejs.org/en[Node.js] via https://github.com/microsoft/winget-cli[Windows Package Manager] and install https://yarnpkg.com/getting-started/install[Yarn] via npm (which is actually a workaround until Corepack supports Windows):
+
[source,shell]
----
$ winget install OpenJS.NodeJS.LTS
$ npm install --global yarn
----

=== Prepare Git
. Generate an SSH key with the *Ed25519* algorithm, for example using https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent[ssh-keygen] or https://developer.1password.com/docs/ssh/manage-keys[1Password], and add it to the SSH agent on your computer.
If you already have an SSH key on your computer, you may skip this step.
+
[source,shell,subs="+quotes,+replacements"]
----
$ ssh-keygen -t ed25519 -f "$HOME/.ssh/**_<my-ssh-key>_**"
$ ssh-add ~/.ssh/<my-ssh-key>
----

* *Windows* users must instruct Git to use https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview[Microsoft OpenSSH] as the SSH agent:
+
[source,shell]
----
$ git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
----

. Grab the **_public_** key.
It appears like `ssh-ed25519 AAAAC3(...)`.
+
[source,shell,subs="+quotes,+replacements"]
----
$ cat ~/.ssh/**_<my-ssh-key>_**.pub
----

. Register the public key in https://github.com/settings/keys[GitHub] as a signing key.

. Obtain your noreply email address on https://github.com/settings/emails[GitHub].
It appears like `**_<id+username>_**@users.noreply.github.com`.

. Declare your identity within the scope of this repository and use the public key to sign your commits:
+
[source,shell,subs="+quotes,+replacements"]
----
$ git config user.name "**_<FirstName> <LastName>_**"
$ git config user.email "**_<id+username>_**@users.noreply.github.com"
$ git config user.signingkey "ssh-ed25519 AAAAC3**_<PublicKey>_**"
$ git config gpg.format "ssh"
$ git config commit.gpgsign "true"
$ git config tag.gpgsign "true"
----

=== Prepare Your IDE
* *IntelliJ IDEA* (and *WebStorm*) users should open the project directory:
+
[source,shell]
----
$ idea .
----

. Install these plugins (follow the popup message, or go to menu:File[Settings > Plugins]):
** https://plugins.jetbrains.com/plugin/7391-asciidoc[AsciiDoc]

. Go to menu:File[Settings > Languages & Frameworks > Node.js].
Select the appropriate Node.js interpreter and enable coding assistance.

* *Visual Studio Code* users should open the project directory:
+
[source,shell]
----
$ code .
----

. Install these extensions (kbd:[Ctrl+Shift+X] and search for `@recommended`):
+
** https://marketplace.visualstudio.com/items?itemName=asciidoctor.asciidoctor-vscode[AsciiDoc]
6 changes: 6 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
= Deploy with Rsync over SSH
:experimental:
:source-highlighter: highlight.js
:toc: preamble

This repository implements an Ubuntu-based composite GitHub Action that copies files from the GitHub Actions runner to a remote host using the https://manpages.ubuntu.com/manpages/bionic/man1/rsync.1.html[Rsync] tool over SSH.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"packageManager": "yarn@3.5.0",
"private": true
}
Empty file added yarn.lock
Empty file.

0 comments on commit e30e351

Please sign in to comment.