move some files around

pull/204/head
Rich-Harris 8 years ago
parent e45b15c3da
commit f73a87230a

@ -3,12 +3,11 @@ import CodeBuilder from '../utils/CodeBuilder.js';
import { walk } from 'estree-walker';
import deindent from '../utils/deindent.js';
import isReference from '../utils/isReference.js';
import counter from './utils/counter.js';
import counter from './shared/utils/counter.js';
import flattenReference from '../utils/flattenReference.js';
import visitors from './visitors/index.js';
import globalWhitelist from '../utils/globalWhitelist.js';
export default function createGenerator ( parsed, source, names ) {
export default function createGenerator ( parsed, source, names, visitors ) {
const generator = {
addElement ( name, renderStatement, needsIdentifier = false ) {
const isToplevel = generator.current.localElementDepth === 0;

@ -1,16 +1,17 @@
import MagicString, { Bundle } from 'magic-string';
import CodeBuilder from '../utils/CodeBuilder.js';
import deindent from '../utils/deindent.js';
import namespaces from '../utils/namespaces.js';
import getIntro from './utils/getIntro.js';
import getOutro from './utils/getOutro.js';
import processCss from './css/process.js';
import createGenerator from './createGenerator.js';
export default function generate ( parsed, source, options, names ) {
import deindent from '../../utils/deindent.js';
import CodeBuilder from '../../utils/CodeBuilder.js';
import namespaces from '../../utils/namespaces.js';
import getIntro from '../shared/utils/getIntro.js';
import getOutro from '../shared/utils/getOutro.js';
import processCss from '../shared/css/process.js';
import visitors from './visitors/index.js';
import createGenerator from '../createGenerator.js';
export default function dom ( parsed, source, options, names ) {
const format = options.format || 'es';
const generator = createGenerator( parsed, source, names );
const generator = createGenerator( parsed, source, names, visitors );
const templateProperties = {};
const imports = [];

@ -1,5 +1,5 @@
import deindent from '../../utils/deindent.js';
import CodeBuilder from '../../utils/CodeBuilder.js';
import deindent from '../../../utils/deindent.js';
import CodeBuilder from '../../../utils/CodeBuilder.js';
import addComponentAttributes from './attributes/addComponentAttributes.js';
export default {

@ -1,4 +1,4 @@
import deindent from '../../utils/deindent.js';
import deindent from '../../../utils/deindent.js';
export default {
enter ( generator, node ) {

@ -1,5 +1,5 @@
import CodeBuilder from '../../utils/CodeBuilder.js';
import deindent from '../../utils/deindent.js';
import CodeBuilder from '../../../utils/CodeBuilder.js';
import deindent from '../../../utils/deindent.js';
import addElementAttributes from './attributes/addElementAttributes.js';
import Component from './Component.js';

@ -1,4 +1,4 @@
import deindent from '../../utils/deindent.js';
import deindent from '../../../utils/deindent.js';
function getConditionsAndBlocks ( generator, node, _name, i = 0 ) {
generator.addSourcemapLocations( node.expression );

@ -1,4 +1,4 @@
import deindent from '../../utils/deindent.js';
import deindent from '../../../utils/deindent.js';
export default {
enter ( generator, node ) {

@ -1,4 +1,4 @@
import deindent from '../../utils/deindent.js';
import deindent from '../../../utils/deindent.js';
export default {
enter ( generator, node ) {

@ -1,5 +1,5 @@
import createBinding from './binding/index.js';
import deindent from '../../../utils/deindent.js';
import deindent from '../../../../utils/deindent.js';
export default function addComponentAttributes ( generator, node, local ) {
local.staticAttributes = [];

@ -1,7 +1,7 @@
import attributeLookup from './lookup.js';
import createBinding from './binding/index.js';
import deindent from '../../../utils/deindent.js';
import flattenReference from '../../../utils/flattenReference.js';
import deindent from '../../../../utils/deindent.js';
import flattenReference from '../../../../utils/flattenReference.js';
export default function addElementAttributes ( generator, node, local ) {
node.attributes.forEach( attribute => {

@ -1,6 +1,6 @@
import deindent from '../../../../utils/deindent.js';
import isReference from '../../../../utils/isReference.js';
import flattenReference from '../../../../utils/flattenReference.js';
import deindent from '../../../../../utils/deindent.js';
import isReference from '../../../../../utils/isReference.js';
import flattenReference from '../../../../../utils/flattenReference.js';
export default function createBinding ( generator, node, attribute, current, local ) {
const parts = attribute.value.split( '.' );

@ -1,10 +1,10 @@
import { walk } from 'estree-walker';
import deindent from '../utils/deindent.js';
import isReference from '../utils/isReference.js';
import flattenReference from '../utils/flattenReference.js';
import MagicString, { Bundle } from 'magic-string';
import processCss from '../generate/css/process.js';
import voidElementNames from '../utils/voidElementNames.js';
import { walk } from 'estree-walker';
import deindent from '../../utils/deindent.js';
import isReference from '../../utils/isReference.js';
import flattenReference from '../../utils/flattenReference.js';
import voidElementNames from '../../utils/voidElementNames.js';
import processCss from '../shared/css/process.js';
export default function compile ( parsed, source, { filename }) {
const code = new MagicString( source );

@ -1,4 +1,4 @@
import spaces from '../../utils/spaces.js';
import spaces from '../../../utils/spaces.js';
import transform from './transform.js';
export default function process ( parsed ) {

@ -1,4 +1,4 @@
import deindent from '../../utils/deindent.js';
import deindent from '../../../utils/deindent.js';
import getGlobals from './getGlobals.js';
export default function getIntro ( format, options, imports ) {

@ -1,7 +1,7 @@
import parse from './parse/index.js';
import validate from './validate/index.js';
import generate from './generate/index.js';
import generateSSR from './server-side-rendering/compile.js';
import generate from './generators/dom/index.js';
import generateSSR from './generators/server-side-rendering/index.js';
function normalizeOptions ( options ) {
return Object.assign( {

Loading…
Cancel
Save