How to use the @glimmer/syntax/package.json.homepage function in @glimmer/syntax

To help you get started, we’ve selected a few @glimmer/syntax examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fkling / astexplorer / website / src / parsers / handlebars / transformers / glimmer / index.js View on Github external
import compileModule from '../../../utils/compileModule';
import pkg from '@glimmer/syntax/package.json';

const ID = 'glimmer';

export default {
  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage || 'https://github.com/glimmerjs/glimmer-vm',

  defaultParserID: 'glimmer',

  loadTransformer(callback) {
    require(
      ['../../../transpilers/babel', '@glimmer/syntax'],
      (transpile, glimmer) => callback({ transpile: transpile.default, glimmer }),
    );
  },

  transform({ transpile, glimmer }, transformCode, code) {
    transformCode = transpile(transformCode);
    const transformModule = compileModule(transformCode);

    // allow "export default" instead of "module.exports = "
    const transform = transformModule.__esModule ?
github fkling / astexplorer / website / src / parsers / handlebars / glimmer.js View on Github external
import defaultParserInterface from './utils/defaultHandlebarsParserInterface';
import pkg from '@glimmer/syntax/package.json';

const ID = 'glimmer';

export default {
  ...defaultParserInterface,

  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage || 'https://github.com/glimmerjs/glimmer-vm',

  loadParser(callback) {
    require(['@glimmer/syntax'], (glimmer) => callback(glimmer.preprocess));
  },

  opensByDefault(node, key) {
    return key === 'body';
  },
};