Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn committed Aug 31, 2023
1 parent de46053 commit 6efb292
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,59 +138,59 @@
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./build.task.ts": {
"./build.task.js": {
"default": "./dist/build.task.js",
"types": "./dist/build.task.d.ts"
},
"./check.task.ts": {
"./check.task.js": {
"default": "./dist/check.task.js",
"types": "./dist/check.task.d.ts"
},
"./clean.task.ts": {
"./clean.task.js": {
"default": "./dist/clean.task.js",
"types": "./dist/clean.task.d.ts"
},
"./commit.task.ts": {
"./commit.task.js": {
"default": "./dist/commit.task.js",
"types": "./dist/commit.task.d.ts"
},
"./deploy.task.ts": {
"./deploy.task.js": {
"default": "./dist/deploy.task.js",
"types": "./dist/deploy.task.d.ts"
},
"./dev.task.ts": {
"./dev.task.js": {
"default": "./dist/dev.task.js",
"types": "./dist/dev.task.d.ts"
},
"./format.task.ts": {
"./format.task.js": {
"default": "./dist/format.task.js",
"types": "./dist/format.task.d.ts"
},
"./gen.task.ts": {
"./gen.task.js": {
"default": "./dist/gen.task.js",
"types": "./dist/gen.task.d.ts"
},
"./help.task.ts": {
"./help.task.js": {
"default": "./dist/help.task.js",
"types": "./dist/help.task.d.ts"
},
"./lint.task.ts": {
"./lint.task.js": {
"default": "./dist/lint.task.js",
"types": "./dist/lint.task.d.ts"
},
"./publish.task.ts": {
"./publish.task.js": {
"default": "./dist/publish.task.js",
"types": "./dist/publish.task.d.ts"
},
"./test.task.ts": {
"./test.task.js": {
"default": "./dist/test.task.js",
"types": "./dist/test.task.d.ts"
},
"./typecheck.task.ts": {
"./typecheck.task.js": {
"default": "./dist/typecheck.task.js",
"types": "./dist/typecheck.task.d.ts"
},
"./upgrade.task.ts": {
"./upgrade.task.js": {
"default": "./dist/upgrade.task.js",
"types": "./dist/upgrade.task.d.ts"
},
Expand All @@ -210,15 +210,15 @@
"default": "./dist/gen/helpers/ts.js",
"types": "./dist/gen/helpers/ts.d.ts"
},
"./path/inputPath.ts": {
"./path/inputPath.js": {
"default": "./dist/path/inputPath.js",
"types": "./dist/path/inputPath.d.ts"
},
"./path/pathData.ts": {
"./path/pathData.js": {
"default": "./dist/path/pathData.js",
"types": "./dist/path/pathData.d.ts"
},
"./path/paths.ts": {
"./path/paths.js": {
"default": "./dist/path/paths.js",
"types": "./dist/path/paths.d.ts"
},
Expand Down
32 changes: 16 additions & 16 deletions src/lib/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ and finally create and return the config.
Caveats
- The built config or its built depdendencies might be stale! For now `gro dev` is the fix.
- The built config or its built dependencies might be stale! For now `gro dev` is the fix.
- The bootstrap process creates the config outside of the normal build process.
Things can go wrong if the config or its dependencies need special build behavior
that's not handled by the default TS->JS build.
Expand Down Expand Up @@ -146,22 +146,22 @@ const _loadConfig = async (

const {configSourceId} = paths;
let config: GroConfig;
if (await fs.exists(configSourceId)) {
const {buildSource} = await import('../build/buildSource.js');
await buildSource(fs, toBootstrapConfig(), dev, log);

// The project has a `gro.config.ts`, so import it.
// If it's not already built, we need to bootstrap the config and use it to compile everything.
const configBuildId = toBuildOutPath(dev, CONFIG_BUILD_CONFIG.name, CONFIG_BUILD_PATH);
if (!(await fs.exists(configBuildId))) {
throw Error(`Cannot find config build id: ${configBuildId} from ${configSourceId}`);
}
const configModule = await import(configBuildId);
validateConfigModule(configModule, configSourceId);
config = await toConfig(configModule.default, options, configSourceId, defaultConfig);
} else {
// if (await fs.exists(configSourceId)) {
// const {buildSource} = await import('../build/buildSource.js');
// await buildSource(fs, toBootstrapConfig(), dev, log);

// // The project has a `gro.config.ts`, so import it.
// // If it's not already built, we need to bootstrap the config and use it to compile everything.
// const configBuildId = toBuildOutPath(dev, CONFIG_BUILD_CONFIG.name, CONFIG_BUILD_PATH);
// if (!(await fs.exists(configBuildId))) {
// throw Error(`Cannot find config build id: ${configBuildId} from ${configSourceId}`);
// }
// const configModule = await import(configBuildId);
// validateConfigModule(configModule, configSourceId);
// config = await toConfig(configModule.default, options, configSourceId, defaultConfig);
// } else {
config = defaultConfig;
}
// }
if (applyConfigToSystem) applyConfig(config);
return config;
};
Expand Down
1 change: 1 addition & 0 deletions src/lib/path/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export const printPath = (path: string, p = paths, prefix = './'): string =>
export const printPathOrGroPath = (path: string, fromPaths = paths): string => {
const inferredPaths = pathsFromId(path);
if (fromPaths === groPaths || inferredPaths === fromPaths) {
console.log(`printPathOrGroPath path`, path);
return printPath(path, inferredPaths, '');
}
return gray(groDirBasename) + printPath(path, groPaths, '');
Expand Down

0 comments on commit 6efb292

Please sign in to comment.