Skip to content

Commit

Permalink
Moved config files back into root :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Cipscis committed Nov 3, 2023
1 parent 814156b commit 82a0177
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You should also update the `CHANGELOG.md` file to describe your changes. This is

Assets such as CSS and JavaScript are contained in `/app/assets`. In here, the contents of the `scss` folder are used to compile CSS files into the `css` folder.

The `/app/assets/js` folder contains a `src` folder and a `dist` folder. Any JavaScript or TypeScript files inside the `src` folder are bundled into the `dist` folder. By default, Webpack is configured to look for a single entry point at `/app/assets/js/src/main.ts`.
The `/app/assets/js` folder contains a `src` folder and a `dist` folder. Any JavaScript or TypeScript files inside the `src` folder are bundled into the `dist` folder. By default, eslint is configured to look for a single entry point at `/app/assets/js/src/main.ts`.

### Backend assets

Expand All @@ -56,11 +56,11 @@ For more information on the differences, see [Differences between ES modules and

### Linting

Both [eslint](https://www.npmjs.com/package/eslint) and [stylelint](https://www.npmjs.com/package/stylelint) configuration files can be found within the [`config`](./config) folder.
[eslint](https://www.npmjs.com/package/eslint) is configured in [`.eslintrc.cjs`](./.eslintrc.cjs), and [stylelint](https://www.npmjs.com/package/stylelint) is configured in [`stylelint.config.cjs`](./stylelint.config.cjs)

### Tests

The [Jest](https://jestjs.io/)-based test suite is configured in [jest.config.ts](./config/jest.config.ts). No custom test name matcher is specified, which means [Jest's default matcher](https://jestjs.io/docs/configuration#testmatch-arraystring) will be used:
The [Jest](https://jestjs.io/)-based test suite is configured in [jest.config.js](./jest.config.js). No custom test name matcher is specified, which means [Jest's default matcher](https://jestjs.io/docs/configuration#testmatch-arraystring) will be used:

> By default it looks for `.js`, `.jsx`, `.ts` and `.tsx` files inside of `__tests__` folders, as well as any files with a suffix of `.test` or `.spec` (e.g. `Component.test.js` or `Component.spec.js`). It will also find files called `test.js` or `spec.js`.
Expand Down
4 changes: 2 additions & 2 deletions config/jest.config.js → jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const config = {
// Don't inject globals. Require them to be imported from `@jest/globals`
injectGlobals: false,
// Specify where the tests are
rootDir: '../app',
rootDir: './app',
// Tell Jest how to follow module resolution rules based on tsconfig's baseUrl
moduleDirectories: ['node_modules', '../app/assets/js/src'],
moduleDirectories: ['node_modules', './app/assets/js/src'],
// Provide a mocked DOM environment for tests
testEnvironment: 'jsdom',
// Telling jsdom to use 'node' exports seems necessary to allow importing from Preact
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"build": "concurrently \"npm run buildJs\" \"npm run buildCss\"",

"pretest": "tsc --noEmit",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=config/jest.config.js",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",

"watchJs": "ts-node --esm scripts/build-watch.ts",
"watchCss": "sass app/assets/scss:app/assets/css --watch",
"testWatch": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=config/jest.config.js --watch",
"testWatch": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --watch",
"watch": "concurrently --kill-others \"tsc --watch --preserveWatchOutput --noEmit\" \"npm run watchJs\" \"npm run watchCss\" \"npm run testWatch\"",

"lintJs": "eslint --config=config/.eslintrc.cjs app/assets/js/src/**",
"lintCss": "stylelint --config=config/stylelint.config.cjs app/assets/scss/**/*.scss",
"lintJs": "eslint app/assets/js/src/**",
"lintCss": "stylelint app/assets/scss/**/*.scss",
"lint": "npm run lintJs && npm run lintCss",

"start": "concurrently --kill-others \"npm run server\" \"npm run watch\"",
Expand Down
File renamed without changes.

0 comments on commit 82a0177

Please sign in to comment.