Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Add scaffolder for JS (#1901)
Browse files Browse the repository at this point in the history
  • Loading branch information
rishiosaur authored Jul 10, 2020
1 parent 3b2f3cd commit 2399c62
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 0 deletions.
17 changes: 17 additions & 0 deletions languages/javascript/scripts/scaffold/scaffold.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

echo "Scaffolding '$1'"

cp -r ./template ../../exercises/concept/$1

echo "Template '$1' created for JS."
cd ../../exercises/concept/$1

sed -i '' "s/---/$1/g" *

mv concept-name.js $1.js
mv concept-name.spec.js $1.js

echo "Final directory:" && ls

echo "Remember to fill out all details in every file!"
5 changes: 5 additions & 0 deletions languages/javascript/scripts/scaffold/template/.docs/after.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
This is the markdown file with the instructions for students to take after completing the challenge.
See https://github.com/exercism/v3/blob/master/docs/concept-exercises.md#docsaftermd
-->
5 changes: 5 additions & 0 deletions languages/javascript/scripts/scaffold/template/.docs/hints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
This is the markdown file with the hints for students to use while completing this concept challenge.
See https://github.com/exercism/v3/blob/master/docs/concept-exercises.md#docshintsmd
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
This is the markdown file with the instructions on how to complete the exercise.
See https://github.com/exercism/v3/blob/master/docs/concept-exercises.md#docsinstructionsmd
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
This is the markdown file with the introduction to the concept and exercise.
See https://github.com/exercism/v3/blob/master/docs/concept-exercises.md#docsintroductionmd
-->
26 changes: 26 additions & 0 deletions languages/javascript/scripts/scaffold/template/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"root": true,
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
},
"env": {
"es6": true,
"node": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"rules": {
"linebreak-style": "off",

"import/extensions": "off",
"import/no-default-export": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off"
}
}
3 changes: 3 additions & 0 deletions languages/javascript/scripts/scaffold/template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
yarn-error.log

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"authors": [
{
"github_username": "username",
"exercism_username": "username"
}
],
"forked_from": []
}
14 changes: 14 additions & 0 deletions languages/javascript/scripts/scaffold/template/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: [
[
'@babel/env',
{
targets: {
node: 'current',
},
useBuiltIns: true,
},

],
],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
This is the stub implementation file, which is the starting point for students to work on the exercise.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
This is the exercise's test suite.
*/
3 changes: 3 additions & 0 deletions languages/javascript/scripts/scaffold/template/example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
This is an example implementation that passes all the tests.
*/
37 changes: 37 additions & 0 deletions languages/javascript/scripts/scaffold/template/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@exercism/---",
"description": "description",
"author": "author",
"version": "1.0.0",
"license": "MIT",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/exercism/v3.git",
"directory": "languages/javascript/exercises/concept/---"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@types/jest": "^25.2.2",
"@types/node": "^14.0.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.0.1",
"eslint": "^7.0.0",
"eslint-plugin-import": "^2.20.2",
"jest": "^26.0.1"
},
"dependencies": {},
"jest": {
"modulePathIgnorePatterns": [
"package.json"
]
},
"scripts": {
"test": "jest --no-cache ./*",
"watch": "jest --no-cache --watch ./*",
"lint": "eslint .",
"lint-test": "eslint . && jest --no-cache ./* "
}
}

0 comments on commit 2399c62

Please sign in to comment.