Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
|
4ff60b344f |
5 changed files with 191 additions and 4 deletions
47
packages/cli/package.json
Normal file
47
packages/cli/package.json
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "@astrojs/cli",
|
||||
"version": "0.0.0-beta.0",
|
||||
"type": "module",
|
||||
"author": "withastro",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/withastro/astro.git",
|
||||
"directory": "packages/cli"
|
||||
},
|
||||
"bugs": "https://github.com/withastro/astro/issues",
|
||||
"homepage": "https://astro.build",
|
||||
"exports": {
|
||||
".": "./dist/index.js"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"bin": {
|
||||
"ast": "./dist/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "astro-scripts build \"src/index.ts\" --bundle && tsc",
|
||||
"build:ci": "astro-scripts build \"src/index.ts\" --bundle",
|
||||
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
||||
"test": "mocha --exit --timeout 20000 --parallel"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"//a": "MOST PACKAGES SHOULD GO IN DEV_DEPENDENCIES! THEY WILL BE BUNDLED.",
|
||||
"//b": "DEPENDENCIES IS FOR UNBUNDLED PACKAGES",
|
||||
"dependencies": {
|
||||
"@astrojs/cli-kit": "^0.2.3",
|
||||
"execa": "^6.1.0",
|
||||
"magicast": "^0.2.10",
|
||||
"node-fetch-native": "^1.2.0",
|
||||
"which-pm-runs": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/which-pm-runs": "^1.0.0",
|
||||
"arg": "^5.0.2",
|
||||
"astro-scripts": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.14.1"
|
||||
}
|
||||
}
|
15
packages/cli/src/commands/add/index.ts
Normal file
15
packages/cli/src/commands/add/index.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { loadFile, writeFile } from "magicast";
|
||||
|
||||
async function updateConfig() {
|
||||
try {
|
||||
const mod = await loadFile("config.js");
|
||||
|
||||
mod.exports.default.foo.push("b");
|
||||
|
||||
await writeFile(mod);
|
||||
} catch (e) {
|
||||
console.error('Unable to update config.js')
|
||||
console.error('Please update it manually with the following instructions: ...')
|
||||
// handle error
|
||||
}
|
||||
}
|
0
packages/cli/src/index.ts
Normal file
0
packages/cli/src/index.ts
Normal file
13
packages/cli/tsconfig.json
Normal file
13
packages/cli/tsconfig.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": ["src", "index.d.ts"],
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"emitDeclarationOnly": false,
|
||||
"noEmit": true,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"outDir": "./dist",
|
||||
"declarationDir": "./dist/types"
|
||||
}
|
||||
}
|
120
pnpm-lock.yaml
120
pnpm-lock.yaml
|
@ -3568,6 +3568,34 @@ importers:
|
|||
specifier: workspace:*
|
||||
version: link:../../..
|
||||
|
||||
packages/cli:
|
||||
dependencies:
|
||||
'@astrojs/cli-kit':
|
||||
specifier: ^0.2.3
|
||||
version: 0.2.3
|
||||
execa:
|
||||
specifier: ^6.1.0
|
||||
version: 6.1.0
|
||||
magicast:
|
||||
specifier: ^0.2.10
|
||||
version: 0.2.10
|
||||
node-fetch-native:
|
||||
specifier: ^1.2.0
|
||||
version: 1.2.0
|
||||
which-pm-runs:
|
||||
specifier: ^1.1.0
|
||||
version: 1.1.0
|
||||
devDependencies:
|
||||
'@types/which-pm-runs':
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
arg:
|
||||
specifier: ^5.0.2
|
||||
version: 5.0.2
|
||||
astro-scripts:
|
||||
specifier: workspace:*
|
||||
version: link:../../scripts
|
||||
|
||||
packages/create-astro:
|
||||
dependencies:
|
||||
'@astrojs/cli-kit':
|
||||
|
@ -5517,6 +5545,14 @@ packages:
|
|||
chalk: 2.4.2
|
||||
js-tokens: 4.0.0
|
||||
|
||||
/@babel/parser@7.22.10:
|
||||
resolution: {integrity: sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@babel/types': 7.22.5
|
||||
dev: false
|
||||
|
||||
/@babel/parser@7.22.5:
|
||||
resolution: {integrity: sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
|
@ -9448,6 +9484,15 @@ packages:
|
|||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/assert@2.0.0:
|
||||
resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==}
|
||||
dependencies:
|
||||
es6-object-assign: 1.1.0
|
||||
is-nan: 1.3.2
|
||||
object-is: 1.1.5
|
||||
util: 0.12.5
|
||||
dev: false
|
||||
|
||||
/assertion-error@1.1.0:
|
||||
resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==}
|
||||
|
||||
|
@ -9458,6 +9503,13 @@ packages:
|
|||
tslib: 2.5.3
|
||||
dev: true
|
||||
|
||||
/ast-types@0.16.1:
|
||||
resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==}
|
||||
engines: {node: '>=4'}
|
||||
dependencies:
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/astring@1.8.4:
|
||||
resolution: {integrity: sha512-97a+l2LBU3Op3bBQEff79i/E4jMD2ZLFD8rHx9B6mXyB2uQwhJQYfiDqUwtfjF4QA1F2qs//N6Cw8LetMbQjcw==}
|
||||
hasBin: true
|
||||
|
@ -10789,6 +10841,10 @@ packages:
|
|||
is-date-object: 1.0.5
|
||||
is-symbol: 1.0.4
|
||||
|
||||
/es6-object-assign@1.1.0:
|
||||
resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==}
|
||||
dev: false
|
||||
|
||||
/esbuild-android-64@0.14.47:
|
||||
resolution: {integrity: sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==}
|
||||
engines: {node: '>=12'}
|
||||
|
@ -12476,6 +12532,14 @@ packages:
|
|||
is-alphabetical: 2.0.1
|
||||
is-decimal: 2.0.1
|
||||
|
||||
/is-arguments@1.1.1:
|
||||
resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
has-tostringtag: 1.0.0
|
||||
dev: false
|
||||
|
||||
/is-array-buffer@3.0.2:
|
||||
resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==}
|
||||
dependencies:
|
||||
|
@ -12568,6 +12632,13 @@ packages:
|
|||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/is-generator-function@1.0.10:
|
||||
resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
has-tostringtag: 1.0.0
|
||||
dev: false
|
||||
|
||||
/is-glob@4.0.3:
|
||||
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
@ -12586,6 +12657,14 @@ packages:
|
|||
resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==}
|
||||
dev: false
|
||||
|
||||
/is-nan@1.3.2:
|
||||
resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.2.0
|
||||
dev: false
|
||||
|
||||
/is-negative-zero@2.0.2:
|
||||
resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
@ -13187,6 +13266,14 @@ packages:
|
|||
dependencies:
|
||||
'@jridgewell/sourcemap-codec': 1.4.15
|
||||
|
||||
/magicast@0.2.10:
|
||||
resolution: {integrity: sha512-Ah2qatigknxwmoYCd9hx/mmVyrRNhDKiaWZIuW4gL6dWrAGMoOpCVkQ3VpGWARtkaJVFhe8uIphcsxDzLPQUyg==}
|
||||
dependencies:
|
||||
'@babel/parser': 7.22.10
|
||||
'@babel/types': 7.22.5
|
||||
recast: 0.23.4
|
||||
dev: false
|
||||
|
||||
/make-dir@3.1.0:
|
||||
resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
|
||||
engines: {node: '>=8'}
|
||||
|
@ -14313,6 +14400,14 @@ packages:
|
|||
/object-inspect@1.12.3:
|
||||
resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==}
|
||||
|
||||
/object-is@1.1.5:
|
||||
resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.2.0
|
||||
dev: false
|
||||
|
||||
/object-keys@1.1.1:
|
||||
resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
@ -15418,6 +15513,17 @@ packages:
|
|||
/reading-time@1.5.0:
|
||||
resolution: {integrity: sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==}
|
||||
|
||||
/recast@0.23.4:
|
||||
resolution: {integrity: sha512-qtEDqIZGVcSZCHniWwZWbRy79Dc6Wp3kT/UmDA2RJKBPg7+7k51aQBZirHmUGn5uvHf2rg8DkjizrN26k61ATw==}
|
||||
engines: {node: '>= 4'}
|
||||
dependencies:
|
||||
assert: 2.0.0
|
||||
ast-types: 0.16.1
|
||||
esprima: 4.0.1
|
||||
source-map: 0.6.1
|
||||
tslib: 2.5.3
|
||||
dev: false
|
||||
|
||||
/redent@3.0.0:
|
||||
resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
|
||||
engines: {node: '>=8'}
|
||||
|
@ -17230,6 +17336,16 @@ packages:
|
|||
/util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
|
||||
/util@0.12.5:
|
||||
resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==}
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
is-arguments: 1.1.1
|
||||
is-generator-function: 1.0.10
|
||||
is-typed-array: 1.1.10
|
||||
which-typed-array: 1.1.9
|
||||
dev: false
|
||||
|
||||
/uuid-parse@1.1.0:
|
||||
resolution: {integrity: sha512-OdmXxA8rDsQ7YpNVbKSJkNzTw2I+S5WsbMDnCtIWSQaosNAcWtFuI/YK1TjzUI6nbkgiqEyh8gWngfcv8Asd9A==}
|
||||
dev: false
|
||||
|
@ -18263,25 +18379,21 @@ packages:
|
|||
file:packages/astro/test/fixtures/css-assets/packages/font-awesome:
|
||||
resolution: {directory: packages/astro/test/fixtures/css-assets/packages/font-awesome, type: directory}
|
||||
name: '@test/astro-font-awesome-package'
|
||||
version: 0.0.1
|
||||
dev: false
|
||||
|
||||
file:packages/astro/test/fixtures/multiple-renderers/renderers/one:
|
||||
resolution: {directory: packages/astro/test/fixtures/multiple-renderers/renderers/one, type: directory}
|
||||
name: '@test/astro-renderer-one'
|
||||
version: 1.0.0
|
||||
dev: false
|
||||
|
||||
file:packages/astro/test/fixtures/multiple-renderers/renderers/two:
|
||||
resolution: {directory: packages/astro/test/fixtures/multiple-renderers/renderers/two, type: directory}
|
||||
name: '@test/astro-renderer-two'
|
||||
version: 1.0.0
|
||||
dev: false
|
||||
|
||||
file:packages/astro/test/fixtures/solid-component/deps/solid-jsx-component:
|
||||
resolution: {directory: packages/astro/test/fixtures/solid-component/deps/solid-jsx-component, type: directory}
|
||||
name: '@test/solid-jsx-component'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
solid-js: 1.7.6
|
||||
dev: false
|
||||
|
|
Loading…
Reference in a new issue