1
0
Fork 0

refactor(new-design): Coalesce the various package.json files

This commit is contained in:
Nikhil Chelliah 2022-10-14 17:39:39 -04:00
parent 332541bac5
commit 49e4496e4b
8 changed files with 15 additions and 583 deletions

View file

@ -1,5 +1,5 @@
import { config } from './config.mjs'
import { mkdir, readFile, writeFile, copyFile } from 'node:fs/promises'
import { mkdir, readFile, writeFile, copyFile, stat } from 'node:fs/promises'
import { join, dirname, relative } from 'path'
import mustache from 'mustache'
import rdir from 'recursive-readdir'
@ -18,6 +18,7 @@ try {
filename = fileURLToPath(import.meta.url)
}
const newDesignDir = join(filename, '../..')
const monorepoDesignsDir = join(newDesignDir, '../../designs')
const nl = '\n'
const tab = ' '
@ -285,10 +286,19 @@ export const createEnvironment = async (choices) => {
// Copy/Template files
try {
const templateVars = {
template: choices.template,
name: choices.name,
tag: config.tag,
}
try {
await stat(join(monorepoDesignsDir, choices.template))
if (choices.template !== 'tutorial') {
templateVars.block = choices.template
}
} catch (err) {
// fs.stat throws an error if no such file or directory exists
}
await oraPromise(copyAll(config, templateVars), {
text:
chalk.white.bold('🟨⬜⬜⬜ Copying template files') +

View file

@ -35,6 +35,9 @@
"dependencies": {
"@freesewing/core": "{{ tag }}",
"@freesewing/plugin-bundle": "{{ tag }}"
{{# block }}
, "@freesewing/{{ block }}": "{{ tag }}"
{{/ block }}
},
"devDependencies": {
"@freesewing/plugin-svgattr": "{{ tag }}",

View file

@ -1,97 +0,0 @@
{
"name": "@freesewing/{{name}}",
"version": "0.0.1",
"description": "A new FreeSewing design",
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",
"repository": "github:freesewing/freesewing",
"license": "MIT",
"bugs": {
"url": "https://github.com/freesewing/freesewing/issues"
},
"funding": {
"type": "individual",
"url": "https://freesewing.org/patrons/join"
},
"keywords": [
"freesewing",
"design",
"diy",
"fashion",
"parametric design",
"sewing",
"sewing pattern"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"dev": "node --experimental-json-modules ./node_modules/.bin/next dev -p 8000",
"build": "node build.js",
"clean": "rimraf dist",
"mbuild": "NO_MINIFY=1 node build.js",
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
"vbuild": "VERBOSE=1 node build.js"
},
"dependencies": {
"@freesewing/core": "{{ tag }}",
"@freesewing/bella": "{{ tag }}",
},
"devDependencies": {
"@freesewing/plugin-svgattr": "{{ tag }}",
"@freesewing/plugin-theme": "{{ tag }}",
"@freesewing/plugin-i18n": "{{ tag }}",
"@freesewing/models": "{{ tag }}",
"@headlessui/react": "^1.6.5",
"js-yaml": "^4.1.0",
"file-saver": "^2.0.5",
"axios": "^0.27.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-sizeme": "^3.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"react-markdown": "^8.0.3",
"roughjs": "^4.5.2",
"@tailwindcss/typography": "^0.5.2",
"d3-dispatch": "^3.0.1",
"d3-drag": "^3.0.0",
"d3-selection": "^3.0.0",
"daisyui": "^2.0.6",
"lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2",
"lodash.unset": "^4.5.2",
"lodash.clonedeep": "^4.5.0",
"next": "latest",
"next-i18next": "^11.0.0",
"react-copy-to-clipboard": "^5.0.4",
"react-hotkeys-hook": "^3.4.4",
"react-swipeable": "^6.2.0",
"react-timeago": "^6.2.1",
"mocha": "^9.1.1",
"chai": "^4.2.0",
"autoprefixer": "^10.4.0",
"eslint-config-next": "12.1.6",
"highlight.js": "^11.5.1",
"js-yaml": "^4.1.0",
"pdfkit": "^0.13.0",
"svg-to-pdfkit": "^0.1.8",
"postcss": "^8.4.14",
"postcss-for": "^2.1.1",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0",
"web-worker": "^1.2.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -1,97 +0,0 @@
{
"name": "@freesewing/{{name}}",
"version": "0.0.1",
"description": "A new FreeSewing design",
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",
"repository": "github:freesewing/freesewing",
"license": "MIT",
"bugs": {
"url": "https://github.com/freesewing/freesewing/issues"
},
"funding": {
"type": "individual",
"url": "https://freesewing.org/patrons/join"
},
"keywords": [
"freesewing",
"design",
"diy",
"fashion",
"parametric design",
"sewing",
"sewing pattern"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"dev": "node --experimental-json-modules ./node_modules/.bin/next dev -p 8000",
"build": "node build.js",
"clean": "rimraf dist",
"mbuild": "NO_MINIFY=1 node build.js",
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
"vbuild": "VERBOSE=1 node build.js"
},
"dependencies": {
"@freesewing/core": "{{ tag }}",
"@freesewing/bent": "{{ tag }}"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "{{ tag }}",
"@freesewing/plugin-theme": "{{ tag }}",
"@freesewing/plugin-i18n": "{{ tag }}",
"@freesewing/models": "{{ tag }}",
"@headlessui/react": "^1.6.5",
"js-yaml": "^4.1.0",
"file-saver": "^2.0.5",
"axios": "^0.27.2",
"pdfkit": "^0.13.0",
"svg-to-pdfkit": "^0.1.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-sizeme": "^3.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"react-markdown": "^8.0.3",
"roughjs": "^4.5.2",
"@tailwindcss/typography": "^0.5.2",
"d3-dispatch": "^3.0.1",
"d3-drag": "^3.0.0",
"d3-selection": "^3.0.0",
"daisyui": "^2.0.6",
"lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2",
"lodash.unset": "^4.5.2",
"lodash.clonedeep": "^4.5.0",
"next": "latest",
"next-i18next": "^11.0.0",
"react-copy-to-clipboard": "^5.0.4",
"react-hotkeys-hook": "^3.4.4",
"react-swipeable": "^6.2.0",
"react-timeago": "^6.2.1",
"mocha": "^9.1.1",
"chai": "^4.2.0",
"autoprefixer": "^10.4.0",
"eslint-config-next": "12.1.6",
"highlight.js": "^11.5.1",
"js-yaml": "^4.1.0",
"postcss": "^8.4.14",
"postcss-for": "^2.1.1",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0",
"web-worker": "^1.2.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -1,97 +0,0 @@
{
"name": "@freesewing/{{name}}",
"version": "0.0.1",
"description": "A new FreeSewing design",
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",
"repository": "github:freesewing/freesewing",
"license": "MIT",
"bugs": {
"url": "https://github.com/freesewing/freesewing/issues"
},
"funding": {
"type": "individual",
"url": "https://freesewing.org/patrons/join"
},
"keywords": [
"freesewing",
"design",
"diy",
"fashion",
"parametric design",
"sewing",
"sewing pattern"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"dev": "node --experimental-json-modules ./node_modules/.bin/next dev -p 8000",
"build": "node build.js",
"clean": "rimraf dist",
"mbuild": "NO_MINIFY=1 node build.js",
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
"vbuild": "VERBOSE=1 node build.js"
},
"dependencies": {
"@freesewing/core": "{{ tag }}",
"@freesewing/breanna": "{{ tag }}"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "{{ tag }}",
"@freesewing/plugin-theme": "{{ tag }}",
"@freesewing/plugin-i18n": "{{ tag }}",
"@freesewing/models": "{{ tag }}",
"@headlessui/react": "^1.6.5",
"js-yaml": "^4.1.0",
"file-saver": "^2.0.5",
"axios": "^0.27.2",
"pdfkit": "^0.13.0",
"svg-to-pdfkit": "^0.1.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-sizeme": "^3.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"react-markdown": "^8.0.3",
"roughjs": "^4.5.2",
"@tailwindcss/typography": "^0.5.2",
"d3-dispatch": "^3.0.1",
"d3-drag": "^3.0.0",
"d3-selection": "^3.0.0",
"daisyui": "^2.0.6",
"lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2",
"lodash.unset": "^4.5.2",
"lodash.clonedeep": "^4.5.0",
"next": "latest",
"next-i18next": "^11.0.0",
"react-copy-to-clipboard": "^5.0.4",
"react-hotkeys-hook": "^3.4.4",
"react-swipeable": "^6.2.0",
"react-timeago": "^6.2.1",
"mocha": "^9.1.1",
"chai": "^4.2.0",
"autoprefixer": "^10.4.0",
"eslint-config-next": "12.1.6",
"highlight.js": "^11.5.1",
"js-yaml": "^4.1.0",
"postcss": "^8.4.14",
"postcss-for": "^2.1.1",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0",
"web-worker": "^1.2.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -1,96 +0,0 @@
{
"name": "@freesewing/{{name}}",
"version": "0.0.1",
"description": "A new FreeSewing design",
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",
"repository": "github:freesewing/freesewing",
"license": "MIT",
"bugs": {
"url": "https://github.com/freesewing/freesewing/issues"
},
"funding": {
"type": "individual",
"url": "https://freesewing.org/patrons/join"
},
"keywords": [
"freesewing",
"design",
"diy",
"fashion",
"parametric design",
"sewing",
"sewing pattern"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"dev": "node --experimental-json-modules ./node_modules/.bin/next dev -p 8000",
"build": "node build.js",
"clean": "rimraf dist",
"mbuild": "NO_MINIFY=1 node build.js",
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
"vbuild": "VERBOSE=1 node build.js"
},
"dependencies": {
"@freesewing/core": "{{ tag }}",
"@freesewing/brian": "{{ tag }}"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "{{ tag }}",
"@freesewing/plugin-theme": "{{ tag }}",
"@freesewing/plugin-i18n": "{{ tag }}",
"@freesewing/models": "{{ tag }}",
"@headlessui/react": "^1.6.5",
"js-yaml": "^4.1.0",
"file-saver": "^2.0.5",
"axios": "^0.27.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-sizeme": "^3.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"react-markdown": "^8.0.3",
"@tailwindcss/typography": "^0.5.2",
"d3-dispatch": "^3.0.1",
"d3-drag": "^3.0.0",
"d3-selection": "^3.0.0",
"daisyui": "^2.0.6",
"lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2",
"lodash.unset": "^4.5.2",
"lodash.clonedeep": "^4.5.0",
"next": "latest",
"next-i18next": "^11.0.0",
"react-copy-to-clipboard": "^5.0.4",
"react-hotkeys-hook": "^3.4.4",
"react-swipeable": "^6.2.0",
"react-timeago": "^6.2.1",
"mocha": "^9.1.1",
"chai": "^4.2.0",
"autoprefixer": "^10.4.0",
"eslint-config-next": "12.1.6",
"highlight.js": "^11.5.1",
"js-yaml": "^4.1.0",
"pdfkit": "^0.13.0",
"svg-to-pdfkit": "^0.1.8",
"postcss-for": "^2.1.1",
"postcss": "^8.4.14",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0",
"web-worker": "^1.2.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=6"
}
}

View file

@ -1,97 +0,0 @@
{
"name": "@freesewing/{{name}}",
"version": "0.0.1",
"description": "A new FreeSewing design",
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",
"repository": "github:freesewing/freesewing",
"license": "MIT",
"bugs": {
"url": "https://github.com/freesewing/freesewing/issues"
},
"funding": {
"type": "individual",
"url": "https://freesewing.org/patrons/join"
},
"keywords": [
"freesewing",
"design",
"diy",
"fashion",
"parametric design",
"sewing",
"sewing pattern"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"dev": "node --experimental-json-modules ./node_modules/.bin/next dev -p 8000",
"build": "node build.js",
"clean": "rimraf dist",
"mbuild": "NO_MINIFY=1 node build.js",
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
"vbuild": "VERBOSE=1 node build.js"
},
"dependencies": {
"@freesewing/core": "{{ tag }}",
"@freesewing/plugin-bundle": "{{ tag }}"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "{{ tag }}",
"@freesewing/plugin-theme": "{{ tag }}",
"@freesewing/plugin-i18n": "{{ tag }}",
"@freesewing/models": "{{ tag }}",
"@headlessui/react": "^1.6.5",
"js-yaml": "^4.1.0",
"file-saver": "^2.0.5",
"axios": "^0.27.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-sizeme": "^3.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"react-markdown": "^8.0.3",
"roughjs": "^4.5.2",
"@tailwindcss/typography": "^0.5.2",
"d3-dispatch": "^3.0.1",
"d3-drag": "^3.0.0",
"d3-selection": "^3.0.0",
"daisyui": "^2.0.6",
"lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2",
"lodash.unset": "^4.5.2",
"lodash.clonedeep": "^4.5.0",
"next": "latest",
"next-i18next": "^11.0.0",
"pdfkit": "^0.13.0",
"react-copy-to-clipboard": "^5.0.4",
"react-hotkeys-hook": "^3.4.4",
"react-swipeable": "^6.2.0",
"react-timeago": "^6.2.1",
"mocha": "^9.1.1",
"chai": "^4.2.0",
"autoprefixer": "^10.4.0",
"eslint-config-next": "12.1.6",
"highlight.js": "^11.5.1",
"js-yaml": "^4.1.0",
"postcss": "^8.4.14",
"postcss-for": "^2.1.1",
"svg-to-pdfkit": "^0.1.8",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0",
"web-worker": "^1.2.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -1,97 +0,0 @@
{
"name": "@freesewing/{{name}}",
"version": "0.0.1",
"description": "A new FreeSewing design",
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",
"repository": "github:freesewing/freesewing",
"license": "MIT",
"bugs": {
"url": "https://github.com/freesewing/freesewing/issues"
},
"funding": {
"type": "individual",
"url": "https://freesewing.org/patrons/join"
},
"keywords": [
"freesewing",
"design",
"diy",
"fashion",
"parametric design",
"sewing",
"sewing pattern"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"dev": "node --experimental-json-modules ./node_modules/.bin/next dev -p 8000",
"build": "node build.js",
"clean": "rimraf dist",
"mbuild": "NO_MINIFY=1 node build.js",
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
"vbuild": "VERBOSE=1 node build.js"
},
"dependencies": {
"@freesewing/core": "{{ tag }}",
"@freesewing/titan": "{{ tag }}"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "{{ tag }}",
"@freesewing/plugin-theme": "{{ tag }}",
"@freesewing/plugin-i18n": "{{ tag }}",
"@freesewing/models": "{{ tag }}",
"@headlessui/react": "^1.6.5",
"js-yaml": "^4.1.0",
"file-saver": "^2.0.5",
"axios": "^0.27.2",
"react": "^17.0.2",
"svg-to-pdfkit": "^0.1.8",
"react-dom": "^17.0.2",
"pdfkit": "^0.13.0",
"react-sizeme": "^3.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"react-markdown": "^8.0.3",
"roughjs": "^4.5.2",
"@tailwindcss/typography": "^0.5.2",
"d3-dispatch": "^3.0.1",
"d3-drag": "^3.0.0",
"d3-selection": "^3.0.0",
"daisyui": "^2.0.6",
"lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2",
"lodash.unset": "^4.5.2",
"lodash.clonedeep": "^4.5.0",
"next": "latest",
"next-i18next": "^11.0.0",
"react-copy-to-clipboard": "^5.0.4",
"react-hotkeys-hook": "^3.4.4",
"react-swipeable": "^6.2.0",
"react-timeago": "^6.2.1",
"mocha": "^9.1.1",
"chai": "^4.2.0",
"autoprefixer": "^10.4.0",
"eslint-config-next": "12.1.6",
"highlight.js": "^11.5.1",
"js-yaml": "^4.1.0",
"postcss": "^8.4.14",
"postcss-for": "^2.1.1",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0",
"web-worker": "^1.2.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}