Skip to content

Commit 73bc0ea

Browse files
authored
Separated docs and test apps (#165)
* chore: Created docs-app package * chore: Removed irrelevant code (docs-app) * chore: Removed ember-try (docs-app) * chore: Separated testing concerns (docs-app) * feature: Introduced Embroider with no options (docs-app) * chore: Ran yarn install and yarn-deduplicate * feature: Enabled stricter Embroider settings and route splitting (docs-app) * chore: Removed ember-cli-typescript (docs-app) * chore: Updated Ember syntax (docs-app) * chore: Removed irrelevant code (test-app) * chore: Removed ember-cli-typescript (test-app) * chore: Removed unused packages (test-app) * chore: Ran yarn install * chore: Updated CONTRIBUTING and README * chore: Updated CI workflow * chore: Temporarily downgraded @ember/test-helpers to v2.7.0 so that 3.28 and 4.4 ember-try scenarios run --------- Co-authored-by: ijlee2 <[email protected]>
1 parent e3475d9 commit 73bc0ea

File tree

217 files changed

+2336
-934
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+2336
-934
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ env:
1212
PERCY_PARALLEL_TOTAL: 9
1313

1414
jobs:
15-
build-test-app:
16-
name: Build test-app
15+
build-docs-app:
16+
name: Build docs-app for testing
1717
runs-on: ubuntu-latest
1818
timeout-minutes: 5
1919
steps:
@@ -29,15 +29,15 @@ jobs:
2929
- name: Install dependencies
3030
run: yarn install --frozen-lockfile
3131

32-
- name: Build test-app
32+
- name: Build docs-app
3333
run: yarn build:test
34-
working-directory: test-app
34+
working-directory: docs-app
3535

36-
- name: Upload test-app
36+
- name: Upload docs-app
3737
uses: actions/upload-artifact@v3
3838
with:
3939
name: dist
40-
path: test-app/dist
40+
path: docs-app/dist
4141

4242

4343
lint:
@@ -61,9 +61,9 @@ jobs:
6161
run: yarn lint
6262

6363

64-
test-addon:
65-
name: Test addon
66-
needs: [build-test-app]
64+
test-docs-app:
65+
name: Test docs-app
66+
needs: [build-docs-app]
6767
runs-on: ubuntu-latest
6868
strategy:
6969
matrix:
@@ -110,24 +110,46 @@ jobs:
110110
- name: Install dependencies
111111
run: yarn install --frozen-lockfile
112112

113-
- name: Download test-app
113+
- name: Download docs-app
114114
uses: actions/download-artifact@v3
115115
with:
116116
name: dist
117-
path: test-app/dist
117+
path: docs-app/dist
118118

119119
- name: Run tests
120-
run: npx percy exec -- yarn test:ember --path=dist --test-port=${{ matrix.test-port }}
121-
working-directory: test-app
120+
run: npx percy exec -- yarn test:device --path=dist --test-port=${{ matrix.test-port }}
121+
working-directory: docs-app
122122
env:
123123
DEVICE: ${{ matrix.device }}
124124
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
125125
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
126126
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
127127

128128

129-
test-compatibility:
130-
name: Test compatibility
129+
test-addon:
130+
name: Test addon
131+
runs-on: ubuntu-latest
132+
timeout-minutes: 5
133+
steps:
134+
- name: Check out a copy of the repo
135+
uses: actions/checkout@v3
136+
137+
- name: Use Node.js ${{ env.NODE_VERSION }}
138+
uses: actions/setup-node@v3
139+
with:
140+
cache: 'yarn'
141+
node-version: ${{ env.NODE_VERSION }}
142+
143+
- name: Install dependencies
144+
run: yarn install --frozen-lockfile
145+
146+
- name: Run tests
147+
run: yarn test
148+
working-directory: test-app
149+
150+
151+
test-addon-compatibility:
152+
name: Test addon compatibility
131153
runs-on: ubuntu-latest
132154
strategy:
133155
fail-fast: false
@@ -138,20 +160,9 @@ jobs:
138160
- 'ember-lts-4.8'
139161
- 'ember-release'
140162
- 'ember-beta'
141-
# - 'ember-canary'
163+
- 'ember-canary'
142164
- 'embroider-safe'
143-
# - 'embroider-optimized'
144-
device:
145-
- 'w1-h3'
146-
- 'w2-h3'
147-
- 'w3-h3'
148-
include:
149-
- device: 'w1-h3'
150-
test-port: 7363
151-
- device: 'w2-h3'
152-
test-port: 7364
153-
- device: 'w3-h3'
154-
test-port: 7365
165+
- 'embroider-optimized'
155166
timeout-minutes: 5
156167
steps:
157168
- name: Check out a copy of the repo
@@ -166,9 +177,6 @@ jobs:
166177
- name: Install dependencies
167178
run: yarn install --frozen-lockfile
168179

169-
# Test compatibility without Percy
170180
- name: Run tests
171-
run: yarn test:ember-compatibility ${{ matrix.scenario }} --- yarn test:ember --test-port=${{ matrix.test-port }}
181+
run: yarn test:ember-compatibility ${{ matrix.scenario }} --- yarn test
172182
working-directory: test-app
173-
env:
174-
DEVICE: ${{ matrix.device }}

CONTRIBUTING.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Here are some guidelines to help you and everyone else.
88
## Setup
99

1010
<details>
11-
<summary>Installation</summary>
11+
<summary>Install the app</summary>
1212

1313
1. Fork and clone this repo.
1414

@@ -32,48 +32,42 @@ Here are some guidelines to help you and everyone else.
3232

3333

3434
<details>
35-
<summary>Running demo app</summary>
35+
<summary>Run the demo app</summary>
3636

3737
1. After following the installation step, you can run the app.
3838

3939
```bash
40-
ember serve
40+
yarn start
4141
```
4242

43-
1. Open the app at [http://localhost:4200](http://localhost:4200).
43+
1. Once the app has finished building, visit [http://localhost:4200](http://localhost:4200).
4444

4545
</details>
4646

4747

4848
<details>
49-
<summary>Linting</summary>
49+
<summary>Lint files</summary>
5050

51-
1. When you write code, please check dependencies, template files, and JavaScript files often.
51+
1. When you write code, please check that it meets all linting rules.
5252

5353
```bash
5454
yarn lint
5555
```
5656

57-
This command will lint files and dependencies in parallel. You can run `yarn lint:fix` to fix HBS and JS files.
57+
1. You can run `yarn lint:fix` to automatically fix linting errors in all packages.
5858

5959
</details>
6060

6161

6262
<details>
63-
<summary>Running tests - very important ⚠️</summary>
63+
<summary>Run tests</summary>
6464

65-
1. The setup is quite different from most addons. We check the addon and demo app at _9_ various widths and heights.
66-
67-
1. When you write code, please check both addon and demo app often.
65+
1. When you write code, please check that all tests continue to pass.
6866

6967
```bash
7068
yarn test
7169
```
7270

73-
1. A couple of caveats. `yarn test --server` may result in failed tests due to inexact test window size. Using `--filter` may also result in failed tests. I use the filters for responsive testing so please don't overwrite them with your own.
74-
75-
1. When you write code, you don't need to check addon compatibility. I suggest leaving this to CI. For every PR, the CI will lint files and dependencies, run tests, and check compatible versions—all in parallel! 💯
76-
7771
</details>
7872

7973

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ Let's look at the code that created the video demo above.
330330
331331
You can see that the album page uses 2 `<ContainerQuery>` components. Rest assured, they act independently of each other. When you pair `<ContainerQuery>` with some CSS, you can create layouts beyond the dreams of others! 🙌
332332
333-
For more examples, I encourage you to check out the code for my demo app. It is located under [`test-app/app`](https://github.com/ijlee2/ember-container-query/tree/main/test-app/app) folder and is structured like a typical Ember app.
333+
For more examples, I encourage you to check out the code for my demo app. It is located under the [`docs-app`](https://github.com/ijlee2/ember-container-query/tree/main/docs-app) folder and is structured like a typical Ember app.
334334
335335
336336
Compatibility

docs-app/.ember-cli

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
/**
3+
Ember CLI sends analytics information by default. The data is completely
4+
anonymous, but there are times when you might want to disable this behavior.
5+
6+
Setting `disableAnalytics` to true will prevent any data from being sent.
7+
*/
8+
"disableAnalytics": false,
9+
10+
/**
11+
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
12+
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
13+
*/
14+
"isTypeScriptProject": false
15+
}

docs-app/.eslintignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
.*/
17+
.eslintcache
18+
19+
# ember-try
20+
/.node_modules.ember-try/
21+
/bower.json.ember-try
22+
/npm-shrinkwrap.json.ember-try
23+
/package.json.ember-try
24+
/package-lock.json.ember-try
25+
/yarn.lock.ember-try

docs-app/.eslintrc.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
'use strict';
2+
3+
module.exports = {
4+
root: true,
5+
parser: '@typescript-eslint/parser',
6+
parserOptions: {
7+
ecmaVersion: 2018,
8+
},
9+
plugins: [
10+
'ember',
11+
'@typescript-eslint',
12+
'simple-import-sort',
13+
'typescript-sort-keys',
14+
],
15+
extends: [
16+
'eslint:recommended',
17+
'plugin:ember/recommended',
18+
'plugin:prettier/recommended',
19+
],
20+
env: {
21+
browser: true,
22+
},
23+
rules: {
24+
curly: 'error',
25+
'simple-import-sort/exports': 'error',
26+
'simple-import-sort/imports': 'error',
27+
},
28+
overrides: [
29+
// TypeScript files
30+
{
31+
files: ['**/*.ts'],
32+
extends: [
33+
'plugin:@typescript-eslint/eslint-recommended',
34+
'plugin:@typescript-eslint/recommended',
35+
'plugin:typescript-sort-keys/recommended',
36+
],
37+
rules: {
38+
'@typescript-eslint/no-empty-interface': 'off',
39+
'@typescript-eslint/no-explicit-any': 'off',
40+
'@typescript-eslint/no-non-null-assertion': 'off',
41+
},
42+
},
43+
// Node files
44+
{
45+
files: [
46+
'./.eslintrc.js',
47+
'./.prettierrc.js',
48+
'./.stylelintrc.js',
49+
'./.template-lintrc.js',
50+
'./ember-cli-build.js',
51+
'./testem.js',
52+
'./blueprints/*/index.js',
53+
'./config/**/*.js',
54+
'./lib/*/index.js',
55+
'./server/**/*.js',
56+
],
57+
env: {
58+
browser: false,
59+
node: true,
60+
},
61+
extends: ['plugin:n/recommended'],
62+
},
63+
// Test files
64+
{
65+
files: ['tests/**/*-test.{js,ts}'],
66+
extends: ['plugin:qunit/recommended'],
67+
},
68+
],
69+
};

docs-app/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist/
5+
/tmp/
6+
7+
# dependencies
8+
/bower_components/
9+
/node_modules/
10+
11+
# misc
12+
/.env*
13+
/.pnp*
14+
/.DS_Store
15+
/.sass-cache
16+
/.eslintcache
17+
/.stylelintcache
18+
/connect.lock
19+
/coverage/
20+
/libpeerconnection.log
21+
/npm-debug.log*
22+
/testem.log
23+
/yarn-error.log
24+
25+
# ember-try
26+
/.node_modules.ember-try/
27+
/bower.json.ember-try
28+
/npm-shrinkwrap.json.ember-try
29+
/package.json.ember-try
30+
/package-lock.json.ember-try
31+
/yarn.lock.ember-try
32+
33+
# broccoli-debug
34+
/DEBUG/
File renamed without changes.

docs-app/.prettierignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
.eslintcache
17+
.lint-todo/
18+
19+
# ember-try
20+
/.node_modules.ember-try/
21+
/bower.json.ember-try
22+
/npm-shrinkwrap.json.ember-try
23+
/package.json.ember-try
24+
/package-lock.json.ember-try
25+
/yarn.lock.ember-try

docs-app/.prettierrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
3+
module.exports = {
4+
printWidth: 80,
5+
singleQuote: true,
6+
7+
overrides: [
8+
{
9+
files: '*.hbs',
10+
options: {
11+
printWidth: 64,
12+
singleQuote: false,
13+
},
14+
},
15+
],
16+
};

0 commit comments

Comments
 (0)