Skip to content

Commit

Permalink
fix: unbuild version reduced to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Aug 3, 2024
1 parent 27ffc9e commit d3ed675
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Dependabot post-update
# name: Dependabot post-update
name: Build detection
on:
pull_request_target:
types: [opened, synchronize, reopened]
Expand All @@ -14,7 +15,7 @@ concurrency:

jobs:
post-update:
if: ${{ github.actor == 'dependabot[bot]' }}
# if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -45,5 +46,4 @@ jobs:

- name: Test and Build
run: |
pnpm run test:unit
pnpm run build
4 changes: 1 addition & 3 deletions internal/node-utils/src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export async function outputJSON(
await fs.mkdir(dir, { recursive: true });
const jsonData = JSON.stringify(data, null, spaces);
await fs.writeFile(filePath, jsonData, 'utf8');
console.log(`JSON data written to ${filePath}`);
} catch (error) {
console.error('Error writing JSON file:', error);
throw error;
Expand All @@ -22,8 +21,7 @@ export async function ensureFile(filePath: string) {
try {
const dir = dirname(filePath);
await fs.mkdir(dir, { recursive: true });
await fs.writeFile(filePath, '', { flag: 'a' }); // 'a' flag to append if file exists, otherwise create
console.log(`File ensured: ${filePath}`);
await fs.writeFile(filePath, '', { flag: 'a' });
} catch (error) {
console.error('Error ensuring file:', error);
throw error;
Expand Down
3 changes: 1 addition & 2 deletions internal/tailwind-config/src/plugins/entry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as plugin from 'tailwindcss/plugin.js';
import plugin from 'tailwindcss/plugin.js';

// @ts-expect-error Parameter 'addUtilities' implicitly has an 'any' type.
const enterAnimationPlugin = plugin(({ addUtilities }) => {
const maxChild = 5;
const utilities: Record<string, any> = {};
Expand Down
3 changes: 2 additions & 1 deletion internal/vite-config/src/plugins/inject-app-loading/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'node:fs';
import fsp from 'node:fs/promises';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';

Expand Down Expand Up @@ -62,7 +63,7 @@ async function getLoadingRawByHtmlTemplate(loadingTemplate: string) {
return;
}

const htmlRaw = fs.readFileSync(loadingPath, 'utf8');
const htmlRaw = await fsp.readFile(loadingPath, 'utf8');
return htmlRaw;
}

Expand Down
2 changes: 1 addition & 1 deletion internal/vite-config/src/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from 'node:path';

import { fs } from '@vben/node-utils';

import * as dotenv from 'dotenv';
import dotenv from 'dotenv';

/**
* 获取当前环境下生效的配置文件名
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"tailwindcss": "^3.4.7",
"turbo": "^2.0.11",
"typescript": "^5.5.4",
"unbuild": "^3.0.0-rc.7",
"unbuild": "^2.0.0",
"vite": "^5.3.5",
"vitest": "^2.0.5",
"vue-tsc": "^2.0.29"
Expand Down
Loading

0 comments on commit d3ed675

Please sign in to comment.