Clean dependencies (#166)

* Clean dependencies

This moves some dependencies around where they should be

* Formatting
This commit is contained in:
Drew Powers 2021-05-03 11:47:51 -06:00 committed by GitHub
parent c74f3e70f1
commit 4ff3add50f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 85 additions and 78 deletions

View file

@ -5,6 +5,7 @@
"release": "yarn build && yarn changeset publish", "release": "yarn build && yarn changeset publish",
"build": "yarn build:core", "build": "yarn build:core",
"build:core": "lerna run build --scope astro --scope astro-parser --scope create-astro", "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": "yarn test:core && yarn test:prettier",
"test:core": "cd packages/astro && npm test", "test:core": "cd packages/astro && npm test",
"test:prettier": "cd tools/prettier-plugin-astro && npm test", "test:prettier": "cd tools/prettier-plugin-astro && npm test",
@ -23,11 +24,18 @@
"yarn": "1.22.10" "yarn": "1.22.10"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.18.0",
"cheerio": "^1.0.0-rc.5", "cheerio": "^1.0.0-rc.5",
"cheerio-select-tmp": "^0.1.1", "cheerio-select-tmp": "^0.1.1",
"del": "^6.0.0", "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", "lerna": "^4.0.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"tiny-glob": "^0.2.8",
"typescript": "^4.2.4", "typescript": "^4.2.4",
"uvu": "^0.5.1", "uvu": "^0.5.1",
"eslint": "^7.22.0", "eslint": "^7.22.0",

View file

@ -40,6 +40,7 @@
"astro-parser": "0.0.9", "astro-parser": "0.0.9",
"autoprefixer": "^10.2.5", "autoprefixer": "^10.2.5",
"cheerio": "^1.0.0-rc.5", "cheerio": "^1.0.0-rc.5",
"domhandler": "^4.1.0",
"es-module-lexer": "^0.4.1", "es-module-lexer": "^0.4.1",
"esbuild": "^0.10.1", "esbuild": "^0.10.1",
"estree-walker": "^3.0.0", "estree-walker": "^3.0.0",
@ -72,14 +73,12 @@
"sass": "^1.32.8", "sass": "^1.32.8",
"snowpack": "^3.3.7", "snowpack": "^3.3.7",
"svelte": "^3.35.0", "svelte": "^3.35.0",
"tiny-glob": "^0.2.8",
"unified": "^9.2.1", "unified": "^9.2.1",
"vue": "^3.0.10", "vue": "^3.0.10",
"yargs-parser": "^20.2.7" "yargs-parser": "^20.2.7"
}, },
"devDependencies": { "devDependencies": {
"astro-scripts": "0.0.1", "@babel/types": "^7.14.0",
"@babel/types": "^7.13.14",
"@types/babel__code-frame": "^7.0.2", "@types/babel__code-frame": "^7.0.2",
"@types/babel__generator": "^7.6.2", "@types/babel__generator": "^7.6.2",
"@types/babel__parser": "^7.1.1", "@types/babel__parser": "^7.1.1",
@ -91,10 +90,7 @@
"@types/react-dom": "^17.0.2", "@types/react-dom": "^17.0.2",
"@types/sass": "^1.16.0", "@types/sass": "^1.16.0",
"@types/yargs-parser": "^20.2.0", "@types/yargs-parser": "^20.2.0",
"del": "^6.0.0", "astro-scripts": "0.0.1"
"domhandler": "^4.1.0",
"execa": "^5.0.0",
"typescript": "^4.2.3"
}, },
"engines": { "engines": {
"node": ">=14.0.0", "node": ">=14.0.0",

View file

@ -1,30 +1,30 @@
{ {
"name": "create-astro", "name": "create-astro",
"version": "0.1.0", "version": "0.1.0",
"type": "module", "type": "module",
"exports": { "exports": {
".": "./create-astro.js" ".": "./create-astro.js"
}, },
"bin": { "bin": {
"create-astro": "./create-astro.js" "create-astro": "./create-astro.js"
}, },
"scripts": { "scripts": {
"build": "astro-scripts build src/index.tsx", "build": "astro-scripts build src/index.tsx",
"postbuild": "astro-scripts copy 'src/templates/**' --tgz" "postbuild": "astro-scripts copy 'src/templates/**' --tgz"
}, },
"files": [ "files": [
"dist", "dist",
"create-astro.js" "create-astro.js"
], ],
"dependencies": { "dependencies": {
"decompress": "^4.2.1", "decompress": "^4.2.1",
"ink": "^3.0.8", "ink": "^3.0.8",
"ink-select-input": "^4.2.0", "ink-select-input": "^4.2.0",
"ink-text-input": "^4.0.1", "ink-text-input": "^4.0.1",
"react": "~17.0.2", "react": "~17.0.2",
"source-map-support": "^0.5.19" "source-map-support": "^0.5.19"
}, },
"devDependencies": { "devDependencies": {
"astro-scripts": "0.0.1" "astro-scripts": "0.0.1"
} }
} }

View file

@ -33,17 +33,22 @@ export default async function copy() {
Object.entries(templates).map(([template, files]) => { Object.entries(templates).map(([template, files]) => {
const cwd = resolve(join(rootDir, template)); const cwd = resolve(join(rootDir, template));
const dest = join(destDir, `${template}.tgz`); 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) { if (metafile) {
files = files.filter(f => f !== metafile); files = files.filter((f) => f !== metafile);
meta[template] = JSON.parse(readFileSync(metafile).toString()); meta[template] = JSON.parse(readFileSync(metafile).toString());
} }
return fs.mkdir(dirname(dest), { recursive: true }).then(() => tar.create({ return fs.mkdir(dirname(dest), { recursive: true }).then(() =>
gzip: true, tar.create(
portable: true, {
file: dest, gzip: true,
cwd, portable: true,
}, files.map(f => f.replace(cwd, '').slice(1)))); file: dest,
cwd,
},
files.map((f) => f.replace(cwd, '').slice(1))
)
);
}) })
).then(() => { ).then(() => {
if (Object.keys(meta).length > 0) { if (Object.keys(meta).length > 0) {
@ -53,10 +58,12 @@ export default async function copy() {
} }
const files = await glob(patterns); const files = await glob(patterns);
await Promise.all(files.map(file => { await Promise.all(
files.map((file) => {
const dest = resolve(file.replace(/^[^/]+/, 'dist')); 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) { function resolveRootDir(files) {

View file

@ -1,19 +1,19 @@
#!/usr/bin/env node #!/usr/bin/env node
export default async function run() { export default async function run() {
const [cmd, ...args] = process.argv.slice(2); const [cmd, ...args] = process.argv.slice(2);
switch (cmd) { switch (cmd) {
case 'dev': case 'dev':
case 'build': { case 'build': {
const { default: build } = await import('./cmd/build.js'); const { default: build } = await import('./cmd/build.js');
build(...args, cmd === 'dev' ? 'IS_DEV' : undefined); build(...args, cmd === 'dev' ? 'IS_DEV' : undefined);
break; break;
}
case 'copy': {
const { default: copy } = await import('./cmd/copy.js');
copy(...args);
break;
}
} }
case 'copy': {
const { default: copy } = await import('./cmd/copy.js');
copy(...args);
break;
}
}
} }
run(); run();

View file

@ -272,7 +272,7 @@
debug "^4.1.0" debug "^4.1.0"
globals "^11.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" version "7.14.0"
resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.0.tgz" resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.0.tgz"
integrity sha512-O2LVLdcnWplaGxiPBz12d0HcdN8QdxdsWYhz5LSeuukV/5mn2xUUc3gBeU4QBYPJ18g/UToe8F532XJ608prmg== integrity sha512-O2LVLdcnWplaGxiPBz12d0HcdN8QdxdsWYhz5LSeuukV/5mn2xUUc3gBeU4QBYPJ18g/UToe8F532XJ608prmg==
@ -1532,7 +1532,7 @@
"@types/json-schema@^7.0.3": "@types/json-schema@^7.0.3":
version "7.0.7" 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== integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
"@types/mdast@^3.0.0", "@types/mdast@^3.0.3": "@types/mdast@^3.0.0", "@types/mdast@^3.0.3":
@ -1658,7 +1658,7 @@
"@typescript-eslint/eslint-plugin@^4.18.0": "@typescript-eslint/eslint-plugin@^4.18.0":
version "4.22.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== integrity sha512-U8SP9VOs275iDXaL08Ln1Fa/wLXfj5aTr/1c0t0j6CdbOnxh+TruXu1p4I0NAvdPBQgoPjHsgKn28mOi0FzfoA==
dependencies: dependencies:
"@typescript-eslint/experimental-utils" "4.22.0" "@typescript-eslint/experimental-utils" "4.22.0"
@ -1672,7 +1672,7 @@
"@typescript-eslint/experimental-utils@4.22.0": "@typescript-eslint/experimental-utils@4.22.0":
version "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== integrity sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg==
dependencies: dependencies:
"@types/json-schema" "^7.0.3" "@types/json-schema" "^7.0.3"
@ -1684,7 +1684,7 @@
"@typescript-eslint/parser@^4.18.0": "@typescript-eslint/parser@^4.18.0":
version "4.22.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== integrity sha512-z/bGdBJJZJN76nvAY9DkJANYgK3nlRstRRi74WHm3jjgf2I8AglrSY+6l7ogxOmn55YJ6oKZCLLy+6PW70z15Q==
dependencies: dependencies:
"@typescript-eslint/scope-manager" "4.22.0" "@typescript-eslint/scope-manager" "4.22.0"
@ -1694,7 +1694,7 @@
"@typescript-eslint/scope-manager@4.22.0": "@typescript-eslint/scope-manager@4.22.0":
version "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== integrity sha512-OcCO7LTdk6ukawUM40wo61WdeoA7NM/zaoq1/2cs13M7GyiF+T4rxuA4xM+6LeHWjWbss7hkGXjFDRcKD4O04Q==
dependencies: dependencies:
"@typescript-eslint/types" "4.22.0" "@typescript-eslint/types" "4.22.0"
@ -1702,12 +1702,12 @@
"@typescript-eslint/types@4.22.0": "@typescript-eslint/types@4.22.0":
version "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== integrity sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA==
"@typescript-eslint/typescript-estree@4.22.0": "@typescript-eslint/typescript-estree@4.22.0":
version "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== integrity sha512-TkIFeu5JEeSs5ze/4NID+PIcVjgoU3cUQUIZnH3Sb1cEn1lBo7StSV5bwPuJQuoxKXlzAObjYTilOEKRuhR5yg==
dependencies: dependencies:
"@typescript-eslint/types" "4.22.0" "@typescript-eslint/types" "4.22.0"
@ -1720,7 +1720,7 @@
"@typescript-eslint/visitor-keys@4.22.0": "@typescript-eslint/visitor-keys@4.22.0":
version "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== integrity sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw==
dependencies: dependencies:
"@typescript-eslint/types" "4.22.0" "@typescript-eslint/types" "4.22.0"
@ -4275,12 +4275,12 @@ escape-string-regexp@^2.0.0:
eslint-config-prettier@^8.1.0: eslint-config-prettier@^8.1.0:
version "8.3.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== integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==
eslint-plugin-prettier@^3.3.1: eslint-plugin-prettier@^3.3.1:
version "3.4.0" 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== integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==
dependencies: dependencies:
prettier-linter-helpers "^1.0.0" prettier-linter-helpers "^1.0.0"
@ -4312,7 +4312,7 @@ eslint-visitor-keys@^2.0.0:
eslint@^7.22.0: eslint@^7.22.0:
version "7.25.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== integrity sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw==
dependencies: dependencies:
"@babel/code-frame" "7.12.11" "@babel/code-frame" "7.12.11"
@ -11112,10 +11112,6 @@ tr46@^2.0.2:
dependencies: dependencies:
punycode "^2.1.1" 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: trim-newlines@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz" 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: tslib@^1.8.1, tslib@^1.9.0:
version "1.14.1" 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== integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tsutils@^3.17.1: tsutils@^3.17.1:
version "3.21.0" 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== integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
dependencies: dependencies:
tslib "^1.8.1" tslib "^1.8.1"
@ -11251,7 +11247,7 @@ typedarray@^0.0.6:
resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
typescript@^4.2.3, typescript@^4.2.4: typescript@^4.2.4:
version "4.2.4" version "4.2.4"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz" resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz"
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==