This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from glimmerjs/glimmerjs-2.0
[BREAKING] Glimmer.js 2.0
- Loading branch information
Showing
271 changed files
with
9,709 additions
and
13,964 deletions.
There are no files selected for viewing
This file contains 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,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 |
This file contains 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,73 @@ | ||
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', | ||
'packages/@glimmer/blueprint/index.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', | ||
} | ||
}, | ||
], | ||
}; |
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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,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)); | ||
} |
This file contains 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,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)); | ||
} |
Oops, something went wrong.