Skip to content

Commit

Permalink
Fix handlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
chadhietala committed Jan 16, 2017
1 parent f8e7a3c commit e0c1408
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 123 deletions.
47 changes: 22 additions & 25 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ function buildPackage(name, options) {
options = options ? options : {};
var packageJson = require(name + '/package');
var packageDir = path.dirname(require.resolve(name + '/package'));
// var entry = path.join(packageDir, options.entry || packageJson['module'] || packageJson['js:next'] || packageJson['main'].replace(/dist\//, 'dist/es6/'));
// var basename = path.basename(entry);

if (options.entry && !options.srcDir) {
throw new Error('If resolving from a non-package.json entry point, you must supply the srcDirectory.');
Expand All @@ -128,11 +126,13 @@ function buildPackage(name, options) {
var moduleId = options.moduleId ? options.moduleId : name;
var destination = options.dest ? options.dest + '.js': moduleId + '.js';
var external = options.external ? options.external : [];
var plugins = options.plugins ? options.plugins : [];
var rolledUp = new Rollup(es6, {
rollup: {
external: external,
entry: sourceEntry,
dest: destination,
plugins: plugins,
format: 'es',
moduleId: moduleId,
exports: 'named'
Expand Down Expand Up @@ -235,27 +235,6 @@ function babelConfigFor(environment) {
};
}

// var glimmerEngine = require('glimmer-engine/ember-cli-build')({
// shouldExternalizeHelpers: true,
// stripRuntimeChecks: true
// });

// function glimmerPackage(name) {
// return replace(new Funnel(glimmerEngine, {
// include: [
// 'named-amd/' + name + '.js',
// 'named-amd/' + name + '/**/*.js'
// ]
// }), {
// files: ['**/*.js'],
// pattern: {
// match: /\/\/#\s+sourceMappingURL.*/g,
// replacement: ''
// },
// annotation: 'strip sourceMappingURL'
// });
// }

function getVersion() {
var projectPath = process.cwd();
var info = getGitInfo(projectPath);
Expand Down Expand Up @@ -292,6 +271,21 @@ function qunit() {
});
}

function handlebarsFix() {
var HANDLEBARS_UTIL = /\/utils.js$/;
return {
load: function(id) {
if (HANDLEBARS_UTIL.test(id)) {
var code = fs.readFileSync(id, 'utf8');
return {
code: code.replace(/export var isFunction/, 'export { isFunction }'),
map: { mappings: null }
};
}
}
}
}

module.exports = function() {
var features = getFeatures();
var version = getVersion();
Expand All @@ -306,7 +300,6 @@ module.exports = function() {
'route-recognizer': routeRecognizer(),
'simple-html-tokenizer': htmlbarsPackage('simple-html-tokenizer', { libPath: 'node_modules/glimmer-engine/dist/es6' }),

// 'glimmer': glimmerPackage('glimmer'),
'@glimmer/compiler': buildPackage('@glimmer/compiler'),
'@glimmer/reference': buildPackage('@glimmer/reference'),
'@glimmer/runtime': buildPackage('@glimmer/runtime'),
Expand All @@ -315,7 +308,11 @@ module.exports = function() {
'@glimmer/test-helpers': buildPackage('@glimmer/test-helpers'),
'@glimmer/util': buildPackage('@glimmer/util'),
'@glimmer/wire-format': buildPackage('@glimmer/wire-format'),
'handlebars': buildPackage('handlebars', { srcDir: 'lib', entry: 'handlebars/compiler/base.js' }) // inlined parser
'handlebars': buildPackage('handlebars', {
srcDir: 'lib',
entry: 'handlebars/compiler/base.js',
plugins: [handlebarsFix()]
}) // inlined parser
};

// Replace _getBowerTree with one from npm
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"test:testem": "testem -f testem.dist.json"
},
"dependencies": {
"@glimmer/compiler": "^0.21.0",
"@glimmer/node": "^0.21.0",
"@glimmer/compiler": "^0.21.1",
"@glimmer/node": "^0.21.1",
"@glimmer/reference": "^0.21.0",
"@glimmer/runtime": "^0.21.0",
"@glimmer/runtime": "^0.21.1",
"@glimmer/util": "^0.21.0",
"broccoli-stew": "^1.2.0",
"ember-cli-get-component-path-option": "^1.0.0",
Expand All @@ -47,7 +47,7 @@
"simple-dom": "^0.3.0"
},
"devDependencies": {
"@glimmer/test-helpers": "^0.5.3",
"@glimmer/test-helpers": "^0.21.1",
"aws-sdk": "~2.2.43",
"babel-plugin-feature-flags": "^0.2.3",
"babel-plugin-filter-imports": "~0.2.0",
Expand Down
125 changes: 31 additions & 94 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,34 @@
# yarn lockfile v1


"@glimmer/compiler@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.21.0.tgz#7d18112c99a644fe7a6acddb25ff37ee4ba27b0e"
"@glimmer/compiler@^0.21.1":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.21.1.tgz#0f248c0a39928a0940dbce1129c4e3352534096b"
dependencies:
"@glimmer/syntax" "^0.21.0"
"@glimmer/syntax" "^0.21.1"
"@glimmer/util" "^0.21.0"
"@glimmer/wire-format" "^0.21.0"
simple-html-tokenizer "^0.3.0"

"@glimmer/compiler@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.5.3.tgz#a632d798c46bd012c75ba113357c9eca1836c676"
dependencies:
"@glimmer/syntax" "^0.5.3"
"@glimmer/util" "^0.5.3"
"@glimmer/wire-format" "^0.5.3"
simple-html-tokenizer "^0.2.5"

"@glimmer/interfaces@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.21.0.tgz#386b2c5bbe5bf6f54eda014937adf2e3927571bf"
dependencies:
"@glimmer/wire-format" "^0.21.0"

"@glimmer/interfaces@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.5.3.tgz#648173cda1e77a7134c0c19a095a972213475e12"
"@glimmer/node@^0.21.1":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.21.1.tgz#31690f141542ffca685fad497aaee49c44687763"
dependencies:
"@glimmer/wire-format" "^0.5.3"

"@glimmer/node@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.21.0.tgz#47c0a981a64f286f0153679d6e56206848109f76"
dependencies:
"@glimmer/runtime" "^0.21.0"
"@glimmer/runtime" "^0.21.1"
simple-dom "^0.3.0"

"@glimmer/object-model@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/object-model/-/object-model-0.5.3.tgz#7d7d5c6a1889d9708b0ab12c10161c4d80326a94"
"@glimmer/object-model@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/object-model/-/object-model-0.21.0.tgz#dba8779bbf7c57179b46e999ec6441d72b013a6a"
dependencies:
"@glimmer/reference" "^0.5.3"
"@glimmer/util" "^0.5.3"
"@glimmer/reference" "^0.21.0"
"@glimmer/util" "^0.21.0"

"@glimmer/object-reference@^0.21.0":
version "0.21.0"
Expand All @@ -53,42 +38,22 @@
"@glimmer/reference" "^0.21.0"
"@glimmer/util" "^0.21.0"

"@glimmer/object-reference@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/object-reference/-/object-reference-0.5.3.tgz#59099bdbb2cefeeaad626e4fee74efc314818cff"
dependencies:
"@glimmer/reference" "^0.5.3"
"@glimmer/util" "^0.5.3"

"@glimmer/object@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/object/-/object-0.21.0.tgz#2ac659c0611fdd22da60b13e0a8c34665ab9b352"
dependencies:
"@glimmer/object-reference" "^0.21.0"
"@glimmer/util" "^0.21.0"

"@glimmer/object@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/object/-/object-0.5.3.tgz#7dcb004c36dc65926a3270961c6e18a86ab771fa"
dependencies:
"@glimmer/object-reference" "^0.5.3"
"@glimmer/util" "^0.5.3"

"@glimmer/reference@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.21.0.tgz#8719a7a942654a33db7e6b1556fc06fac39e98c8"
dependencies:
"@glimmer/util" "^0.21.0"

"@glimmer/reference@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.5.3.tgz#0794aa1528fb2203a98c1be021304f34e98aa888"
dependencies:
"@glimmer/util" "^0.5.3"

"@glimmer/runtime@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.21.0.tgz#a4c8499e80dfac2de5295ece9c4ae60cda197dc0"
"@glimmer/runtime@^0.21.0", "@glimmer/runtime@^0.21.1":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.21.1.tgz#ae7207a9930ce0c26203dbc626d53c2fe78f8204"
dependencies:
"@glimmer/interfaces" "^0.21.0"
"@glimmer/object" "^0.21.0"
Expand All @@ -97,65 +62,37 @@
"@glimmer/util" "^0.21.0"
"@glimmer/wire-format" "^0.21.0"

"@glimmer/runtime@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.5.3.tgz#132acddd8175a999de1f30e40656ab4062181637"
dependencies:
"@glimmer/interfaces" "^0.5.3"
"@glimmer/object" "^0.5.3"
"@glimmer/object-reference" "^0.5.3"
"@glimmer/reference" "^0.5.3"
"@glimmer/util" "^0.5.3"
"@glimmer/wire-format" "^0.5.3"

"@glimmer/syntax@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.21.0.tgz#9b5a6de585c2299b21fa0f1d2a9daf5576bb7e49"
"@glimmer/syntax@^0.21.1":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.21.1.tgz#020c7b5816bbdc0004c663fe3c51856e6d86ed62"
dependencies:
handlebars "^3.0.3"
simple-html-tokenizer "^0.3.0"

"@glimmer/syntax@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.5.3.tgz#0dcc9640e0480fd43ddde98bb26282a489eeacfc"
"@glimmer/test-helpers@^0.21.1":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@glimmer/test-helpers/-/test-helpers-0.21.1.tgz#c113e542a6205fd54c6c736c6e50475ea1e1947a"
dependencies:
handlebars "^3.0.3"
simple-html-tokenizer "^0.2.5"

"@glimmer/test-helpers@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/test-helpers/-/test-helpers-0.5.3.tgz#18a06324246e30e3ddc02c5df91dea236b03deb6"
dependencies:
"@glimmer/compiler" "^0.5.3"
"@glimmer/interfaces" "^0.5.3"
"@glimmer/object" "^0.5.3"
"@glimmer/object-model" "^0.5.3"
"@glimmer/object-reference" "^0.5.3"
"@glimmer/reference" "^0.5.3"
"@glimmer/runtime" "^0.5.3"
"@glimmer/util" "^0.5.3"
"@glimmer/wire-format" "^0.5.3"
"@glimmer/compiler" "^0.21.1"
"@glimmer/interfaces" "^0.21.0"
"@glimmer/object" "^0.21.0"
"@glimmer/object-model" "^0.21.0"
"@glimmer/object-reference" "^0.21.0"
"@glimmer/reference" "^0.21.0"
"@glimmer/runtime" "^0.21.1"
"@glimmer/util" "^0.21.0"
"@glimmer/wire-format" "^0.21.0"

"@glimmer/util@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.21.0.tgz#86c1e972e2f777f5af664b59c5bc037b71e9ef00"

"@glimmer/util@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.5.3.tgz#fdf170ab2e9d83449e83aca7b6a88a152f010cc7"

"@glimmer/wire-format@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.21.0.tgz#ec97adafaf6d1bbd4d1fcf0cbd0a9df2784a22d5"
dependencies:
"@glimmer/util" "^0.21.0"

"@glimmer/wire-format@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.5.3.tgz#08e47374d2947a68ffb280eb26a6e4aee7276c62"
dependencies:
"@glimmer/util" "^0.5.3"

abbrev@1, abbrev@1.0.x, abbrev@~1.0.9:
version "1.0.9"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"
Expand Down

0 comments on commit e0c1408

Please sign in to comment.