Clean dependencies (#166)
* Clean dependencies This moves some dependencies around where they should be * Formatting
This commit is contained in:
parent
c74f3e70f1
commit
4ff3add50f
6 changed files with 85 additions and 78 deletions
|
@ -5,6 +5,7 @@
|
|||
"release": "yarn build && yarn changeset publish",
|
||||
"build": "yarn build:core",
|
||||
"build:core": "lerna run build --scope astro --scope astro-parser --scope create-astro",
|
||||
"lint": "eslint 'packages/**/*.ts'",
|
||||
"test": "yarn test:core && yarn test:prettier",
|
||||
"test:core": "cd packages/astro && npm test",
|
||||
"test:prettier": "cd tools/prettier-plugin-astro && npm test",
|
||||
|
@ -23,11 +24,18 @@
|
|||
"yarn": "1.22.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
||||
"@typescript-eslint/parser": "^4.18.0",
|
||||
"cheerio": "^1.0.0-rc.5",
|
||||
"cheerio-select-tmp": "^0.1.1",
|
||||
"del": "^6.0.0",
|
||||
"eslint": "^7.25.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"execa": "^5.0.0",
|
||||
"lerna": "^4.0.0",
|
||||
"prettier": "^2.2.1",
|
||||
"tiny-glob": "^0.2.8",
|
||||
"typescript": "^4.2.4",
|
||||
"uvu": "^0.5.1",
|
||||
"eslint": "^7.22.0",
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"astro-parser": "0.0.9",
|
||||
"autoprefixer": "^10.2.5",
|
||||
"cheerio": "^1.0.0-rc.5",
|
||||
"domhandler": "^4.1.0",
|
||||
"es-module-lexer": "^0.4.1",
|
||||
"esbuild": "^0.10.1",
|
||||
"estree-walker": "^3.0.0",
|
||||
|
@ -72,14 +73,12 @@
|
|||
"sass": "^1.32.8",
|
||||
"snowpack": "^3.3.7",
|
||||
"svelte": "^3.35.0",
|
||||
"tiny-glob": "^0.2.8",
|
||||
"unified": "^9.2.1",
|
||||
"vue": "^3.0.10",
|
||||
"yargs-parser": "^20.2.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro-scripts": "0.0.1",
|
||||
"@babel/types": "^7.13.14",
|
||||
"@babel/types": "^7.14.0",
|
||||
"@types/babel__code-frame": "^7.0.2",
|
||||
"@types/babel__generator": "^7.6.2",
|
||||
"@types/babel__parser": "^7.1.1",
|
||||
|
@ -91,10 +90,7 @@
|
|||
"@types/react-dom": "^17.0.2",
|
||||
"@types/sass": "^1.16.0",
|
||||
"@types/yargs-parser": "^20.2.0",
|
||||
"del": "^6.0.0",
|
||||
"domhandler": "^4.1.0",
|
||||
"execa": "^5.0.0",
|
||||
"typescript": "^4.2.3"
|
||||
"astro-scripts": "0.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
{
|
||||
"name": "create-astro",
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./create-astro.js"
|
||||
},
|
||||
"bin": {
|
||||
"create-astro": "./create-astro.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "astro-scripts build src/index.tsx",
|
||||
"postbuild": "astro-scripts copy 'src/templates/**' --tgz"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"create-astro.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"decompress": "^4.2.1",
|
||||
"ink": "^3.0.8",
|
||||
"ink-select-input": "^4.2.0",
|
||||
"ink-text-input": "^4.0.1",
|
||||
"react": "~17.0.2",
|
||||
"source-map-support": "^0.5.19"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro-scripts": "0.0.1"
|
||||
}
|
||||
"name": "create-astro",
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./create-astro.js"
|
||||
},
|
||||
"bin": {
|
||||
"create-astro": "./create-astro.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "astro-scripts build src/index.tsx",
|
||||
"postbuild": "astro-scripts copy 'src/templates/**' --tgz"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"create-astro.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"decompress": "^4.2.1",
|
||||
"ink": "^3.0.8",
|
||||
"ink-select-input": "^4.2.0",
|
||||
"ink-text-input": "^4.0.1",
|
||||
"react": "~17.0.2",
|
||||
"source-map-support": "^0.5.19"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro-scripts": "0.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,17 +33,22 @@ export default async function copy() {
|
|||
Object.entries(templates).map(([template, files]) => {
|
||||
const cwd = resolve(join(rootDir, template));
|
||||
const dest = join(destDir, `${template}.tgz`);
|
||||
const metafile = files.find(f => f.endsWith('meta.json'));
|
||||
const metafile = files.find((f) => f.endsWith('meta.json'));
|
||||
if (metafile) {
|
||||
files = files.filter(f => f !== metafile);
|
||||
files = files.filter((f) => f !== metafile);
|
||||
meta[template] = JSON.parse(readFileSync(metafile).toString());
|
||||
}
|
||||
return fs.mkdir(dirname(dest), { recursive: true }).then(() => tar.create({
|
||||
gzip: true,
|
||||
portable: true,
|
||||
file: dest,
|
||||
cwd,
|
||||
}, files.map(f => f.replace(cwd, '').slice(1))));
|
||||
return fs.mkdir(dirname(dest), { recursive: true }).then(() =>
|
||||
tar.create(
|
||||
{
|
||||
gzip: true,
|
||||
portable: true,
|
||||
file: dest,
|
||||
cwd,
|
||||
},
|
||||
files.map((f) => f.replace(cwd, '').slice(1))
|
||||
)
|
||||
);
|
||||
})
|
||||
).then(() => {
|
||||
if (Object.keys(meta).length > 0) {
|
||||
|
@ -53,10 +58,12 @@ export default async function copy() {
|
|||
}
|
||||
|
||||
const files = await glob(patterns);
|
||||
await Promise.all(files.map(file => {
|
||||
await Promise.all(
|
||||
files.map((file) => {
|
||||
const dest = resolve(file.replace(/^[^/]+/, 'dist'));
|
||||
return fs.mkdir(dirname(dest), { recursive: true }).then(() => fs.copyFile(resolve(file), dest))
|
||||
}));
|
||||
return fs.mkdir(dirname(dest), { recursive: true }).then(() => fs.copyFile(resolve(file), dest));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
function resolveRootDir(files) {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#!/usr/bin/env node
|
||||
export default async function run() {
|
||||
const [cmd, ...args] = process.argv.slice(2);
|
||||
switch (cmd) {
|
||||
case 'dev':
|
||||
case 'build': {
|
||||
const { default: build } = await import('./cmd/build.js');
|
||||
build(...args, cmd === 'dev' ? 'IS_DEV' : undefined);
|
||||
break;
|
||||
}
|
||||
case 'copy': {
|
||||
const { default: copy } = await import('./cmd/copy.js');
|
||||
copy(...args);
|
||||
break;
|
||||
}
|
||||
const [cmd, ...args] = process.argv.slice(2);
|
||||
switch (cmd) {
|
||||
case 'dev':
|
||||
case 'build': {
|
||||
const { default: build } = await import('./cmd/build.js');
|
||||
build(...args, cmd === 'dev' ? 'IS_DEV' : undefined);
|
||||
break;
|
||||
}
|
||||
case 'copy': {
|
||||
const { default: copy } = await import('./cmd/copy.js');
|
||||
copy(...args);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
|
|
34
yarn.lock
34
yarn.lock
|
@ -272,7 +272,7 @@
|
|||
debug "^4.1.0"
|
||||
globals "^11.1.0"
|
||||
|
||||
"@babel/types@^7.0.0", "@babel/types@^7.12.0", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.14", "@babel/types@^7.14.0", "@babel/types@^7.3.0":
|
||||
"@babel/types@^7.0.0", "@babel/types@^7.12.0", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.14.0", "@babel/types@^7.3.0":
|
||||
version "7.14.0"
|
||||
resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.0.tgz"
|
||||
integrity sha512-O2LVLdcnWplaGxiPBz12d0HcdN8QdxdsWYhz5LSeuukV/5mn2xUUc3gBeU4QBYPJ18g/UToe8F532XJ608prmg==
|
||||
|
@ -1532,7 +1532,7 @@
|
|||
|
||||
"@types/json-schema@^7.0.3":
|
||||
version "7.0.7"
|
||||
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
|
||||
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
|
||||
|
||||
"@types/mdast@^3.0.0", "@types/mdast@^3.0.3":
|
||||
|
@ -1658,7 +1658,7 @@
|
|||
|
||||
"@typescript-eslint/eslint-plugin@^4.18.0":
|
||||
version "4.22.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz#3d5f29bb59e61a9dba1513d491b059e536e16dbc"
|
||||
integrity sha512-U8SP9VOs275iDXaL08Ln1Fa/wLXfj5aTr/1c0t0j6CdbOnxh+TruXu1p4I0NAvdPBQgoPjHsgKn28mOi0FzfoA==
|
||||
dependencies:
|
||||
"@typescript-eslint/experimental-utils" "4.22.0"
|
||||
|
@ -1672,7 +1672,7 @@
|
|||
|
||||
"@typescript-eslint/experimental-utils@4.22.0":
|
||||
version "4.22.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz#68765167cca531178e7b650a53456e6e0bef3b1f"
|
||||
integrity sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.3"
|
||||
|
@ -1684,7 +1684,7 @@
|
|||
|
||||
"@typescript-eslint/parser@^4.18.0":
|
||||
version "4.22.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.22.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.22.0.tgz#e1637327fcf796c641fe55f73530e90b16ac8fe8"
|
||||
integrity sha512-z/bGdBJJZJN76nvAY9DkJANYgK3nlRstRRi74WHm3jjgf2I8AglrSY+6l7ogxOmn55YJ6oKZCLLy+6PW70z15Q==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "4.22.0"
|
||||
|
@ -1694,7 +1694,7 @@
|
|||
|
||||
"@typescript-eslint/scope-manager@4.22.0":
|
||||
version "4.22.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.22.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.22.0.tgz#ed411545e61161a8d702e703a4b7d96ec065b09a"
|
||||
integrity sha512-OcCO7LTdk6ukawUM40wo61WdeoA7NM/zaoq1/2cs13M7GyiF+T4rxuA4xM+6LeHWjWbss7hkGXjFDRcKD4O04Q==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.22.0"
|
||||
|
@ -1702,12 +1702,12 @@
|
|||
|
||||
"@typescript-eslint/types@4.22.0":
|
||||
version "4.22.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.22.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.22.0.tgz#0ca6fde5b68daf6dba133f30959cc0688c8dd0b6"
|
||||
integrity sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA==
|
||||
|
||||
"@typescript-eslint/typescript-estree@4.22.0":
|
||||
version "4.22.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.0.tgz#b5d95d6d366ff3b72f5168c75775a3e46250d05c"
|
||||
integrity sha512-TkIFeu5JEeSs5ze/4NID+PIcVjgoU3cUQUIZnH3Sb1cEn1lBo7StSV5bwPuJQuoxKXlzAObjYTilOEKRuhR5yg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.22.0"
|
||||
|
@ -1720,7 +1720,7 @@
|
|||
|
||||
"@typescript-eslint/visitor-keys@4.22.0":
|
||||
version "4.22.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz#169dae26d3c122935da7528c839f42a8a42f6e47"
|
||||
integrity sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.22.0"
|
||||
|
@ -4275,12 +4275,12 @@ escape-string-regexp@^2.0.0:
|
|||
|
||||
eslint-config-prettier@^8.1.0:
|
||||
version "8.3.0"
|
||||
resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
|
||||
integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==
|
||||
|
||||
eslint-plugin-prettier@^3.3.1:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7"
|
||||
integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==
|
||||
dependencies:
|
||||
prettier-linter-helpers "^1.0.0"
|
||||
|
@ -4312,7 +4312,7 @@ eslint-visitor-keys@^2.0.0:
|
|||
|
||||
eslint@^7.22.0:
|
||||
version "7.25.0"
|
||||
resolved "https://registry.npmjs.org/eslint/-/eslint-7.25.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.25.0.tgz#1309e4404d94e676e3e831b3a3ad2b050031eb67"
|
||||
integrity sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw==
|
||||
dependencies:
|
||||
"@babel/code-frame" "7.12.11"
|
||||
|
@ -11112,10 +11112,6 @@ tr46@^2.0.2:
|
|||
dependencies:
|
||||
punycode "^2.1.1"
|
||||
|
||||
tree-kill@^1.2.2:
|
||||
version "1.2.2"
|
||||
resolved "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz"
|
||||
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==
|
||||
trim-newlines@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz"
|
||||
|
@ -11153,12 +11149,12 @@ trough@^1.0.0:
|
|||
|
||||
tslib@^1.8.1, tslib@^1.9.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tsutils@^3.17.1:
|
||||
version "3.21.0"
|
||||
resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
|
||||
integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
@ -11251,7 +11247,7 @@ typedarray@^0.0.6:
|
|||
resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@^4.2.3, typescript@^4.2.4:
|
||||
typescript@^4.2.4:
|
||||
version "4.2.4"
|
||||
resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz"
|
||||
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==
|
||||
|
|
Loading…
Reference in a new issue