Make Astro compatible with Windows (#215)

This commit is contained in:
木杉 2021-05-18 06:52:11 +08:00 committed by GitHub
parent d6cedac38e
commit cce8ac72e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 9 deletions

View file

@ -8,8 +8,8 @@
"build:core": "lerna run build --scope astro --scope astro-parser --scope create-astro",
"build:vscode": "lerna run build --scope astro-languageserver --scope astro-vscode --scope astro-parser",
"dev:vscode": "lerna run dev --scope astro-languageserver --scope astro-vscode --scope astro-parser --parallel --stream",
"format": "prettier -w '**/*.{js,jsx,ts,tsx,md,json}'",
"lint": "eslint 'packages/**/*.ts'",
"format": "prettier -w \"**/*.{js,jsx,ts,tsx,md,json}\"",
"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"

View file

@ -11,8 +11,8 @@
],
"scripts": {
"prepublish": "yarn build",
"build": "astro-scripts build 'src/**/*.ts' && tsc -p tsconfig.json",
"dev": "astro-scripts dev 'src/**/*.ts'"
"build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
"dev": "astro-scripts dev \"src/**/*.ts\""
},
"devDependencies": {
"astro-scripts": "0.0.1"

View file

@ -25,9 +25,9 @@
"astro.mjs"
],
"scripts": {
"build": "astro-scripts build 'src/*.ts' 'src/compiler/index.ts' 'src/frontend/**/*.ts' && tsc",
"postbuild": "astro-scripts copy 'src/**/*.astro'",
"dev": "astro-scripts dev 'src/**/*.ts'",
"build": "astro-scripts build \"src/*.ts\" \"src/compiler/index.ts\" \"src/frontend/**/*.ts\" && tsc",
"postbuild": "astro-scripts copy \"src/**/*.astro\"",
"dev": "astro-scripts dev \"src/**/*.ts\"",
"test": "uvu test -i fixtures -i test-utils.js"
},
"dependencies": {

View file

@ -10,7 +10,7 @@
},
"scripts": {
"build": "astro-scripts build src/index.tsx",
"postbuild": "astro-scripts copy 'src/templates/**' --tgz"
"postbuild": "astro-scripts copy \"src/templates/**\" --tgz"
},
"files": [
"dist",

View file

@ -1,9 +1,11 @@
import { promises as fs, readFileSync } from 'fs';
import { resolve, dirname, sep, join } from 'path';
import { posix } from 'path';
import arg from 'arg';
import glob from 'globby';
import tar from 'tar';
const { resolve, dirname, sep, join } = posix;
/** @type {import('arg').Spec} */
const spec = {
'--tgz': Boolean,