Skip to content

fix: add concurrently for build issue #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: 'yarn'
- name: Install dependencies (apt-get)
run: |
Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
"private": true,
"devDependencies": {
"@actions/core": "^1.2.6",
"@types/glob": "^8.0.0",
"@types/glob": "^9.0.0",
"@types/image-size": "^0.8.0",
"@types/mdast": "^3.0.2",
"@types/mkdirp": "^1.0.2",
"@types/ncp": "^2.0.1",
"@types/node": "^18.11.18",
"@types/rimraf": "^4.0.5",
"@types/unist": "^2.0.3",
"@types/vfile": "^4.0.0",
"chalk": "^2.4.2",
"concurrently": "^9.1.2",
"ember-cli": "*",
"ember-dictionary": "^0.2.3",
"image-size": "^1.0.2",
Expand Down Expand Up @@ -64,5 +66,10 @@
"build": "yarn generate",
"postbuild": "yarn lint:md:dist"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"dependencies": {
"glob": "^11.0.3",
"minimatch": "^10.0.3",
"rimraf": "^6.0.1"
}
}
31 changes: 28 additions & 3 deletions src/bin/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
readFile as _readFile,
writeFile as _writeFile
} from 'fs';
import _glob from 'glob';
import { glob } from 'glob';
import mkdirp from 'mkdirp';
import { ncp as _ncp } from 'ncp';
import { basename, dirname, join, relative, sep } from 'path';
Expand All @@ -17,8 +17,6 @@ import { promisify } from 'util';
import { VFileOptions } from 'vfile';

import { doNotEdit, retinaImages, runCodeBlocks, todoLinks, zoeySays } from '../lib';

const glob = promisify(_glob);
const readFile = promisify(_readFile);
const writeFile = promisify(_writeFile);
const ncp = promisify(_ncp);
Expand Down Expand Up @@ -61,6 +59,33 @@ async function main() {

let inputPaths = await glob(pattern);

// Sort files to ensure proper dependency order (01-orientation.md must come first)
inputPaths.sort((a, b) => {
// Extract directory and filename for comparison
let aDirName = dirname(a);
let bDirName = dirname(b);
let aFileName = basename(a);
let bFileName = basename(b);

// First, sort by directory (part-1 before part-2)
if (aDirName !== bDirName) {
return aDirName.localeCompare(bDirName);
}

// Within same directory, sort by numeric prefix
let aMatch = aFileName.match(/^(\d+)-/);
let bMatch = bFileName.match(/^(\d+)-/);

if (aMatch && bMatch) {
let aNum = parseInt(aMatch[1], 10);
let bNum = parseInt(bMatch[1], 10);
return aNum - bNum;
}

// Fallback to alphabetical for files without numeric prefix
return aFileName.localeCompare(bFileName);
});

let processor = unified()
.use(markdown)
.use(frontmatter)
Expand Down
Loading
Loading