chore(release): releasing with latest updates (#11)

This commit is contained in:
mrugesh mohapatra
2018-06-13 19:19:37 +05:30
committed by GitHub
parent 4d8a91375d
commit a5399361ee
5 changed files with 1922 additions and 715 deletions

View File

@ -5,8 +5,27 @@ node_js:
cache:
directories:
- ~/.npm
- node_modules
notifications:
email:
on_success: change
on_failure: always
script:
- npm run lint
- npm run test
- npm run build
deploy:
provider: script
skip_cleanup: true
script:
- npx semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
sudo: false

View File

@ -1,10 +1,10 @@
## freeCodeCamp Curriculum
# freeCodeCamp Curriculum
[![Build Status](https://travis-ci.org/freeCodeCamp/curriculum.svg?branch=master)](https://travis-ci.org/freeCodeCamp/curriculum)
[![Build Status](https://travis-ci.org/freeCodeCamp/curriculum.svg?branch=master)](https://travis-ci.org/freeCodeCamp/curriculum) [![npm (scoped)](https://img.shields.io/npm/v/@freecodecamp/curriculum.svg)](https://www.npmjs.com/package/@freecodecamp/curriculum)
This package contains the "seed" files used in the freeCodeCamp Curriculum.
> This package contains the "seed" files used in the freeCodeCamp Curriculum.
### Installation
## Installation
```sh
npm i @freecodecamp/curriculum
@ -12,15 +12,17 @@ npm i @freecodecamp/curriculum
yarn add @freecodecamp/curriculum
```
### Usage
## Usage
```js
import { getChallenges } from '@freecodecamp/curriculum';
getChallenges() // will provide an array of blocks i.e. basic CSS, functional programming
// fetch an array of blocks
// i.e. basic CSS, functional programming, etc.
getChallenges()
```
#### `block` Structure
### `block` Structure
```js
{
@ -35,7 +37,7 @@ getChallenges() // will provide an array of blocks i.e. basic CSS, functional pr
}
```
#### `challenge` Structure
### `challenge` Structure
```js
{

2474
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,12 +6,12 @@
"homepage": "https://github.com/freeCodeCamp/curriculum#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/freeCodeCamp/curriculum.git"
"url": "https://github.com/freeCodeCamp/curriculum.git"
},
"bugs": {
"url": "https://github.com/freeCodeCamp/curriculum/issues"
},
"version": "1.1.1",
"version": "0.0.0-development",
"main": "dist/index.js",
"scripts": {
"build": "npm run build:js && npm run build:json",
@ -23,8 +23,8 @@
"format": "prettier --write es5 './**/*.{js,json}' && npm run lint",
"lint": "eslint ./**/*.js --fix",
"prepack": "npm run build",
"release": "np",
"repack": "babel-node ./repack.js",
"semantic-release": "semantic-release",
"test": "babel-node ./test-challenges.js | tap-spec",
"unpack": "babel-node ./unpack.js"
},
@ -70,10 +70,10 @@
"jquery": "^3.3.1",
"lint-staged": "^7.2.0",
"lodash": "^4.17.10",
"np": "*",
"prettier": "^1.13.5",
"prettier-package-json": "^1.6.0",
"rx": "^4.1.0",
"semantic-release": "^15.5.2",
"tap-spec": "^4.1.1",
"tape": "^4.9.0",
"validator": "^10.2.0"

View File

@ -1,6 +1,6 @@
/* eslint-disable no-eval, no-process-exit, no-unused-vars */
import {Observable} from 'rx';
import { Observable } from 'rx';
import tape from 'tape';
import getChallenges from './getChallenges';
@ -27,36 +27,27 @@ function evaluateTest(
test,
tapTest
) {
let code = solution;
/* NOTE: Provide dependencies for React/Redux challenges
* and configure testing environment
*/
let React,
ReactDOM,
Redux,
ReduxThunk,
ReactRedux,
Enzyme,
document;
let React, ReactDOM, Redux, ReduxThunk, ReactRedux, Enzyme, document;
// Fake Deep Equal dependency
const DeepEqual = (a, b) =>
JSON.stringify(a) === JSON.stringify(b);
const DeepEqual = (a, b) => JSON.stringify(a) === JSON.stringify(b);
// Hardcode Deep Freeze dependency
const DeepFreeze = (o) => {
const DeepFreeze = o => {
Object.freeze(o);
Object.getOwnPropertyNames(o).forEach(function(prop) {
if (o.hasOwnProperty(prop)
&& o[ prop ] !== null
&& (
typeof o[ prop ] === 'object' ||
typeof o[ prop ] === 'function'
)
&& !Object.isFrozen(o[ prop ])) {
DeepFreeze(o[ prop ]);
if (
o.hasOwnProperty(prop) &&
o[prop] !== null &&
(typeof o[prop] === 'object' || typeof o[prop] === 'function') &&
!Object.isFrozen(o[prop])
) {
DeepFreeze(o[prop]);
}
});
return o;
@ -76,7 +67,7 @@ function evaluateTest(
/* Transpile ALL the code
* (we may use JSX in head or tail or tests, too): */
const transform = require('babel-standalone').transform;
const options = { presets: [ 'es2015', 'react' ] };
const options = { presets: ['es2015', 'react'] };
head = transform(head, options).code;
solution = transform(solution, options).code;
@ -98,26 +89,17 @@ function evaluateTest(
document = window.document;
global.window = window;
global.document = window.document;
}
/* eslint-enable no-unused-vars */
try {
(() => {
return eval(
head + '\n' +
solution + '\n' +
tail + '\n' +
test.testString
head + '\n' + solution + '\n' + tail + '\n' + test.testString
);
})();
} catch (e) {
console.log(
head + '\n' +
solution + '\n' +
tail + '\n' +
test.testString
);
console.log(head + '\n' + solution + '\n' + tail + '\n' + test.testString);
console.log(e);
tapTest.fail(e);
process.exit(1);
@ -144,10 +126,12 @@ function createTest({
const isAsync = s => s.includes('(async () => ');
if (isAsync(tests.join(''))) {
console.log(`Replacing Async Tests for Challenge ${title}`);
tests = tests.map(challengeTestSource =>
isAsync(challengeTestSource) ?
"assert(true, 'message: great');" :
challengeTestSource);
tests = tests.map(
challengeTestSource =>
isAsync(challengeTestSource)
? "assert(true, 'message: great');"
: challengeTestSource
);
}
const { head, tail } = Object.keys(files)
.map(key => files[key])
@ -167,18 +151,19 @@ function createTest({
}
return Observable.fromCallback(tape)(title)
.doOnNext(tapTest =>
solutions.length ? tapTest.plan(plan) : tapTest.end())
.doOnNext(
tapTest => (solutions.length ? tapTest.plan(plan) : tapTest.end())
)
.flatMap(tapTest => {
if (solutions.length <= 0) {
tapTest.comment('No solutions for ' + title);
return Observable.just({
title,
type: 'missing'
});
}
return Observable.just(tapTest)
return (
Observable.just(tapTest)
.map(addAssertsToTapTest)
/* eslint-disable no-unused-vars */
// assert and code used within the eval
@ -199,7 +184,8 @@ function createTest({
});
});
})
.map(() => ({ title }));
.map(() => ({ title }))
);
});
}
@ -229,7 +215,7 @@ Observable.from(getChallenges())
.filter(title => !!title)
.toArray()
.subscribe(
(noSolutions) => {
noSolutions => {
if (noSolutions) {
console.log(
'# These challenges have no solutions\n- [ ] ' +