Skip to content

Commit

Permalink
docs: added documentation for all sections
Browse files Browse the repository at this point in the history
This is a major change in our guidelines, where now there are multiple sections, that include not
only a simple technology list, or project liting, but an extensive guide on the methodology for
contribution, the styling we use and more.
  • Loading branch information
alanrodas committed Feb 2, 2024
1 parent d967660 commit ffb0f34
Show file tree
Hide file tree
Showing 52 changed files with 2,325 additions and 815 deletions.
11 changes: 9 additions & 2 deletions .editorconfig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

# Use 2 spaces since npm does not respect custom indentation settings
[package.json]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/on-commit-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Installing project dependencies
run: npm install
- name: Building the site
run: npm run build
run: npm start build
env:
CI: true
- name: Setup Pages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-commit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: Installing project dependencies
run: npm install
- name: Test the code
run: npm test
run: npm start test
env:
CI: true
16 changes: 9 additions & 7 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/usr/bin/env sh

# Load husky
. "$(dirname -- "$0")/_/husky.sh";

# Read parameters
COMMIT_MSG_FILE=$1;

# Set failing on command fail, pipe fail, and undefined variable use
set -euo pipefail

# This hook is invoked by git-commit and git-merge, and can be
# bypassed with the --no-verify option. It takes a single
# parameter, the name of the file that holds the proposed commit
Expand All @@ -15,13 +24,6 @@
# The default commit-msg hook, when enabled, detects duplicate
# Signed-off-by trailers, and aborts the commit if one is found.

# Load husky
. "$(dirname -- "$0")/_/husky.sh";
npx --no -- commitlint --edit ${1};

# Read parameters
COMMIT_MSG_FILE=$1;

# We use this hook to run "commitlint", that verifies that the
# message sent has the correct format for the project, aborting otherwise.

Expand Down
52 changes: 52 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env sh

# Load husky
. "$(dirname -- "$0")/_/husky.sh";

# Read parameters
# NOTHING TO READ HERE

# Set failing on command fail, pipe fail, and undefined variable use
set -euo pipefail

# This hook is invoked by git-commit, and can be bypassed with the
# --no-verify option. It takes no parameters, and is invoked before
# obtaining the proposed commit log message and making a commit.
# Exiting with a non-zero status from this script causes the git
# commit command to abort before creating a commit.

# The default pre-commit hook, when enabled, catches introduction of
# lines with trailing whitespaces and aborts the commit when such a
# line is found.

# All the git commit hooks are invoked with the environment variable
# GIT_EDITOR=: if the command will not bring up an editor to modify
# the commit message.

# The default pre-commit hook, when enabled and with the hooks.allownonascii
# config option unset or set to false prevents the use of non-ASCII filenames.

# We currently use this hook to update the changelog of the project
# and make sure all files are prettified before sending them to the commit.
# Generated files are added to the commit.

# Show welcome message
echo "**************************";
echo "Running pre commit hooks";
echo "**************************";
echo "";

# Run prettify
echo "Run prettify\n";
npx --no -- gobstones-scripts run prettify --silent ;

# Run changelog
echo "\nRun changelog\n";
npx --no gobstones-scripts run changelog --silent ;

# Add all generated files
echo "\nAdd generated files to commit\n";
git add --all;

# Exit
exit 0;
32 changes: 14 additions & 18 deletions .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ REMOTE_NAME=$1;
REMOTE_URL=$2;
# Read the input and split it approprietly
INPUT=$(cat);
INPUT_ARR[0]='';
INPUT_ARR[1]='';
INPUT_ARR[2]='';
INPUT_ARR[3]='';
read -a INPUT_ARR <<< "$INPUT";
INPUT_ARR=($INPUT);

LOCAL_REF=${INPUT_ARR[0]}
LOCAL_OBJ_NAME=${INPUT_ARR[1]}
Expand All @@ -27,7 +23,7 @@ set -euo pipefail
# which provide the name and location of the destination remote,
# if a named remote is not being used both values will be the same.

# Information about what is to be pushed is provided on the hook`s
# Information about what is to be pushed is provided on the hooks
# standard input with lines of the form:
# <local ref> SP <local object name> SP <remote ref> SP <remote object name> LF

Expand All @@ -48,17 +44,6 @@ set -euo pipefail
# pushing anything. Information about why the push is rejected may be
# sent to the user by writing to standard error.

# If pushing a tag, generate doc and push them as
# a "docs" branch in the remote.
case "$LOCAL_REF" in
refs\/tags*)
# Apply specific code when publishing tags
IS_TAG=1;;
*)
# Apply specific code when publishing any branch
IS_TAG=0;;
esac

# We currently use this hook to verify that any commit (to any branch)
# passes the tests configured.
# If a tag is being pushed, then, we generate the documentation
Expand All @@ -75,6 +60,17 @@ echo "";

# Run all the tests
echo "Running tests";
npm run test;
npx --no -- gobstones-scripts run test --silent;

# If pushing a tag, generate doc and push them as
# a "docs" branch in the remote.
case "$LOCAL_REF" in
refs\/tags*)
# Apply specific code when publishing tags
echo "\nYour tag is being pushed...\n";;
*)
# Apply specific code when publishing any branch
echo "\nYour branch is being pushed...\n";;
esac

exit 0;
19 changes: 11 additions & 8 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/usr/bin/env sh

# Load husky
. "$(dirname -- "$0")/_/husky.sh";

# Read parameters
COMMIT_MSG_FILE=$1;
COMMIT_SOURCE=$2;
SHA1=$3;

# Set failing on command fail, pipe fail, and undefined variable use
set -euo pipefail

# This hook is invoked by git-commit right after preparing
# the default log message, and before the editor is started.

Expand All @@ -24,14 +35,6 @@
# The sample prepare-commit-msg hook that comes with Git removes
# the help message found in the commented portion of the commit template.

# Load husky
. "$(dirname -- "$0")/_/husky.sh";

# Read parameters
COMMIT_MSG_FILE=$1;
COMMIT_SOURCE=$2;
SHA1=$3;

# We use this hook to run "cz", that forces the build of a
# semantic commit message through a prompt.

Expand Down
25 changes: 25 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Editor and style files
.editorconfig
.prettierignore
.prettierrc
.eslintrc.js
.vscode/*
.github/*
.husky/*

# tests
test/*
jest.config.js
coverage

# docs
docs

# Building Configuration Files
webpack.config.js
rollup.config.js
tsconfig.json
package-scripts.js

# Additional documentation
TODO.md
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
strict-peer-dependencies=false
auto-install-peers=false
legacy-peer-deps=true
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"editorconfig.editorconfig",
"esbenp.prettier-vscode"
]
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run Dev (npm run dev)",
"request": "launch",
"runtimeArgs": ["run-script", "dev"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"type": "node"
},
{
"name": "Test (npm run test)",
"request": "launch",
"runtimeArgs": ["run-script", "test"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"type": "node"
}
]
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Node and npm configuration
"npm.autoDetect": "on",
"debug.node.autoAttach": "smart",
"files.exclude": {
"tsconfig.build.json": true
},
// Code style, regular and ESLint related
"files.trimTrailingWhitespace": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["typescript"],
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": false,
// CSpell
"cSpell.words": []
}
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# [0.1.0](https://github.com/gobstones/gobstones-guidelines/compare/v0.0.1...v0.1.0) (2024-02-02)


### Build System

* transform the guideline into a webpage ([83653ff](https://github.com/gobstones/gobstones-guidelines/commit/83653ffad470464d161885dfdd2d80427544b0ea))


### BREAKING CHANGES

* The whole project structure has changed.



# [0.1.0](https://github.com/gobstones/gobstones-guidelines/compare/v0.0.1...v0.1.0) (2024-02-02)


### Build System

* transform the guideline into a webpage ([83653ff](https://github.com/gobstones/gobstones-guidelines/commit/83653ffad470464d161885dfdd2d80427544b0ea))


### BREAKING CHANGES

* The whole project structure has changed.



# [0.1.0](https://github.com/gobstones/gobstones-guidelines/compare/v0.0.1...v0.1.0) (2024-02-02)


### Build System

* transform the guideline into a webpage ([83653ff](https://github.com/gobstones/gobstones-guidelines/commit/83653ffad470464d161885dfdd2d80427544b0ea))


### BREAKING CHANGES

* The whole project structure has changed.



## 0.0.1 (2022-10-26)



7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contibution Guidelines

Please, before contributing to this project, take a moment to read our [Contributions Guidelines](https://github.com/gobstones/gobstones-guidelines).

Also, be sure to understand that by contributing you agree to allow
the project owners to license your work under the terms of our
[License](https://github.com/gobstones/gobstones-guidelines/blob/main/LICENSE).
18 changes: 0 additions & 18 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const isCi = require('is-ci');

const markdownIt = require('markdown-it');
const markdownItAnchor = require('markdown-it-anchor');
const markdownItReplaceLink = require('markdown-it-replace-link');

const EleventySassPlugin = require('eleventy-sass');
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
Expand Down Expand Up @@ -43,23 +42,6 @@ module.exports = function (el) {
visuallyHiddenClass: 'hidden'
})
})
.use(markdownItReplaceLink, {
/*
replaceLink: function (link, env, token, htmlToken) {
if (link.match(/^(?!www\.|(?:http|ftp|mailto)s?:\/\/|[A-Za-z]:\\|\/\/).* /)) {
if (env.permalink.startsWith('/governance')) {
console.log(env);
console.log(token);
console.log(htmlToken);
}
const updated = `${pathPrefix}${link.startsWith('/') ? '' : '/'}${link}`;
// console.log(`Updating link: ${link} -> ${updated}`);
return link;
}
return link;
}
*/
})
);

/*
Expand Down

0 comments on commit ffb0f34

Please sign in to comment.