Skip to content

Commit

Permalink
Add test-app-4.x & remove ember-data dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mkszepp committed Jun 26, 2024
1 parent 928d94f commit b06a9a1
Show file tree
Hide file tree
Showing 78 changed files with 3,200 additions and 389 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dist"
],
"scripts": {
"clean": "rm -rf dist node_modules test-app-3.x/node_modules",
"clean": "rm -rf dist node_modules test-app-3.x/node_modules test-app-4.x/node_modules test-app-5.x/node_modules",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
Expand Down
884 changes: 499 additions & 385 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
packages:
- '.'
- 'test-app-3.x'
- 'test-app-4.x'
- 'test-app-5.x'
2 changes: 1 addition & 1 deletion test-app-3.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "test-app-3.x",
"private": true,
"version": "1.0.0",
"description": "Test suite for ember-moment",
"description": "Test suite for ember-moment with ember-source 3.x",
"license": "MIT",
"scripts": {
"build": "ember build --environment=production",
Expand Down
19 changes: 19 additions & 0 deletions test-app-4.x/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions test-app-4.x/.ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
14 changes: 14 additions & 0 deletions test-app-4.x/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# unconventional js
/blueprints/*/files/

# compiled output
/declarations/
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
56 changes: 56 additions & 0 deletions test-app-4.x/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use strict';

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
25 changes: 25 additions & 0 deletions test-app-4.x/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# compiled output
/dist/
/declarations/

# dependencies
/node_modules/

# misc
/.env*
/.pnp*
/.eslintcache
/coverage/
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
13 changes: 13 additions & 0 deletions test-app-4.x/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
12 changes: 12 additions & 0 deletions test-app-4.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

module.exports = {
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};
8 changes: 8 additions & 0 deletions test-app-4.x/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
5 changes: 5 additions & 0 deletions test-app-4.x/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};
5 changes: 5 additions & 0 deletions test-app-4.x/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended',
};
3 changes: 3 additions & 0 deletions test-app-4.x/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["dist"]
}
57 changes: 57 additions & 0 deletions test-app-4.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# test-app-4.x

This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.

## Prerequisites

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

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

## Installation

- `git clone <repository-url>` this repository
- `cd test-app-4.x`
- `pnpm install`

## Running / Development

- `pnpm start`
- 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

- `pnpm test`
- `pnpm test:ember --server`

### Linting

- `pnpm lint`
- `pnpm lint:fix`

### Building

- `pnpm ember build` (development)
- `pnpm build` (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/)
12 changes: 12 additions & 0 deletions test-app-4.x/app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'test-app-4.x/config/environment';

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

loadInitializers(App, config.modulePrefix);
Empty file.
Empty file.
37 changes: 37 additions & 0 deletions test-app-4.x/app/controllers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { action, set } from '@ember/object';
import { dependentKeyCompat } from '@ember/object/compat';
import { tracked } from '@glimmer/tracking';
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';

export default class Index extends Controller {
@service moment;

@action
changeLocale(locale) {
this.moment.changeLocale(locale);
}
@action
changeDefaultFormat(defaultFormat) {
set(this, 'moment.defaultFormat', defaultFormat);
}

@tracked emptyDate = null;
@tracked numHours = 822;
@tracked unixTimeStamp = 946684799;
@tracked date = new Date();
@tracked currentTime = new Date();

get inTwelveHours() {
return new Date(new Date().valueOf() + 12 * 60 * 60 * 1000);
}

@dependentKeyCompat
get lastHour() {
return new Date(new Date().valueOf() - 60 * 60 * 1000);
}

get usIndependenceDay() {
return new Date(1776, 6, 4, 12, 0, 0);
}
}
11 changes: 11 additions & 0 deletions test-app-4.x/app/controllers/smoke.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Controller from '@ember/controller';

export default class Smoke extends Controller {
get currentTime() {
return new Date();
}

get usIndependenceDay() {
return new Date(1776, 6, 4, 12, 0, 0);
}
}
Empty file.
24 changes: 24 additions & 0 deletions test-app-4.x/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TestApp</title>
<meta name="description" content="">
<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/test-app-4.x.css">

{{content-for "head-footer"}}
</head>
<body>
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-app-4.x.js"></script>

{{content-for "body-footer"}}
</body>
</html>
Empty file.
12 changes: 12 additions & 0 deletions test-app-4.x/app/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import EmberRouter from '@ember/routing/router';
import config from 'test-app-4.x/config/environment';

export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
}

Router.map(function () {
this.route('index', { path: '/' });
this.route('smoke');
});
Empty file.
10 changes: 10 additions & 0 deletions test-app-4.x/app/routes/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class Application extends Route {
@service moment;

beforeModel() {
this.moment.changeLocale('en');
}
}
22 changes: 22 additions & 0 deletions test-app-4.x/app/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { set } from '@ember/object';
import { run } from '@ember/runloop';

export default class Index extends Route {
@service moment;

beforeModel() {
set(this, 'moment.locale', 'en');
}

setupController(controller, model) {
super.setupController(controller, model);

setInterval(function () {
run(function () {
controller.set('date', new Date());
});
}, 1000);
}
}
Loading

0 comments on commit b06a9a1

Please sign in to comment.