Skip to content

Commit

Permalink
Merge pull request #9 from CrowdStrike/3-add-docs-package-lint-upgrades
Browse files Browse the repository at this point in the history
Upgrade `@nullvoxpopuli/eslint-configs`
  • Loading branch information
NullVoxPopuli authored Jan 19, 2023
2 parents 8962fe9 + 0b8b6b7 commit 8cc0ca9
Show file tree
Hide file tree
Showing 43 changed files with 686 additions and 876 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- uses: ./.github/actions/pnpm
- name: Lint
run: pnpm lint
- name: Formatting
run: pnpm format:check


build:
Expand Down
4 changes: 0 additions & 4 deletions docs-app/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# until we have linting for gts set up
**/*.gts
**/*.gjs
6 changes: 6 additions & 0 deletions docs-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

const { configs } = require('@nullvoxpopuli/eslint-configs');

// accommodates: JS, TS, App, Addon, and V2 Addon
module.exports = configs.ember();
21 changes: 0 additions & 21 deletions docs-app/.eslintrc.js

This file was deleted.

24 changes: 24 additions & 0 deletions docs-app/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
'use strict';

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
singleQuote: true,
templateSingleQuote: false,
// this was required to make the VSCode + Prettier work correctly with <template>, see https://github.com/gitKrystan/prettier-plugin-ember-template-tag/issues/38
// we should roll this back once that issue has been fixed!
overrides: [
{
files: '*.hbs',
options: {
singleQuote: false,
},
},
{
files: '*.gjs',
options: {
parser: 'ember-template-tag',
},
},
{
files: '*.gts',
options: {
parser: 'ember-template-tag',
},
},
],
};
42 changes: 21 additions & 21 deletions docs-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,50 @@ A short introduction of this app could easily go here.

You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/) (with npm)
* [Ember CLI](https://cli.emberjs.com/release/)
* [Google Chrome](https://google.com/chrome/)
- [Git](https://git-scm.com/)
- [Node.js](https://nodejs.org/) (with npm)
- [Ember CLI](https://cli.emberjs.com/release/)
- [Google Chrome](https://google.com/chrome/)

## Installation

* `git clone <repository-url>` this repository
* `cd docs-app`
* `npm install`
- `git clone <repository-url>` this repository
- `cd docs-app`
- `npm install`

## Running / Development

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
- `ember serve`
- Visit your app at [http://localhost:4200](http://localhost:4200).
- Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).

### Code Generators

Make use of the many generators for code, try `ember help generate` for more details

### Running Tests

* `ember test`
* `ember test --server`
- `ember test`
- `ember test --server`

### Linting

* `npm run lint`
* `npm run lint:fix`
- `npm run lint`
- `npm run lint:fix`

### Building

* `ember build` (development)
* `ember build --environment production` (production)
- `ember build` (development)
- `ember build --environment production` (production)

### Deploying

Specify what it takes to deploy your app.

## Further Reading / Useful Links

* [ember.js](https://emberjs.com/)
* [ember-cli](https://cli.emberjs.com/release/)
* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
- [ember.js](https://emberjs.com/)
- [ember-cli](https://cli.emberjs.com/release/)
- Development Browser Extensions
- [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
- [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
3 changes: 2 additions & 1 deletion docs-app/app/components/theme-switcher.gts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { on } from '@ember/modifier';
import service from 'docs-app/helpers/service';

import { DARK } from '@crowdstrike/ember-toucan-styles';
import service from 'docs-app/helpers/service';

import type { TOC } from '@ember/component/template-only';

Expand Down
4 changes: 3 additions & 1 deletion docs-app/app/helpers/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ interface Signature<Key extends keyof Registry> {
};
}

export default class GetService<Key extends keyof Registry> extends Helper<Signature<Key>> {
export default class GetService<Key extends keyof Registry> extends Helper<
Signature<Key>
> {
compute([name]: [Key]): Registry[Key] {
let owner = getOwner(this);

Expand Down
12 changes: 5 additions & 7 deletions docs-app/app/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta charset="utf-8" />
<title>ember-toucan-core</title>
<meta
name="description"
content="components in ember-toucan-core">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="components in ember-toucan-core" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

{{content-for "head"}}

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/docs-app.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css" />
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/docs-app.css" />

{{content-for "head-footer"}}
</head>
Expand Down
2 changes: 1 addition & 1 deletion docs-app/app/router.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { registerDestructor } from '@ember/destroyable';
import EmberRouter from '@embroider/router';

import { addDocfyRoutes } from '@docfy/ember';
import EmberRouter from '@embroider/router';
import config from 'docs-app/config/environment';

export default class Router extends EmberRouter {
Expand Down
4 changes: 2 additions & 2 deletions docs-app/app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TopBar>
<:title>
<span class="lowercase h-full">
to
to
</span>
</:title>

Expand All @@ -19,4 +19,4 @@
<:content>
{{outlet}}
</:content>
</App>
</App>
2 changes: 1 addition & 1 deletion docs-app/app/templates/docs.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<DocsWrapper>
{{outlet}}
</DocsWrapper>
</DocsWrapper>
24 changes: 18 additions & 6 deletions docs-app/app/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{!-- template-lint-disable no-inline-styles --}}
{{! template-lint-disable no-inline-styles }}
<Hero>
<div class="grid gap-8" id="skip-to-target">
<h1 class="type-3xl">ember-toucan-core</h1>
Expand All @@ -10,16 +10,26 @@
<span>
<Toucan::Link @variant="brand" class="px-6 py-1 flex gap-3" @href="/docs">
Read the Docs
<svg class="w-4 ml-2" viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
class="w-4 ml-2"
viewBox="0 0 14 13"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<title>GitHub</title>
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.25647 0.256191C7.42056 0.0921521 7.64308 0 7.8751 0C8.10713 0 8.32965 0.0921521 8.49374 0.256191L13.7438 5.50626C13.9078 5.67035 14 5.89287 14 6.12489C14 6.35692 13.9078 6.57944 13.7438 6.74353L8.49374 11.9936C8.32871 12.153 8.10768 12.2412 7.87825 12.2392C7.64883 12.2372 7.42937 12.1452 7.26713 11.9829C7.1049 11.8207 7.01287 11.6012 7.01088 11.3718C7.00889 11.1424 7.09708 10.9214 7.25647 10.7563L11.0129 6.99991H0.875012C0.642944 6.99991 0.420381 6.90772 0.256285 6.74362C0.0921884 6.57952 0 6.35696 0 6.12489C0 5.89283 0.0921884 5.67026 0.256285 5.50617C0.420381 5.34207 0.642944 5.24988 0.875012 5.24988H11.0129L7.25647 1.49346C7.09243 1.32937 7.00028 1.10685 7.00028 0.874825C7.00028 0.642803 7.09243 0.42028 7.25647 0.256191Z" fill="white"/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.25647 0.256191C7.42056 0.0921521 7.64308 0 7.8751 0C8.10713 0 8.32965 0.0921521 8.49374 0.256191L13.7438 5.50626C13.9078 5.67035 14 5.89287 14 6.12489C14 6.35692 13.9078 6.57944 13.7438 6.74353L8.49374 11.9936C8.32871 12.153 8.10768 12.2412 7.87825 12.2392C7.64883 12.2372 7.42937 12.1452 7.26713 11.9829C7.1049 11.8207 7.01287 11.6012 7.01088 11.3718C7.00889 11.1424 7.09708 10.9214 7.25647 10.7563L11.0129 6.99991H0.875012C0.642944 6.99991 0.420381 6.90772 0.256285 6.74362C0.0921884 6.57952 0 6.35696 0 6.12489C0 5.89283 0.0921884 5.67026 0.256285 5.50617C0.420381 5.34207 0.642944 5.24988 0.875012 5.24988H11.0129L7.25647 1.49346C7.09243 1.32937 7.00028 1.10685 7.00028 0.874825C7.00028 0.642803 7.09243 0.42028 7.25647 0.256191Z"
fill="white"
/>
</svg>
</Toucan::Link>
</span>
</div>
</Hero>

<hr class="border bg-basement">
<hr class="border bg-basement" />

<Main>
<ContentSection>
Expand All @@ -34,7 +44,9 @@

<ContentSection>
<:content>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-12 md:gap-16">
<div
class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-12 md:gap-16"
>
<FeatureCard @title="Coming Soon">
Features coming up!
</FeatureCard>
Expand Down Expand Up @@ -62,4 +74,4 @@
</div>
</:content>
</ContentSection>
</Main>
</Main>
6 changes: 1 addition & 5 deletions docs-app/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
"outputRepo": "https://github.com/ember-cli/ember-new-output",
"codemodsSource": "ember-app-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--no-welcome",
"--embroider",
"--ci-provider=github"
]
"options": ["--no-welcome", "--embroider", "--ci-provider=github"]
}
]
}
Expand Down
6 changes: 5 additions & 1 deletion docs-app/config/targets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions'];
const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions',
];

module.exports = {
browsers,
Expand Down
4 changes: 3 additions & 1 deletion docs-app/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ module.exports = function (defaults) {
// we set to global mode to avoid hashing tailwind classes
mode: 'global',
// class naming template
localIdentName: isProduction() ? '[sha512:hash:base64:5]' : '[path][name]__[local]',
localIdentName: isProduction()
? '[sha512:hash:base64:5]'
: '[path][name]__[local]',
},
},
webpackConfig: {
Expand Down
15 changes: 9 additions & 6 deletions docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
},
"scripts": {
"build": "ember build --environment=production",
"format": "prettier -w .",
"format:check": "prettier -c .",
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:' --prefix-colors cyan,white,yellow",
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:' --prefix-colors cyan,white,yellow",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
Expand All @@ -23,6 +25,7 @@
},
"devDependencies": {
"@babel/core": "^7.19.6",
"@babel/eslint-parser": "^7.19.1",
"@crowdstrike/ember-toucan-styles": "^1.0.5",
"@crowdstrike/tailwind-toucan-base": "^3.3.1",
"@docfy/core": "^0.5.0",
Expand All @@ -39,7 +42,7 @@
"@glint/environment-ember-template-imports": "^0.9.6",
"@glint/template": "^0.9.6",
"@html-next/vertical-collection": "^4.0.0",
"@nullvoxpopuli/eslint-configs": "^2.2.59",
"@nullvoxpopuli/eslint-configs": "^3.0.4",
"@tailwindcss/typography": "^0.5.7",
"@tsconfig/ember": "^1.0.1",
"@types/dompurify": "^2.3.4",
Expand Down Expand Up @@ -68,7 +71,6 @@
"@types/qunit": "^2.19.3",
"@types/rsvp": "^4.0.4",
"autoprefixer": "^10.4.12",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^7.4.0",
"cssnano": "^5.1.13",
Expand All @@ -90,17 +92,18 @@
"ember-source": "~4.8.0",
"ember-template-imports": "^3.1.2",
"ember-template-lint": "^4.14.0",
"eslint": "^7.32.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^11.0.6",
"eslint-plugin-ember": "^11.4.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-qunit": "^7.3.1",
"loader.js": "^4.7.0",
"postcss": "^8.4.17",
"postcss-import": "^15.0.0",
"postcss-loader": "^7.0.1",
"prettier": "^2.7.1",
"prettier": "^2.8.3",
"prettier-plugin-ember-template-tag": "^0.3.0",
"qunit": "^2.19.1",
"qunit-dom": "^2.0.0",
"tailwindcss": "^3.1.8",
Expand All @@ -120,9 +123,9 @@
"dompurify": "^2.4.0",
"ember-browser-services": "^4.0.3",
"ember-cached-decorator-polyfill": "^1.0.1",
"ember-toucan-core": "workspace:../ember-toucan-core",
"ember-modifier": "^3.2.7",
"ember-resources": "^5.4.0",
"ember-toucan-core": "workspace:../ember-toucan-core",
"highlight.js": "^11.6.0",
"highlightjs-glimmer": "^1.4.1",
"tracked-built-ins": "^3.1.0"
Expand Down
Loading

0 comments on commit 8cc0ca9

Please sign in to comment.