Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

[BREAKING] Glimmer.js 2.0 #235

Merged
merged 41 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3d6a2d3
Add export to upgrade glimmer-lite-donut
Jan 30, 2020
0106292
add @glimmer/core
Jan 31, 2020
713bb57
convert ssr
Jan 31, 2020
9086b3f
convert ssr
Jan 31, 2020
8ccba8c
remove @glimmer/application logic from ember-addon
Jan 31, 2020
23ca108
add babel plugins
Jan 31, 2020
93d8058
finish fixing ssr
Jan 31, 2020
b5106a4
template() -> createTemplate()
Jan 31, 2020
7058f61
add TO components to resolution
Jan 31, 2020
73851c2
add modifier + helper
Jan 31, 2020
d81b9ae
add build and tests
Feb 1, 2020
eb34921
cleanup tests
Feb 2, 2020
3d5f3f7
build packages
Feb 2, 2020
e93ed80
cleanup tests and separate into interactive/non-interactive
Feb 5, 2020
627d85b
mostly finish converting tests, removing legacy glimmer v1.0.0
Feb 5, 2020
03a2452
blueprint update wip
Feb 6, 2020
ff8d47f
finish blueprint updates
Feb 7, 2020
dbdeb6b
fix build
Feb 7, 2020
0b6217d
fix testem
Feb 7, 2020
bad7ab8
cleanup
Feb 7, 2020
a1b706b
scope -> hostMeta
Feb 7, 2020
234e51b
add clean script
Feb 7, 2020
14f8251
finish up build/test changes
Feb 7, 2020
ce981ec
add/update eslint
Feb 7, 2020
eb0d841
cleanup, update Travis
Feb 7, 2020
86764c4
update type tests
Feb 7, 2020
f4d3d4d
reorder scripts
Feb 7, 2020
4ad418b
fix node tests
Feb 8, 2020
30dac3b
fix and update babel plugin tests, make createTemplate a pure transform
Feb 8, 2020
7d8a044
update yarn.lock
Feb 8, 2020
d3b4f7d
add back amd resolution
Feb 8, 2020
d9ce687
bump node version
Feb 8, 2020
e16f4aa
fix ember tests
Feb 8, 2020
07c41c0
fix types for SSR
Feb 8, 2020
54326be
update createTemplate to have an error message
Feb 11, 2020
0a926fe
Update yarn.lock (after pinning a dep).
rwjblue Feb 11, 2020
b1cbb10
Remove outdated info from @glimmer/blueprint README.
rwjblue Feb 11, 2020
f42631a
Use `--cache` with eslint in a new project.
rwjblue Feb 11, 2020
c6bd3da
Move .eslintrc.js overrides from @glimmer/blueprint into root.
rwjblue Feb 11, 2020
ebdd3d3
Tweak new project README (RE: yarn build).
rwjblue Feb 11, 2020
35c7fb9
Remove empty helper file.
rwjblue Feb 11, 2020
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
19 changes: 19 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# compiled output
**/dist/**
**/tmp/**

# dependencies
/bower_components/
/node_modules/

**/node_modules/**
**/bower_components/**

# These are fixtures for tests, should be ignored
typescript.ts
babel.js

**/fixtures/**/*.js
**/fixture-options/**/*.js

test/types/utils.ts
72 changes: 72 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
},
extends: [
'eslint:recommended',
'prettier',
],
plugins: ['@typescript-eslint', 'prettier'],
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.babelrc.js',
'standalone.js',
'**/testem.js',
'**/config/ember-try.js',
'**/config/environment.js',
'**/config/targets.js',
'**/ember-cli-build.js',
'**/ember-addon-main.js',
'**/bin/**/*.js',
'**/scripts/**/*.js',
'**/blueprints/**/*.js',
'webpack.config.js',
'packages/babel-plugins/**/*.js',
],
env: {
es6: true,
node: true,
},
},
// bin scripts
{
files: ['bin/**/*.js'],
rules: {
'no-process-exit': 'off',
},
},
// source Js
{
files: ['src/**/*.js'],
parserOptions: {
sourceType: 'module',
},
},
// TypeScript source
{
files: ['**/*.ts'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],

// disabling this one because of DEBUG APIs, if we ever find a better
// way to suport those we should re-enable it
'@typescript-eslint/no-non-null-assertion': 'off',

'@typescript-eslint/no-use-before-define': 'off',
}
},
],
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dist
/npm-debug.log*
/testem.log
/yarn-error.log
.eslintcache

# ember-try
**/.node_modules.ember-try/**
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '8'
- '10'

env:
- MOZ_HEADLESS=1
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
name: Package Tests
script: yarn test
- name: Lint
script: yarn tslint
script: yarn lint
- name: Type Lint
script:
- yarn build
Expand Down
3 changes: 0 additions & 3 deletions .watchmanconfig

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

71 changes: 71 additions & 0 deletions bin/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env node

const path = require('path');
const fs = require('fs-extra');
const { promisify } = require('util');

const exec = promisify(require('child_process').exec);
const glob = promisify(require('glob'));

(async function() {
process.chdir(path.join(__dirname, '..'));

await buildTypescript('dist/modules', 'es2015');
await buildTypescript('dist/commonjs', 'commonjs');

const packages = (await glob('dist/modules/{@*/*,!(@*)}'))
.map(pkg => pkg.replace('dist/modules/', ''))
.flatMap(pkg => [
{
from: path.join('dist', 'commonjs', pkg),
to: path.join('packages', pkg, 'dist', 'commonjs'),
},
{
from: path.join('dist', 'modules', pkg),
to: path.join('packages', pkg, 'dist', 'modules'),
},
]);

await remove(packages.map(pkg => pkg.to));
await createDirs(packages.map(pkg => pkg.to));
await move(packages);

console.log('\n\nDone');
})();

async function buildTypescript(outDir, moduleKind = 'es2015') {
try {
await exec(`node_modules/.bin/tsc -p . --outDir ${outDir} -m ${moduleKind}`);
} catch (err) {
if (err.stdout) {
console.log(err.stdout.toString());
} else {
throw err;
}
}
}

function createDirs(paths) {
return each(paths, pathOfDir => {
console.log(`Creating Dir ${pathOfDir}`);
return fs.mkdirp(pathOfDir);
});
}

function remove(paths) {
return each(paths, pathOfDir => {
console.log(`Removing ${pathOfDir}`);
return fs.remove(pathOfDir);
});
}

function move(paths) {
return each(paths, ({ from, to }) => {
console.log(`Moving ${from} -> ${to}`);
return fs.rename(from, to);
});
}

function each(paths, cb) {
return Promise.all(paths.map(cb));
}
23 changes: 23 additions & 0 deletions bin/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env node

const fs = require('fs-extra');
const { promisify } = require('util');

const glob = promisify(require('glob'));

(async function() {
await remove(await glob('./packages/@glimmer/*/dist'));

console.log('\n\nDone');
})();

function remove(paths) {
return each(paths, pathOfDir => {
console.log(`Removing ${pathOfDir}`);
return fs.remove(pathOfDir);
});
}

function each(paths, cb) {
return Promise.all(paths.map(cb));
}
Loading