Skip to content

Commit

Permalink
Add pipeline config
Browse files Browse the repository at this point in the history
  • Loading branch information
AsPulse committed Dec 17, 2023
1 parent f5f9441 commit 62d882f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
11 changes: 10 additions & 1 deletion packages/core/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import packageJson from './package.json' assert { type: 'json' };
import { transfer } from 'multi-stage-sourcemap';
import { stderr, stdout } from 'process';

const entry = './lib.ts';
const entry = './src/lib.ts';
const tsbuildinfo = 'node_modules/.cache/tsbuildinfo.json';

consola.start('Building @sugarform/core...');
Expand Down Expand Up @@ -82,6 +82,15 @@ async function types() {
await rm(tsbuildinfo);
}

// Check both index.d.ts and index.d.ts.map exists
await Promise.all([
readFile('./dist/index.d.ts', 'utf-8'),
readFile('./dist/index.d.ts.map', 'utf-8'),
]).catch(() => {
consola.error('tsc did not generate declaration files! Ensure you ran `pnpm typecheck` before run build.');
process.exit(1);
});

consola.start('Merging Declarationmap...');
const sourcemap = transfer({
fromSourceMap: await readFile('./dist/index.d.ts.map', 'utf-8'),
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib.ts → packages/core/src/lib.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { aabbccddeeffgg } from './src/util';
import { aabbccddeeffgg } from './util';

export function hello() {
return 'a' == aabbccddeeffgg();
Expand Down
12 changes: 9 additions & 3 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"topo": {
"dependsOn": ["^topo"]
},
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**"]
"dependsOn": ["typecheck", "^build"],
"outputs": ["dist/**"]
},
"lint": {},
"typecheck": {}
"typecheck": {
"dependsOn": ["^topo"],
"outputs": ["node_modules/.cache/tsbuildinfo.json"]
}
}
}

0 comments on commit 62d882f

Please sign in to comment.