Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace nunjucks and components #1458

Merged
merged 6 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion app/assets/scss/app-ie8.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import "../../../src/all-ie8";
@import "../../../src/govuk/all-ie8";
@import "partials/app";
@import "partials/banner";
2 changes: 1 addition & 1 deletion app/assets/scss/app.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$govuk-show-breakpoints: true;

@import "../../../src/all";
@import "../../../src/govuk/all";
@import "partials/app";
@import "partials/banner";
@import "partials/prose";
2 changes: 1 addition & 1 deletion app/views/macros/loadComponentTemplate.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% macro loadComponentTemplate(componentName, params) %}
{%- include "../../../src/components/" + componentName + "/template.njk" -%}
{%- include componentName + "/template.njk" -%}
{% endmacro %}
4 changes: 2 additions & 2 deletions config/paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"package": "package/",
"public": "public/",
"sassdoc": "sassdoc/",
"src": "src/",
"components": "src/components/",
"src": "src/govuk/",
"components": "src/govuk/components/",
"ports": {
"app": 3000,
"test": 8888
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"ignore": [
"/dist/**/*.js",
"/package/**/*.js",
"/src/vendor/polyfills/**/*.js"
"/src/govuk/vendor/polyfills/**/*.js"
]
},
"jest": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/all.test.js → src/govuk/all.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env jest */

const configPaths = require('../config/paths.json')
const configPaths = require('../../config/paths.json')
const PORT = configPaths.ports.test

const { renderSass } = require('../lib/jest-helpers')
const { renderSass } = require('../../lib/jest-helpers')

let baseUrl = 'http://localhost:' + PORT

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// const devices = require('puppeteer/DeviceDescriptors')
// const iPhone = devices['iPhone 6']
// const iPad = devices['iPad landscape']
const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test

let baseUrl = 'http://localhost:' + PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const { axe } = require('jest-axe')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('accordion')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env jest */

const { allComponents } = require('../../lib/file-helper')
const { renderSass } = require('../../lib/jest-helpers')
const { allComponents } = require('../../../lib/file-helper')
const { renderSass } = require('../../../lib/jest-helpers')

const configPaths = require('../../config/paths.json')
const configPaths = require('../../../config/paths.json')

// We can't use the render function from jest-helpers, because we need control
// over the nunjucks environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const { render, getExamples } = require('../../../lib/jest-helpers')
const axe = require('../../../../lib/axe-helper')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('back-link')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('breadcrumbs')

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env jest */

const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test

let baseUrl = 'http://localhost:' + PORT
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('button')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env jest */

const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test
const baseUrl = `http://localhost:${PORT}`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const { axe } = require('jest-axe')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('textarea')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const cheerio = require('cheerio')

const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test

let baseUrl = 'http://localhost:' + PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('checkboxes')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('date-input')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env jest */

const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test

let baseUrl = 'http://localhost:' + PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('details')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('error-message')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env jest */

const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test

let baseUrl = 'http://localhost:' + PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('error-summary')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('fieldset')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('file-upload')

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('footer')

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const devices = require('puppeteer/DeviceDescriptors')
const iPhone = devices['iPhone 6']
const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test

let baseUrl = 'http://localhost:' + PORT
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('header')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('hint')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('input')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('inset-text')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('label')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('panel')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('phase-banner')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const cheerio = require('cheerio')

const configPaths = require('../../../config/paths.json')
const configPaths = require('../../../../config/paths.json')
const PORT = configPaths.ports.test

let baseUrl = 'http://localhost:' + PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('radios')

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
const { render, getExamples, htmlWithClassName } = require('../../../../lib/jest-helpers')

const examples = getExamples('select')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
/* eslint-env jest */

const axe = require('../../../lib/axe-helper')
const axe = require('../../../../lib/axe-helper')

const { render, getExamples } = require('../../../lib/jest-helpers')
const { render, getExamples } = require('../../../../lib/jest-helpers')

const examples = getExamples('skip-link')

Expand Down
Loading