-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- big steps on the road to `{"strict", true}` ## Type of change **PATCH: backwards compatible change**
- Loading branch information
1 parent
b8e63c4
commit 7c54dd8
Showing
131 changed files
with
1,058 additions
and
877 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,20 @@ | ||
import {join, relative} from 'node:path' | ||
|
||
import {path} from '@repo/constants' | ||
import globby from '@roots/bud-support/globby' | ||
|
||
const packages = await globby(path(`sources/@roots/*`), { | ||
absolute: true, | ||
onlyDirectories: true, | ||
}) | ||
|
||
export default { | ||
'@roots/bud': path(`sources/@roots/bud/src`), | ||
'@roots/bud-api': path(`sources/@roots/bud-api/src`), | ||
'@roots/bud-api/methods': path(`sources/@roots/bud-api/src/methods`), | ||
'@roots/bud-api/service': path(`sources/@roots/bud-api/src/service`), | ||
'@roots/bud-babel': path(`sources/@roots/bud-babel/src`), | ||
'@roots/bud-build': path(`sources/@roots/bud-build/src`), | ||
'@roots/bud-build/handlers': path( | ||
`sources/@roots/bud-build/src/handlers`, | ||
), | ||
'@roots/bud-cache': path(`sources/@roots/bud-cache/src`), | ||
'@roots/bud-compiler': path(`sources/@roots/bud-compiler/src`), | ||
'@roots/bud-compress': path(`sources/@roots/bud-compress/src`), | ||
'@roots/bud-dashboard': path(`sources/@roots/bud-dashboard/src`), | ||
'@roots/bud-extensions': path(`sources/@roots/bud-extensions/src`), | ||
'@roots/bud-framework': path(`sources/@roots/bud-framework/src`), | ||
'@roots/bud-framework/extension': path( | ||
`sources/@roots/bud-framework/src/extension`, | ||
), | ||
'@roots/bud-framework/extension/decorators': path( | ||
`sources/@roots/bud-framework/src/extension/decorators`, | ||
), | ||
'@roots/bud-hooks': path(`sources/@roots/bud-hooks/src`), | ||
'@roots/bud-preset-react': path(`sources/@roots/bud-preset-react/src`), | ||
'@roots/bud-preset-recommend': path( | ||
`sources/@roots/bud-preset-recommend/src`, | ||
), | ||
'@roots/bud-react': path(`sources/@roots/bud-react/src`), | ||
'@roots/bud-sass': path(`sources/@roots/bud-sass/src`), | ||
'@roots/bud-server': path(`sources/@roots/bud-server/src`), | ||
'@roots/bud-server/middleware': path( | ||
`sources/@roots/bud-server/src/middleware`, | ||
), | ||
'@roots/bud-support': path(`sources/@roots/bud-support/src`), | ||
'@roots/bud-swc': path(`sources/@roots/bud-swc/src`), | ||
'@roots/bud-tailwindcss-theme-json': path( | ||
`sources/@roots/bud-tailwindcss-theme-json/src`, | ||
), | ||
'@roots/bud-wordpress-externals': path( | ||
`sources/@roots/bud-wordpress-externals/src`, | ||
), | ||
'@roots/bud/services': path(`sources/@roots/bud/src/services`), | ||
'@roots/container': path(`sources/@roots/container/src`), | ||
'@roots/entrypoints-webpack-plugin': path( | ||
`sources/@roots/entrypoints-webpack-plugin/src`, | ||
), | ||
'@roots/sage': path(`sources/@roots/sage/src`), | ||
'@roots/wordpress-dependencies-webpack-plugin': path( | ||
`sources/@roots/wordpress-dependencies-webpack-plugin/src`, | ||
), | ||
'@roots/wordpress-externals-webpack-plugin': path( | ||
`sources/@roots/wordpress-externals-webpack-plugin/src`, | ||
), | ||
'@roots/wordpress-hmr': path(`sources/@roots/wordpress-hmr/src`), | ||
'@roots/wordpress-hmr/loader': path( | ||
`sources/@roots/wordpress-hmr/src/loader`, | ||
...packages.reduce((aliases, packageRoot) => { | ||
const signifier = relative(path(), packageRoot) | ||
aliases[signifier] = join(packageRoot, `src`) | ||
return aliases | ||
}, {}), | ||
'@roots/filesystem/src/vendor/sdk': path( | ||
`sources/@roots/filesystem/vendor/sdk`, | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
import type {TemplateDelegate} from 'handlebars' | ||
import type { TemplateDelegate } from "handlebars"; | ||
|
||
import {path} from '@repo/constants' | ||
import fs from 'fs-jetpack' | ||
import {globby} from 'globby' | ||
import Handlebars from 'handlebars' | ||
import { path } from "@repo/constants"; | ||
import fs from "fs-jetpack"; | ||
import { globby } from "globby"; | ||
import Handlebars from "handlebars"; | ||
|
||
let handlebars = Handlebars | ||
let handlebars = Handlebars; | ||
|
||
const sources = await globby([ | ||
path(`sources/@repo/markdown-kit/readme/partials/*.md`), | ||
]) | ||
]); | ||
|
||
const partials = await sources.reduce(async (promised, filePath) => { | ||
const dictionary = await promised | ||
const templateSource = await fs.readAsync(filePath).then(String) | ||
const dictionary = await promised; | ||
const templateSource = await fs.readAsync(filePath).then(String); | ||
|
||
const lastSegment = filePath.split(`/`).pop(); | ||
if (!lastSegment) return dictionary; | ||
|
||
return { | ||
...dictionary, | ||
[`${filePath.split(`/`).pop().split(`.`).shift()}`]: templateSource, | ||
} | ||
}, Promise.resolve({})) | ||
[`${lastSegment.split(`.`).shift()}`]: templateSource, | ||
}; | ||
}, Promise.resolve({})); | ||
|
||
handlebars.registerPartial(partials) | ||
partials && handlebars.registerPartial(partials); | ||
|
||
handlebars.registerHelper(`dotPath`, function (context, options) { | ||
return `${options.fn(this).replace(/\./, options.data.root.name)}` | ||
}) | ||
return `${options.fn(this).replace(/\./, options.data.root.name)}`; | ||
}); | ||
|
||
handlebars.registerHelper(`raw`, function (context) { | ||
return context.fn(this) | ||
}) | ||
return context.fn(this); | ||
}); | ||
|
||
export {handlebars, Handlebars} | ||
export type {TemplateDelegate} | ||
export { handlebars, Handlebars }; | ||
export type { TemplateDelegate }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import type {Factory} from './index.js' | ||
|
||
export const plugins: Factory<`plugins`> = async app => | ||
await app.hooks.filterAsync(`build.plugins`, await app.extensions.make()) | ||
export const plugins: Factory<`plugins`> = async app => { | ||
const plugins = await app.extensions.make() | ||
return await app.hooks.filterAsync(`build.plugins`, plugins) | ||
} |
Oops, something went wrong.