Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ember #2438

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libraries/__shared__/webcomponents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "webcomponents",
"version": "1.0.0",
"description": "",
"main": "xfoo.js",
"type": "module",
"exports": {
"./*": "./src/*.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
19 changes: 19 additions & 0 deletions libraries/ember/.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
25 changes: 25 additions & 0 deletions libraries/ember/.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 libraries/ember/.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/
14 changes: 14 additions & 0 deletions libraries/ember/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";

module.exports = {
plugins: ["prettier-plugin-ember-template-tag"],
overrides: [
{
files: "*.{js,gjs,ts,gts,mjs,mts,cjs,cts}",
options: {
singleQuote: true,
templateSingleQuote: false,
},
},
],
};
3 changes: 3 additions & 0 deletions libraries/ember/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: "recommended",
};
3 changes: 3 additions & 0 deletions libraries/ember/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["dist"]
}
37 changes: 37 additions & 0 deletions libraries/ember/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const { buildMacros } = require('@embroider/macros/babel');

const macros = buildMacros();

module.exports = {
plugins: [
[
'babel-plugin-ember-template-compilation',
{
compilerPath: 'ember-source/dist/ember-template-compiler.js',
enableLegacyModules: ['ember-cli-htmlbars'],
transforms: [...macros.templateMacros],
},
],
[
'module:decorator-transforms',
{
runtime: {
import: require.resolve('decorator-transforms/runtime-esm'),
},
},
],
[
'@babel/plugin-transform-runtime',
{
absoluteRuntime: __dirname,
useESModules: true,
regenerator: false,
},
],
...macros.babelMacros,
],

generatorOpts: {
compact: false,
},
};
1 change: 1 addition & 0 deletions libraries/ember/config/ember-cli-update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"schemaVersion":"1.0.0","packages":[{"name":"@embroider/app-blueprint","version":"0.11.0","blueprints":[{"name":"@embroider/app-blueprint","isBaseBlueprint":true,"options":["--package-manager pnpm"]}]}]}
5 changes: 5 additions & 0 deletions libraries/ember/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ember } from 'ember-eslint';

export default [
...ember.recommended(import.meta.dirname),
];
18 changes: 18 additions & 0 deletions libraries/ember/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>AppTemplate</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<script src="/@embroider/core/vendor.js"></script>
<script type="module">
import Application from "#src/app";
import environment from "#config";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere, what do these nonstandard import specifiers that start with # mean? What part of the build system makes them work? Could you instead write javascript here, with ./dist/config.js or similar?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just how package.json#imports works.

A super helpful feature when you enable type=module.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Application.create(environment.APP);
</script>
</body>
</html>
19 changes: 19 additions & 0 deletions libraries/ember/meta/expectedResults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"success": 32,
"failed": 0,
"skipped": 0,
"error": false,
"disconnected": false,
"exitCode": 0,
"score": 100,
"basicSupport": {
"total": 16,
"failed": 0,
"passed": 16
},
"advancedSupport": {
"total": 16,
"failed": 0,
"passed": 16
}
}
1 change: 1 addition & 0 deletions libraries/ember/meta/issues.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
9 changes: 9 additions & 0 deletions libraries/ember/meta/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<h4 id="ember-handling-data">Handling data</h4>

Because attributes must be strings, Ember requires that, if an attribute is desired,
its value be a string, otherwise data is passed as properties to the element instance.

<h4 id="ember-handling-events">Handling events</h4>

Ember can listen to native DOM events dispatched from Custom Elements.
It supports all styles of events (lowercase, camelCase, kebab-case, etc).
98 changes: 98 additions & 0 deletions libraries/ember/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"name": "ember-cee-app",
"version": "0.0.0",
"private": true,
"description": "Small description for ember-cee-app goes here",
"repository": "",
"type": "module",
"library_repo": "emberjs/ember.js",
"license": "MIT",
"author": "NullVoxPopuli",
"scripts": {
"test": "wireit",
"build": "wireit",
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "vite",
"vite:build": "vite build",
"test:ember": "cross-env NODE_ENV=development vite build --mode test && ember test --path dist --config-file ./testem.cjs"
},
"devDependencies": {
"@babel/core": "^7.26.9",
"@babel/plugin-transform-runtime": "^7.26.9",
"@ember/test-helpers": "^5.1.0",
"@embroider/core": "^4.0.0-alpha.6",
"@embroider/macros": "^1.17.0-alpha.5",
"@embroider/router": "^3.0.0-alpha.1",
"@embroider/vite": "^1.0.0-alpha.7",
"@glimmer/component": "^2.0.0",
"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-ember-template-compilation": "^2.3.0",
"concurrently": "^9.1.2",
"cross-env": "^7.0.3",
"decorator-transforms": "^2.3.0",
"ember-cli": "^6.2.2",
"ember-eslint": "^0.2.1",
"ember-modifier": "^4.2.0",
"ember-qunit": "^9.0.1",
"ember-resolver": "^13.1.0",
"ember-source": "^6.2.0",
"ember-template-lint": "^7.0.1",
"eslint": "^9.21.0",
"prettier": "^3.5.3",
"prettier-plugin-ember-template-tag": "^2.0.4",
"qunit": "^2.24.1",
"qunit-dom": "^3.4.0",
"tracked-built-ins": "^4.0.0",
"vite": "^6.0.0",
"webcomponents": "link:../__shared__/webcomponents",
"wireit": "^0.14.11"
},
"engines": {
"node": ">= 18"
},
"ember": {
"edition": "octane"
},
"ember-addon": {
"type": "app",
"version": 2
},
"imports": {
"#src/*": "./src/*",
"#config": "./src/config.js",
"#components/*": "./src/components/*"
},
"exports": {
"./tests/*": "./tests/*",
"./*": "./src/*"
},
"wireit": {
"test": {
"files": [
"babel.config.cjs",
"vite.config.js",
"src",
"config",
"tests",
"meta"
],
"output": [
"results"
],
"command": "cross-env LIBRARY_NAME=ember pnpm test:ember || echo ''"
},
"build": {
"dependencies": [
"test"
]
}
},
"dependencies": {
"qunit-theme-ember": "^1.0.0"
}
}
Loading
Loading