diff --git a/.eslintignore b/.eslintignore index c3ce2733c73a..f80a26aab2f5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,6 +8,5 @@ types/** website/build website/node_modules website/core/metadata*.js -website/i18n/*.js website/src/jest/docs website/src/jest/blog diff --git a/.gitignore b/.gitignore index 9c202d2dfe60..28fc80eb45c5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,13 +4,10 @@ *~ /danger/node_modules/ /examples/*/node_modules/ - /integration_tests/*/node_modules /integration_tests/transform/*/coverage /integration_tests/transform/*/node_modules - /node_modules - /packages/*/build/ /packages/*/coverage/ /packages/*/node_modules/ @@ -20,47 +17,6 @@ /website/src/jest/blog /website/src/jest/docs /website/yarn.lock - -/website/i18n/* -!/website/i18n/en.json - -/website/af -/website/ar -/website/ca -/website/cs -/website/da -/website/de -/website/el -/website/es-ES -/website/fa-IR -/website/fi -/website/fr -/website/he -/website/hu -/website/id-ID -/website/it -/website/ja -/website/ko -/website/mr-IN -/website/nl -/website/no-NO -/website/pl -/website/pt-BR -/website/pt-PT -/website/ro -/website/ru -/website/sk-SK -/website/sr -/website/sv-SE -/website/tr -/website/uk -/website/vi -/website/zh-Hans -/website/zh-Hant - -/docs/* -!/docs/en - coverage lerna-debug.log npm-debug.log diff --git a/README.md b/README.md index c69db4141edd..a2721e34304e 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,8 @@ test('adds 1 + 2 to equal 3', () => { Add the following section to your `package.json`: ```json -{ - "scripts": { - "test": "jest" - } +"scripts": { + "test": "jest" } ``` diff --git a/circle.yml b/circle.yml index 7ca8fdbb1071..d23724c66cd1 100644 --- a/circle.yml +++ b/circle.yml @@ -42,11 +42,4 @@ deployment: - git config --global user.email "jest-bot@users.noreply.github.com" - git config --global user.name "Website Deployment Script" - echo "machine github.com login jest-bot password $GITHUB_TOKEN" > ~/.netrc - # WEBSITE DEPLOY - - sudo apt-get install default-jre - - wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb - - sudo dpkg -i crowdin.deb - # crowdin install end - - crowdin --config crowdin.yaml upload sources --auto-update -b master - - crowdin --config crowdin.yaml download -b master - cd website && GIT_USER=jest-bot npm run gh-pages diff --git a/crowdin.yaml b/crowdin.yaml deleted file mode 100644 index e04e9fe00a0b..000000000000 --- a/crowdin.yaml +++ /dev/null @@ -1,48 +0,0 @@ -project_identifier_env: CROWDIN_PROJECT_ID -api_key_env: CROWDIN_API_KEY -base_path: "./" - -files: - - - source: '/docs/en/*.md' - translation: '/docs/%locale%/%original_file_name%' - languages_mapping: &anchor - locale: - 'af': 'af' - 'ar': 'ar' - 'bs-BA': 'bs-BA' - 'ca': 'ca' - 'cs': 'cs' - 'da': 'da' - 'de': 'de' - 'el': 'el' - 'es-ES': 'es-ES' - 'fa': 'fa-IR' - 'fi': 'fi' - 'fr': 'fr' - 'he': 'he' - 'hu': 'hu' - 'id': 'id-ID' - 'it': 'it' - 'ja': 'ja' - 'ko': 'ko' - 'mr': 'mr-IN' - 'nl': 'nl' - 'no': 'no-NO' - 'pl': 'pl' - 'pt-BR': 'pt-BR' - 'pt-PT': 'pt-PT' - 'ro': 'ro' - 'ru': 'ru' - 'sk': 'sk-SK' - 'sr': 'sr' - 'sv-SE': 'sv-SE' - 'tr': 'tr' - 'uk': 'uk' - 'vi': 'vi' - 'zh-CN': 'zh-Hans' - 'zh-TW': 'zh-Hant' - - - source: '/website/i18n/en.json' - translation: '/website/i18n/%locale%.json' - languages_mapping: *anchor diff --git a/docs/en/CLI.md b/docs/CLI.md similarity index 99% rename from docs/en/CLI.md rename to docs/CLI.md index ac04bcf3a26d..802c4ef85138 100644 --- a/docs/en/CLI.md +++ b/docs/CLI.md @@ -1,9 +1,9 @@ --- id: cli title: Jest CLI Options -layout: docs +layout: reference category: API Reference -permalink: docs/en/cli.html +permalink: docs/cli.html previous: configuration --- diff --git a/docs/en/Configuration.md b/docs/Configuration.md similarity index 99% rename from docs/en/Configuration.md rename to docs/Configuration.md index 5db743a1782f..c4a4ab2f2b43 100644 --- a/docs/en/Configuration.md +++ b/docs/Configuration.md @@ -1,9 +1,9 @@ --- id: configuration title: Configuring package.json -layout: docs +layout: reference category: API Reference -permalink: docs/en/configuration.html +permalink: docs/configuration.html previous: jest-object next: cli --- diff --git a/docs/en/ExpectAPI.md b/docs/ExpectAPI.md similarity index 99% rename from docs/en/ExpectAPI.md rename to docs/ExpectAPI.md index af6605c9b237..aa7b28b4809c 100644 --- a/docs/en/ExpectAPI.md +++ b/docs/ExpectAPI.md @@ -1,9 +1,9 @@ --- id: expect title: Expect -layout: docs +layout: reference category: API Reference -permalink: docs/en/expect.html +permalink: docs/expect.html previous: api next: mock-function-api --- diff --git a/docs/en/GettingStarted.md b/docs/GettingStarted.md similarity index 98% rename from docs/en/GettingStarted.md rename to docs/GettingStarted.md index 5c17474e764e..8b246a3f219b 100644 --- a/docs/en/GettingStarted.md +++ b/docs/GettingStarted.md @@ -3,7 +3,7 @@ id: getting-started title: Getting Started layout: docs category: Introduction -permalink: docs/en/getting-started.html +permalink: docs/getting-started.html next: using-matchers --- diff --git a/docs/en/GlobalAPI.md b/docs/GlobalAPI.md similarity index 99% rename from docs/en/GlobalAPI.md rename to docs/GlobalAPI.md index dfd8ea06db75..b8c29d910a11 100644 --- a/docs/en/GlobalAPI.md +++ b/docs/GlobalAPI.md @@ -1,9 +1,9 @@ --- id: api title: Globals -layout: docs +layout: reference category: API Reference -permalink: docs/en/api.html +permalink: docs/api.html next: expect --- diff --git a/docs/en/JestObjectAPI.md b/docs/JestObjectAPI.md similarity index 99% rename from docs/en/JestObjectAPI.md rename to docs/JestObjectAPI.md index 36fc10ff1ab3..91e8d29d568c 100644 --- a/docs/en/JestObjectAPI.md +++ b/docs/JestObjectAPI.md @@ -1,9 +1,9 @@ --- id: jest-object title: The Jest Object -layout: docs +layout: reference category: API Reference -permalink: docs/en/jest-object.html +permalink: docs/jest-object.html previous: mock-function-api next: configuration --- diff --git a/docs/en/ManualMocks.md b/docs/ManualMocks.md similarity index 99% rename from docs/en/ManualMocks.md rename to docs/ManualMocks.md index ffd06ad6daf4..8c132d9fae62 100644 --- a/docs/en/ManualMocks.md +++ b/docs/ManualMocks.md @@ -3,7 +3,7 @@ id: manual-mocks title: Manual Mocks layout: docs category: Guides -permalink: docs/en/manual-mocks.html +permalink: docs/manual-mocks.html previous: timer-mocks next: webpack --- diff --git a/docs/en/MigrationGuide.md b/docs/MigrationGuide.md similarity index 96% rename from docs/en/MigrationGuide.md rename to docs/MigrationGuide.md index 8bfb7fd9de00..92cdb5db7047 100644 --- a/docs/en/MigrationGuide.md +++ b/docs/MigrationGuide.md @@ -3,7 +3,7 @@ id: migration-guide title: Migrating to Jest layout: docs category: Guides -permalink: docs/en/migration-guide.html +permalink: docs/migration-guide.html previous: webpack next: testing-frameworks --- @@ -30,4 +30,4 @@ To transform your existing tests, navigate to the project containing the tests a jest-codemods ``` -More information can be found at https://github.com/skovhus/jest-codemods. \ No newline at end of file +More information can be found at https://github.com/skovhus/jest-codemods. diff --git a/docs/en/MockFunctionAPI.md b/docs/MockFunctionAPI.md similarity index 98% rename from docs/en/MockFunctionAPI.md rename to docs/MockFunctionAPI.md index be3adbefbbc7..08f7dac3596f 100644 --- a/docs/en/MockFunctionAPI.md +++ b/docs/MockFunctionAPI.md @@ -1,9 +1,9 @@ --- id: mock-function-api title: Mock Functions -layout: docs +layout: reference category: API Reference -permalink: docs/en/mock-function-api.html +permalink: docs/mock-function-api.html previous: expect next: jest-object --- diff --git a/docs/en/MockFunctions.md b/docs/MockFunctions.md similarity index 99% rename from docs/en/MockFunctions.md rename to docs/MockFunctions.md index ab95f0f13733..2d6c34bab8c3 100644 --- a/docs/en/MockFunctions.md +++ b/docs/MockFunctions.md @@ -3,7 +3,7 @@ id: mock-functions title: Mock Functions layout: docs category: Introduction -permalink: docs/en/mock-functions.html +permalink: docs/mock-functions.html previous: setup-teardown next: more-resources --- diff --git a/docs/en/MoreResources.md b/docs/MoreResources.md similarity index 97% rename from docs/en/MoreResources.md rename to docs/MoreResources.md index c6ae3a0ecccb..f416fd68d8f0 100644 --- a/docs/en/MoreResources.md +++ b/docs/MoreResources.md @@ -3,7 +3,7 @@ id: more-resources title: More Resources layout: docs category: Introduction -permalink: docs/en/more-resources.html +permalink: docs/more-resources.html previous: mock-functions next: snapshot-testing --- diff --git a/docs/en/SetupAndTeardown.md b/docs/SetupAndTeardown.md similarity index 99% rename from docs/en/SetupAndTeardown.md rename to docs/SetupAndTeardown.md index 27fe603def40..847b6aacab0f 100644 --- a/docs/en/SetupAndTeardown.md +++ b/docs/SetupAndTeardown.md @@ -3,7 +3,7 @@ id: setup-teardown title: Setup and Teardown layout: docs category: Introduction -permalink: docs/en/setup-teardown.html +permalink: docs/setup-teardown.html previous: asynchronous next: mock-functions --- diff --git a/docs/en/SnapshotTesting.md b/docs/SnapshotTesting.md similarity index 99% rename from docs/en/SnapshotTesting.md rename to docs/SnapshotTesting.md index 6a6deba7362f..2f69a74eb101 100644 --- a/docs/en/SnapshotTesting.md +++ b/docs/SnapshotTesting.md @@ -3,7 +3,7 @@ id: snapshot-testing title: Snapshot Testing layout: docs category: Guides -permalink: docs/en/snapshot-testing.html +permalink: docs/snapshot-testing.html next: tutorial-react --- diff --git a/docs/en/TestingAsyncCode.md b/docs/TestingAsyncCode.md similarity index 99% rename from docs/en/TestingAsyncCode.md rename to docs/TestingAsyncCode.md index afc686c6f809..574c9f352938 100644 --- a/docs/en/TestingAsyncCode.md +++ b/docs/TestingAsyncCode.md @@ -3,7 +3,7 @@ id: asynchronous title: Testing Asynchronous Code layout: docs category: Introduction -permalink: docs/en/asynchronous.html +permalink: docs/asynchronous.html previous: using-matchers next: setup-teardown --- diff --git a/docs/en/TestingFrameworks.md b/docs/TestingFrameworks.md similarity index 100% rename from docs/en/TestingFrameworks.md rename to docs/TestingFrameworks.md diff --git a/docs/en/TimerMocks.md b/docs/TimerMocks.md similarity index 99% rename from docs/en/TimerMocks.md rename to docs/TimerMocks.md index fcd37b9c1add..0a2503fdf8c7 100644 --- a/docs/en/TimerMocks.md +++ b/docs/TimerMocks.md @@ -3,7 +3,7 @@ id: timer-mocks title: Timer Mocks layout: docs category: Guides -permalink: docs/en/timer-mocks.html +permalink: docs/timer-mocks.html previous: tutorial-async next: manual-mocks --- diff --git a/docs/en/Troubleshooting.md b/docs/Troubleshooting.md similarity index 99% rename from docs/en/Troubleshooting.md rename to docs/Troubleshooting.md index 272f5c50e345..2a1f9e06120c 100644 --- a/docs/en/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -3,10 +3,8 @@ id: troubleshooting title: Troubleshooting layout: docs category: Guides -permalink: docs/en/troubleshooting.html +permalink: docs/troubleshooting.html previous: testing-frameworks -next: api - --- Uh oh, something went wrong? Use this guide to resolve issues with Jest. diff --git a/docs/en/TutorialAsync.md b/docs/TutorialAsync.md similarity index 99% rename from docs/en/TutorialAsync.md rename to docs/TutorialAsync.md index 624b16663dd2..b491a46f984d 100644 --- a/docs/en/TutorialAsync.md +++ b/docs/TutorialAsync.md @@ -3,7 +3,7 @@ id: tutorial-async title: An Async Example layout: docs category: Guides -permalink: docs/en/tutorial-async.html +permalink: docs/tutorial-async.html previous: tutorial-react-native next: timer-mocks --- diff --git a/docs/en/TutorialReact.md b/docs/TutorialReact.md similarity index 99% rename from docs/en/TutorialReact.md rename to docs/TutorialReact.md index ff5f26ed23b3..4f09951f3fc0 100644 --- a/docs/en/TutorialReact.md +++ b/docs/TutorialReact.md @@ -3,7 +3,7 @@ id: tutorial-react title: Testing React Apps layout: docs category: Guides -permalink: docs/en/tutorial-react.html +permalink: docs/tutorial-react.html previous: snapshot-testing next: tutorial-react-native --- diff --git a/docs/en/TutorialReactNative.md b/docs/TutorialReactNative.md similarity index 99% rename from docs/en/TutorialReactNative.md rename to docs/TutorialReactNative.md index 271b9357e62a..b625613a6ff7 100644 --- a/docs/en/TutorialReactNative.md +++ b/docs/TutorialReactNative.md @@ -3,7 +3,7 @@ id: tutorial-react-native title: Testing React Native Apps layout: docs category: Guides -permalink: docs/en/tutorial-react-native.html +permalink: docs/tutorial-react-native.html previous: tutorial-react next: tutorial-async --- diff --git a/docs/en/TutorialWebpack.md b/docs/TutorialWebpack.md similarity index 68% rename from docs/en/TutorialWebpack.md rename to docs/TutorialWebpack.md index cea3d96ca494..d2805bd1a0bf 100644 --- a/docs/en/TutorialWebpack.md +++ b/docs/TutorialWebpack.md @@ -2,6 +2,6 @@ id: tutorial-webpack title: webpack layout: redirect -permalink: docs/en/tutorial-webpack.html +permalink: docs/tutorial-webpack.html destinationUrl: webpack.html --- diff --git a/docs/en/TutorialjQuery.md b/docs/TutorialjQuery.md similarity index 98% rename from docs/en/TutorialjQuery.md rename to docs/TutorialjQuery.md index baacdcfe7dec..72df88a745ac 100644 --- a/docs/en/TutorialjQuery.md +++ b/docs/TutorialjQuery.md @@ -3,7 +3,7 @@ id: tutorial-jquery title: DOM Manipulation layout: docs category: Guides -permalink: docs/en/tutorial-jquery.html +permalink: docs/tutorial-jquery.html next: mock-functions --- diff --git a/docs/en/UsingMatchers.md b/docs/UsingMatchers.md similarity index 99% rename from docs/en/UsingMatchers.md rename to docs/UsingMatchers.md index 90b07fa9ffce..363ccb61455d 100644 --- a/docs/en/UsingMatchers.md +++ b/docs/UsingMatchers.md @@ -3,7 +3,7 @@ id: using-matchers title: Using Matchers layout: docs category: Introduction -permalink: docs/en/using-matchers.html +permalink: docs/using-matchers.html previous: getting-started next: asynchronous --- diff --git a/docs/en/Webpack.md b/docs/Webpack.md similarity index 99% rename from docs/en/Webpack.md rename to docs/Webpack.md index fba8df33ef56..0d5093fefc11 100644 --- a/docs/en/Webpack.md +++ b/docs/Webpack.md @@ -3,7 +3,7 @@ id: webpack title: Using with webpack layout: docs category: Guides -permalink: docs/en/webpack.html +permalink: docs/webpack.html previous: manual-mocks next: migration-guide --- diff --git a/website/core/BlogPost.js b/website/core/BlogPost.js index 4334b16954ea..53be4f17782f 100644 --- a/website/core/BlogPost.js +++ b/website/core/BlogPost.js @@ -5,7 +5,7 @@ * @jsx React.DOM */ -/* eslint-disable sort-keys */ + /* eslint-disable sort-keys */ const Marked = require('Marked'); const React = require('React'); @@ -20,9 +20,8 @@ class BlogPost extends React.Component {
{content}
- - Read More - + Read More
); @@ -36,13 +35,7 @@ class BlogPost extends React.Component { return (
- +
); @@ -66,24 +59,13 @@ class BlogPost extends React.Component { // Because JavaScript sucks at date handling :( const year = match[1]; const month = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December', + 'January', 'February', 'March', 'April', 'May', 'June', 'July', + 'August', 'September', 'October', 'November', 'December', ][parseInt(match[2], 10) - 1]; const day = parseInt(match[3], 10); - const githubButton = this.props.truncate - ? null - :

{siteConfig.githubButton}

; + const githubButton = this.props.truncate ? null : +

{siteConfig.githubButton}

; return (
diff --git a/website/core/BlogSidebar.js b/website/core/BlogSidebar.js index 15e58b6dbad8..5818f24d7b23 100644 --- a/website/core/BlogSidebar.js +++ b/website/core/BlogSidebar.js @@ -26,7 +26,6 @@ const BlogSidebar = React.createClass({ return ( - Edit this Doc - - ); - if (this.props.language != 'en') { - editLink = ( - - Translate this Doc - - ); - } - return (
- {editLink} + Edit this Doc

{this.props.title}

diff --git a/website/core/DocsSidebar.js b/website/core/DocsSidebar.js index fff7619fa490..7581c67fe7ff 100644 --- a/website/core/DocsSidebar.js +++ b/website/core/DocsSidebar.js @@ -5,7 +5,8 @@ * @jsx React.DOM */ -/* eslint-disable sort-keys */ + /* eslint-disable sort-keys */ + const Metadata = require('Metadata'); const React = require('React'); @@ -13,10 +14,9 @@ const Container = require('Container'); const SideNav = require('SideNav'); class DocsSidebar extends React.Component { - getCategories(language) { + getCategories() { const metadatas = Metadata.files.filter(metadata => { - return metadata.layout === this.props.layout && - metadata.language === language; + return metadata.layout === this.props.layout; }); // Build a hashmap of article_id -> metadata @@ -33,7 +33,11 @@ class DocsSidebar extends React.Component { if (metadata.next) { if (!articles[metadata.next]) { throw new Error( - '`next: ' + metadata.next + '` in ' + metadata.id + " doesn't exist" + '`next: ' + + metadata.next + + '` in ' + + metadata.id + + ' doesn\'t exist' ); } previous[articles[metadata.next].id] = metadata.id; @@ -75,10 +79,9 @@ class DocsSidebar extends React.Component { return ( @@ -94,7 +97,7 @@ DocsSidebar.propTypes = { DocsSidebar.defaultProps = { layout: 'docs', - root: '/jest/docs/en/getting-started.html', + root: '/jest/docs/getting-started.html', title: 'Docs', }; diff --git a/website/core/Footer.js b/website/core/Footer.js index 79275fccc3ff..4f98f728bbd0 100644 --- a/website/core/Footer.js +++ b/website/core/Footer.js @@ -8,54 +8,25 @@ const siteConfig = require('../siteConfig.js'); class Footer extends React.Component { render() { - const currentYear = new Date().getFullYear(); + const currentYear = (new Date()).getFullYear(); return (