Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tlouisse committed May 13, 2024
1 parent 20a8711 commit 2446dd1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Verify changes
runs-on: ubuntu-latest
steps:
# - uses: google/wireit@setup-github-actions-caching/v1
- uses: google/wireit@setup-github-actions-caching/v1
- uses: actions/checkout@v4

- name: Sanity check
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
node-version: [18.x]
os: [windows-latest]
steps:
# - uses: google/wireit@setup-github-actions-caching/v1
- uses: google/wireit@setup-github-actions-caching/v1
- uses: actions/checkout@v4

- name: Setup Node ${{ matrix.node-version }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/* eslint-disable import/no-extraneous-dependencies */
import path from 'path';
import { performance } from 'perf_hooks';
import { _providenceModule } from '../program/providence.js';
import { QueryService } from '../program/core/QueryService.js';
import path from 'path';

import { InputDataService } from '../program/core/InputDataService.js';
import { LogService } from '../program/core/LogService.js';
import { flatten } from './cli-helpers.js';
import MatchPathsAnalyzer from '../program/analyzers/match-paths.js';
import { toPosixPath } from '../program/utils/to-posix-path.js';
import { QueryService } from '../program/core/QueryService.js';
import { _providenceModule } from '../program/providence.js';
import { LogService } from '../program/core/LogService.js';
import { fsAdapter } from '../program/utils/fs-adapter.js';
import { flatten } from './cli-helpers.js';

/**
* @typedef {import('../../types/index.js').PathFromSystemRoot} PathFromSystemRoot
Expand All @@ -27,10 +29,10 @@ import { fsAdapter } from '../program/utils/fs-adapter.js';
*/
export async function getExtendDocsResults({
referenceProjectPaths,
prefixCfg,
allowlistReference,
extensions,
prefixCfg,
allowlist,
allowlistReference,
cwd,
}) {
const monoPkgs = await InputDataService.getMonoRepoPackages(cwd);
Expand Down Expand Up @@ -71,7 +73,7 @@ export async function getExtendDocsResults({
const normalizedP = `./${p}`;
if (pathStr.startsWith(normalizedP)) {
const localPath = pathStr.replace(normalizedP, ''); // 'lea-tabs.js'
result = path.join(name, localPath); // 'lea-tabs/lea-tabs.js'
result = toPosixPath(path.join(name, localPath)); // 'lea-tabs/lea-tabs.js'
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-param-reassign */
import path from 'path';

import { isRelativeSourcePath } from '../../utils/relative-source-path.js';
import { resolveImportPath } from '../../utils/resolve-import-path.js';
import { toPosixPath } from '../../utils/to-posix-path.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ function getClosestToRootTargetPath(targetPaths, targetExportsResult) {
}

/**
*
* @param {FindExportsAnalyzerResult} targetExportsResult
* @param {FindExportsAnalyzerResult} refFindExportsResult
* @param {string} targetMatchedFile file where `toClass` from match-subclasses is defined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-continue */
import pathLib from 'path';
import path from 'path';
/* eslint-disable no-shadow, no-param-reassign */
import FindClassesAnalyzer from './find-classes.js';
import FindExportsAnalyzer from './find-exports.js';
Expand Down Expand Up @@ -126,7 +126,7 @@ async function matchSubclassesPostprocess(
const importProjectPath = cfg.targetProjectPath;
for (const { result, file } of targetClassesAnalyzerResult.queryOutput) {
const importerFilePath = /** @type {PathFromSystemRoot} */ (
pathLib.resolve(importProjectPath, file)
path.resolve(importProjectPath, file)
);
for (const classEntryResult of result) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import nodeFs from 'fs';
import path from 'path';

import { toPosixPath } from './to-posix-path.js';

const [nodeMajor] = process.versions.node.split('.').map(Number);

if (nodeMajor < 18) {
Expand Down Expand Up @@ -211,7 +213,7 @@ export async function optimisedGlob(globOrGlobs, providedOptions = {}) {

// Search for the "deepest" starting point in the filesystem that we can use to search the fs
const startPath = getStartPath(globNormalized);
const fullStartPath = path.posix.join(options.cwd, startPath);
const fullStartPath = path.join(options.cwd, startPath);

try {
const allDirentsRelativeToStartPath = await getAllFilesFromStartPath(fullStartPath, {
Expand All @@ -220,7 +222,10 @@ export async function optimisedGlob(globOrGlobs, providedOptions = {}) {

const allDirEntsRelativeToCwd = allDirentsRelativeToStartPath.map(dirent => ({
// @ts-expect-error
relativeToCwdPath: path.posix.join(dirent.path, dirent.name).replace(`${options.cwd}/`, ''),
relativeToCwdPath: toPosixPath(path.join(dirent.path, dirent.name)).replace(
`${options.cwd}/`,
'',
),

dirent,
}));
Expand Down

0 comments on commit 2446dd1

Please sign in to comment.