1
0
Fork 0

chore: Move core files to .mjs

This commit is contained in:
Joost De Cock 2022-08-26 18:51:02 +02:00
parent e6901ba541
commit 3671f44e90
15 changed files with 34 additions and 34 deletions

View file

@ -14,7 +14,7 @@ const banner = `/**
const options = { const options = {
banner: { js: banner }, banner: { js: banner },
bundle: true, bundle: true,
entryPoints: ['src/index.js'], entryPoints: ['src/index.mjs'],
format: 'esm', format: 'esm',
outfile: 'dist/index.mjs', outfile: 'dist/index.mjs',
external: ["@freesewing"], external: ["@freesewing"],

View file

@ -1,5 +1,5 @@
import Pattern from './pattern' import Pattern from './pattern.mjs'
import { addPartConfig } from './utils.js' import { addPartConfig } from './utils.mjs'
/* /*
* The Design constructor. Returns a Pattern constructor * The Design constructor. Returns a Pattern constructor

View file

@ -1,9 +1,9 @@
import Design from './design' import Design from './design.mjs'
import Pattern from './pattern' import Pattern from './pattern.mjs'
import Point from './point' import Point from './point.mjs'
import Path from './path' import Path from './path.mjs'
import Snippet from './snippet' import Snippet from './snippet.mjs'
import * as utils from './utils' import * as utils from './utils.mjs'
import pkg from '../package.json' assert { type: 'json' } import pkg from '../package.json' assert { type: 'json' }
const { version } = pkg const { version } = pkg

View file

@ -1,9 +1,9 @@
import * as utils from './utils' import * as utils from './utils.mjs'
import Point from './point' import Point from './point.mjs'
import Path from './path' import Path from './path.mjs'
import Snippet from './snippet' import Snippet from './snippet.mjs'
import Attributes from './attributes' import Attributes from './attributes.mjs'
import Hooks from './hooks' import Hooks from './hooks.mjs'
function Part() { function Part() {
this.attributes = new Attributes() this.attributes = new Attributes()

View file

@ -1,5 +1,5 @@
import Attributes from './attributes' import Attributes from './attributes.mjs'
import Point from './point' import Point from './point.mjs'
import { Bezier } from 'bezier-js' import { Bezier } from 'bezier-js'
import { import {
linesIntersect, linesIntersect,
@ -9,7 +9,7 @@ import {
pointOnCurve, pointOnCurve,
curveEdge, curveEdge,
round, round,
} from './utils' } from './utils.mjs'
function Path(debug = false) { function Path(debug = false) {
this.render = true this.render = true

View file

@ -1,3 +1,4 @@
import pack from 'bin-pack'
import { import {
macroName, macroName,
sampleStyle, sampleStyle,
@ -5,16 +6,15 @@ import {
decoratePartDependency, decoratePartDependency,
addPartConfig, addPartConfig,
mergeDependencies, mergeDependencies,
} from './utils.js' } from './utils.mjs'
import Part from './part' import Part from './part.mjs'
import Point from './point' import Point from './point.mjs'
import Path from './path' import Path from './path.mjs'
import Snippet from './snippet' import Snippet from './snippet.mjs'
import Svg from './svg' import Svg from './svg.mjs'
import pack from 'bin-pack' import Store from './store.mjs'
import Store from './store' import Hooks from './hooks.mjs'
import Hooks from './hooks' import Attributes from './attributes.mjs'
import Attributes from './attributes'
import pkg from '../package.json' import pkg from '../package.json'
export default function Pattern(config = { options: {} }) { export default function Pattern(config = { options: {} }) {

View file

@ -1,4 +1,4 @@
import Attributes from './attributes' import Attributes from './attributes.mjs'
function Point(x, y, debug = false) { function Point(x, y, debug = false) {
this.x = x this.x = x

View file

@ -1,4 +1,4 @@
import Attributes from './attributes' import Attributes from './attributes.mjs'
function Snippet(def, anchor, debug = false) { function Snippet(def, anchor, debug = false) {
this.def = def this.def = def

View file

@ -1,5 +1,5 @@
import Attributes from './attributes' import Attributes from './attributes.mjs'
import { round } from './utils' import { round } from './utils.mjs'
import pkg from '../package.json' import pkg from '../package.json'
function Svg(pattern) { function Svg(pattern) {

View file

@ -1,6 +1,6 @@
import Path from './path'
import Point from './point'
import { Bezier } from 'bezier-js' import { Bezier } from 'bezier-js'
import Path from './path.mjs'
import Point from './point.mjs'
export function capitalize(string) { export function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1) return string.charAt(0).toUpperCase() + string.slice(1)