Skip to content

Commit

Permalink
Move config, lib, tasks into shared directory
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Apr 11, 2023
1 parent 6eb9006 commit d98a34e
Show file tree
Hide file tree
Showing 55 changed files with 125 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/workflows/actions/install-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ runs:
app/node_modules
docs/examples/*/node_modules
package/node_modules
shared/*/node_modules
- name: Setup Node.js
uses: ./.github/workflows/actions/setup-node
Expand Down
8 changes: 7 additions & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"extends": "../tsconfig.base.json",
"include": ["**/*.js", "**/*.mjs", "../config", "../lib", "../tasks"],
"include": [
"**/*.js",
"**/*.mjs",
"../shared/config",
"../shared/lib",
"../shared/tasks"
],
"exclude": ["./dist/**"]
}
26 changes: 14 additions & 12 deletions docs/contributing/application-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

Binary/executable files (i.e. bash scripts) mainly used in the [publishing process](/docs/releasing/publishing.md).

- `config/`

Configuration files for the review app and [Jest](https://github.com/facebook/jest).

- `dist/` **contains auto-generated files**

Standalone builds of govuk-frontend. Provides a way to consume govuk-frontend without using npm.
Expand All @@ -20,19 +16,25 @@

Documentation files.

- `lib/`

Application modules and helpers.

- `package/` **contains auto-generated files**

package published on npm.
Consume all of govuk-frontend through a single package.

- `src/`
- `shared/`

Source files. See README.md in the src directory for details.
- `config/`

Configuration files for the review app and [Jest](https://github.com/facebook/jest).

- `tasks/`
- `lib/`

Application modules and helpers. See [tasks](tasks.md) for more information about the tasks.
Application modules and helpers.

- `tasks/`

See [tasks](tasks.md) for more information about the tasks.

- `src/`

Source files. See README.md in the src directory for details.
2 changes: 1 addition & 1 deletion docs/contributing/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ npm scripts are defined in `package.json`. These trigger a number of Gulp tasks.

## Gulp tasks

Project Gulp tasks are defined in [`gulpfile.mjs`](../../gulpfile.mjs) and the [`tasks/`](../../tasks) folder.
Project Gulp tasks are defined in [`gulpfile.mjs`](../../gulpfile.mjs) and the [`tasks/`](../../shared/tasks) folder.

**`gulp --tasks`**

Expand Down
File renamed without changes.
89 changes: 83 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
"license": "MIT",
"workspaces": [
"app",
"config",
"docs/examples/*",
"lib",
"package",
"tasks"
"shared/*"
],
"scripts": {
"postinstall": "npm ls --depth=0",
Expand Down
2 changes: 1 addition & 1 deletion package.json.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const packageLockJson = require('./package-lock.json')
const packageJson = require('./tasks/package.json')
const packageJson = require('./shared/tasks/package.json')

describe('because rollup 0.60 drops support for Internet Explorer 8', () => {
describe('rollup', () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
@@ -1,6 +1,6 @@
import { setup } from 'jest-dev-server'

import config from '../../../jest-dev-server.config.js'
import config from '../../../../jest-dev-server.config.js'

// Start web server(s)
export default async () => {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions config/paths.js → shared/config/paths.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { dirname, join } = require('path')
const { join, resolve } = require('path')

// Repository root directory
const rootPath = dirname(__dirname)
const rootPath = resolve(__dirname, '../../')

/**
* Config paths
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion config/tsconfig.json → shared/config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../tsconfig.base.json",
"extends": "../../tsconfig.base.json",
"include": ["**/*.js", "**/*.mjs"]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions shared/lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["**/*.js", "**/*.mjs", "../config"],
"compilerOptions": {
"lib": ["ESNext", "DOM"]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tasks/tsconfig.json → shared/tasks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../tsconfig.base.json",
"extends": "../../tsconfig.base.json",
"include": ["**/*.js", "**/*.mjs", "../config", "../lib"]
}
2 changes: 1 addition & 1 deletion src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../tsconfig.base.json",
"include": ["**/*.js", "**/*.mjs", "../config", "../lib"],
"include": ["**/*.js", "**/*.mjs", "../shared/config", "../shared/lib"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"target": "ES2015",
Expand Down
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"path": "./app"
},
{
"path": "./config"
"path": "./shared/config"
},
{
"path": "./lib"
"path": "./shared/lib"
},
{
"path": "./src"
"path": "./shared/tasks"
},
{
"path": "./tasks"
"path": "./src"
}
]
}

0 comments on commit d98a34e

Please sign in to comment.