mirror of https://github.com/sveltejs/svelte
parent
e45b15c3da
commit
f73a87230a
@ -1,16 +1,17 @@
|
|||||||
import MagicString, { Bundle } from 'magic-string';
|
import MagicString, { Bundle } from 'magic-string';
|
||||||
import CodeBuilder from '../utils/CodeBuilder.js';
|
import deindent from '../../utils/deindent.js';
|
||||||
import deindent from '../utils/deindent.js';
|
import CodeBuilder from '../../utils/CodeBuilder.js';
|
||||||
import namespaces from '../utils/namespaces.js';
|
import namespaces from '../../utils/namespaces.js';
|
||||||
import getIntro from './utils/getIntro.js';
|
import getIntro from '../shared/utils/getIntro.js';
|
||||||
import getOutro from './utils/getOutro.js';
|
import getOutro from '../shared/utils/getOutro.js';
|
||||||
import processCss from './css/process.js';
|
import processCss from '../shared/css/process.js';
|
||||||
import createGenerator from './createGenerator.js';
|
import visitors from './visitors/index.js';
|
||||||
|
import createGenerator from '../createGenerator.js';
|
||||||
export default function generate ( parsed, source, options, names ) {
|
|
||||||
|
export default function dom ( parsed, source, options, names ) {
|
||||||
const format = options.format || 'es';
|
const format = options.format || 'es';
|
||||||
|
|
||||||
const generator = createGenerator( parsed, source, names );
|
const generator = createGenerator( parsed, source, names, visitors );
|
||||||
|
|
||||||
const templateProperties = {};
|
const templateProperties = {};
|
||||||
const imports = [];
|
const imports = [];
|
@ -1,5 +1,5 @@
|
|||||||
import deindent from '../../utils/deindent.js';
|
import deindent from '../../../utils/deindent.js';
|
||||||
import CodeBuilder from '../../utils/CodeBuilder.js';
|
import CodeBuilder from '../../../utils/CodeBuilder.js';
|
||||||
import addComponentAttributes from './attributes/addComponentAttributes.js';
|
import addComponentAttributes from './attributes/addComponentAttributes.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
@ -1,4 +1,4 @@
|
|||||||
import deindent from '../../utils/deindent.js';
|
import deindent from '../../../utils/deindent.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
enter ( generator, node ) {
|
enter ( generator, node ) {
|
@ -1,5 +1,5 @@
|
|||||||
import CodeBuilder from '../../utils/CodeBuilder.js';
|
import CodeBuilder from '../../../utils/CodeBuilder.js';
|
||||||
import deindent from '../../utils/deindent.js';
|
import deindent from '../../../utils/deindent.js';
|
||||||
import addElementAttributes from './attributes/addElementAttributes.js';
|
import addElementAttributes from './attributes/addElementAttributes.js';
|
||||||
import Component from './Component.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 ) {
|
function getConditionsAndBlocks ( generator, node, _name, i = 0 ) {
|
||||||
generator.addSourcemapLocations( node.expression );
|
generator.addSourcemapLocations( node.expression );
|
@ -1,4 +1,4 @@
|
|||||||
import deindent from '../../utils/deindent.js';
|
import deindent from '../../../utils/deindent.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
enter ( generator, node ) {
|
enter ( generator, node ) {
|
@ -1,4 +1,4 @@
|
|||||||
import deindent from '../../utils/deindent.js';
|
import deindent from '../../../utils/deindent.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
enter ( generator, node ) {
|
enter ( generator, node ) {
|
@ -1,5 +1,5 @@
|
|||||||
import createBinding from './binding/index.js';
|
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 ) {
|
export default function addComponentAttributes ( generator, node, local ) {
|
||||||
local.staticAttributes = [];
|
local.staticAttributes = [];
|
@ -1,7 +1,7 @@
|
|||||||
import attributeLookup from './lookup.js';
|
import attributeLookup from './lookup.js';
|
||||||
import createBinding from './binding/index.js';
|
import createBinding from './binding/index.js';
|
||||||
import deindent from '../../../utils/deindent.js';
|
import deindent from '../../../../utils/deindent.js';
|
||||||
import flattenReference from '../../../utils/flattenReference.js';
|
import flattenReference from '../../../../utils/flattenReference.js';
|
||||||
|
|
||||||
export default function addElementAttributes ( generator, node, local ) {
|
export default function addElementAttributes ( generator, node, local ) {
|
||||||
node.attributes.forEach( attribute => {
|
node.attributes.forEach( attribute => {
|
@ -1,6 +1,6 @@
|
|||||||
import deindent from '../../../../utils/deindent.js';
|
import deindent from '../../../../../utils/deindent.js';
|
||||||
import isReference from '../../../../utils/isReference.js';
|
import isReference from '../../../../../utils/isReference.js';
|
||||||
import flattenReference from '../../../../utils/flattenReference.js';
|
import flattenReference from '../../../../../utils/flattenReference.js';
|
||||||
|
|
||||||
export default function createBinding ( generator, node, attribute, current, local ) {
|
export default function createBinding ( generator, node, attribute, current, local ) {
|
||||||
const parts = attribute.value.split( '.' );
|
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 MagicString, { Bundle } from 'magic-string';
|
||||||
import processCss from '../generate/css/process.js';
|
import { walk } from 'estree-walker';
|
||||||
import voidElementNames from '../utils/voidElementNames.js';
|
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 }) {
|
export default function compile ( parsed, source, { filename }) {
|
||||||
const code = new MagicString( source );
|
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';
|
import transform from './transform.js';
|
||||||
|
|
||||||
export default function process ( parsed ) {
|
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';
|
import getGlobals from './getGlobals.js';
|
||||||
|
|
||||||
export default function getIntro ( format, options, imports ) {
|
export default function getIntro ( format, options, imports ) {
|
Loading…
Reference in new issue