-
Notifications
You must be signed in to change notification settings - Fork 58
Adding an untyped GlimmerX project to develop the GlimmerX language server against #68
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a93ee16
Adding an untyped GlimmerX project to develop the GlimmerX language s…
d35e9a0
Made sample app code less verbose
5699f85
add .gitattributes to force line endings
jamescdavis 5210cd8
Updated eslintConfig in demo-untyped-glimmerx-app package.json
52bdc0a
Align testem.json with demo-glimmerx-app's testem.json
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.js text eol=lf | ||
*.ts text eol=lf | ||
*.css text eol=lf | ||
*.hbs text eol=lf | ||
*.json text eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = function (api) { | ||
dfreeman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return { | ||
plugins: [ | ||
['@glimmer/babel-plugin-glimmer-env', { DEBUG: !api.env('production') }], | ||
'@glimmerx/babel-plugin-component-templates', | ||
['@babel/plugin-proposal-decorators', { legacy: true }], | ||
'@babel/plugin-proposal-class-properties', | ||
], | ||
presets: ['@babel/preset-env'], | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 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 | ||
max_line_length = 100 | ||
|
||
[*.hbs] | ||
insert_final_newline = false | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
tmp/* | ||
dist | ||
|
||
glint.log | ||
yarn-error.log | ||
.eslintcache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
environment: glimmerx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# demo-untyped-glimmerx-app | ||
|
||
This application is used for development of the Glint language server in an untyped GlimmerX project. | ||
|
||
This README will be updated as functionality is added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>demo-untyped-glimmerx-app</title> | ||
|
||
<link rel="icon" href="./public/favicon.png" /> | ||
<link rel="apple-touch-icon" href="./public/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="./public/manifest.json" /> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "es2015", | ||
"inlineSourceMap": true, | ||
"inlineSources": true, | ||
"moduleResolution": "node", | ||
"experimentalDecorators": true, | ||
"types": [ | ||
"qunit" | ||
] | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"tmp", | ||
"dist" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{ | ||
"name": "demo-untyped-glimmerx-app", | ||
"version": "0.0.0", | ||
"description": "A brand new Glimmer app.", | ||
"directories": { | ||
"doc": "doc", | ||
"test": "tests" | ||
}, | ||
"scripts": { | ||
"build": "NODE_ENV=production webpack", | ||
"lint": "eslint . --ext=js --cache", | ||
"start": "webpack-dev-server", | ||
"test": "npm-run-all lint test:browsers", | ||
"test:browsers": "testem ci", | ||
"test:watch": "testem" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.9.0", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/plugin-proposal-decorators": "^7.8.3", | ||
"@babel/preset-env": "^7.9.0", | ||
"@glimmer/babel-plugin-glimmer-env": "~2.0.0-beta.12", | ||
"@glimmer/env": "^0.1.7", | ||
"@glimmerx/babel-plugin-component-templates": "^0.4.2", | ||
"@glimmerx/component": "^0.4.2", | ||
"@glimmerx/core": "^0.4.2", | ||
"@glimmerx/eslint-plugin": "^0.4.2", | ||
"@glimmerx/helper": "^0.4.2", | ||
"@glimmerx/modifier": "^0.4.2", | ||
"@glint/core": "^0.3.0", | ||
"babel-loader": "^8.1.0", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"copy-webpack-plugin": "^5.1.1", | ||
"css-loader": "^3.4.2", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.1", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"file-loader": "^6.0.0", | ||
"glob": "7.1.6", | ||
"html-webpack-plugin": "^4.0.4", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.0.2", | ||
"qunit": "^2.9.3", | ||
"qunit-dom": "^1.1.0", | ||
"style-loader": "^1.1.3", | ||
"testem": "^3.0.3", | ||
"webpack": "^4.42.1", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3" | ||
}, | ||
"eslintConfig": { | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"impliedStrict": true | ||
} | ||
}, | ||
"env": { | ||
"browser": true | ||
}, | ||
"plugins": [ | ||
"@glimmerx", | ||
"prettier" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"ignorePatterns": [ | ||
"dist/", | ||
"node_modules/", | ||
"!.*" | ||
], | ||
"rules": { | ||
"@glimmerx/template-vars": "error" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
".babelrc.js", | ||
"testem.js", | ||
"webpack.config.js" | ||
], | ||
"env": { | ||
"node": true | ||
} | ||
} | ||
] | ||
}, | ||
"prettier": { | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
"last 2 Edge versions", | ||
"last 2 Chrome versions", | ||
"last 2 Firefox versions", | ||
"last 2 Safari versions" | ||
], | ||
"development": [ | ||
"last 1 Chrome version", | ||
"last 1 Firefox version", | ||
"last 1 Safari version" | ||
] | ||
}, | ||
"engines": { | ||
"node": ">= 12.0" | ||
}, | ||
"private": true | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test-packages/demo-untyped-glimmerx-app/public/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"short_name": "demo-untyped-glimmerx-app", | ||
"name": "A brand new Glimmer app.", | ||
"icons": [ | ||
{ | ||
"src": "favicon.png", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
}, | ||
{ | ||
"src": "logo192.png", | ||
"type": "image/png", | ||
"sizes": "192x192" | ||
}, | ||
{ | ||
"src": "logo512.png", | ||
"type": "image/png", | ||
"sizes": "512x512" | ||
} | ||
], | ||
"start_url": ".", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# http://www.robotstxt.org | ||
User-agent: * | ||
Disallow: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
body { | ||
margin: 0; | ||
font-family: Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
} | ||
|
||
#app { | ||
min-height: 100vh; | ||
width: 800px; | ||
margin: auto; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Component, { hbs, tracked } from '@glimmerx/component'; | ||
import { on, action } from '@glimmerx/modifier'; | ||
|
||
import './App.css'; | ||
import GreetingHeader from './GreetingHeader'; | ||
|
||
function formatName(name) { | ||
return `${name} the Great and Powerful`; | ||
} | ||
|
||
class FormattedName extends Component { | ||
static template = hbs` | ||
{{formatName this.args.name}}! | ||
`; | ||
|
||
get name() { | ||
return this.args.name || 'glimmerx'; | ||
} | ||
} | ||
|
||
const I_AM_CONSTANT = 'and I am a constant'; | ||
const ComponentAsArg = hbs` | ||
<h1>I am {{@title}}</h1> | ||
{{I_AM_CONSTANT}} | ||
`; | ||
export default class HelloWorld extends Component { | ||
static template = hbs` | ||
<ComponentAsArg @title={{component FormattedName name="Oz"}}/> | ||
<GreetingHeader @greeting="hello"/> | ||
<IncrementableButton @startCount={{100}}/> | ||
`; | ||
} | ||
|
||
class IncrementableButton extends Component { | ||
@tracked count = this.args.startCount; | ||
|
||
@action increment() { | ||
this.count++; | ||
} | ||
|
||
static template = hbs` | ||
<p>You have clicked the button {{this.count}} times.</p> | ||
<button {{on "click" this.increment}}>Click</button> | ||
`; | ||
} |
16 changes: 16 additions & 0 deletions
16
test-packages/demo-untyped-glimmerx-app/src/GreetingHeader.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Component from '@glimmerx/component'; | ||
import { hbs } from '@glimmerx/component'; | ||
import { helper } from '@glimmerx/helper'; | ||
|
||
const or = helper(([a, b]) => a || b); | ||
|
||
export default class GreetingHeader extends Component { | ||
static template = hbs` | ||
<h1>{{@greeting}}, {{or @target 'glimmerx'}}</h1> | ||
<img src={{this.src}}/> | ||
`; | ||
|
||
get src() { | ||
return this.args.src || 'https://picsum.photos/250'; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { renderComponent } from '@glimmerx/core'; | ||
import App from './App'; | ||
|
||
const containerElement = document.getElementById('app'); | ||
|
||
renderComponent(App, containerElement); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"framework": "qunit", | ||
"test_page": "dist/tests/index.html", | ||
"routes": { | ||
"/tests.bundle.js": "dist/tests.bundle.js", | ||
"/public": "dist/public", | ||
"/images": "dist/images" | ||
}, | ||
"on_start": { | ||
"command": "webpack", | ||
"wait_for_text": "Built at:" | ||
}, | ||
"watch_files": [ | ||
"dist/tests.bundle.js" | ||
], | ||
"browser_args": { | ||
"mode": "ci", | ||
"Chrome": [ | ||
"--headless", | ||
"--remote-debugging-port=9222" | ||
] | ||
}, | ||
"launch_in_ci": [ | ||
"Chrome" | ||
], | ||
"launch_in_dev": [ | ||
"Chrome" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>demo-untyped-glimmerx-app Tests</title> | ||
<link rel="icon" href="../public/favicon.png" /> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script src="/testem.js"></script> | ||
</body> | ||
</html> | ||
|
11 changes: 11 additions & 0 deletions
11
test-packages/demo-untyped-glimmerx-app/tests/rendering/App.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { module, test, renderComponent } from '../util'; | ||
|
||
import App from '../../src/App'; | ||
|
||
module('App test', () => { | ||
test('it works', async (assert) => { | ||
await renderComponent(App); | ||
|
||
assert.dom('h1').containsText('I am Oz the Great and Powerful!'); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.