ng-packagr 17.2.0-rc.0 → 17.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -60,7 +60,7 @@ async function loadPostcssConfiguration(projectRoot) {
|
|
|
60
60
|
}
|
|
61
61
|
const config = { plugins: [] };
|
|
62
62
|
for (const [name, options] of entries) {
|
|
63
|
-
if (!options || typeof options !== 'object') {
|
|
63
|
+
if (!options || (typeof options !== 'object' && typeof options !== 'string')) {
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
66
|
config.plugins.push([name, options]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcss-configuration.js","sourceRoot":"","sources":["../../../src/lib/styles/postcss-configuration.ts"],"names":[],"mappings":";;;AAAA,+CAAqD;AACrD,yCAAiC;AAUjC,MAAM,yBAAyB,GAAa,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;AAOvF,KAAK,UAAU,yBAAyB,CAAC,KAAe;IACtD,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACf,IAAA,kBAAO,EAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtD,IAAI;QACJ,KAAK,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACjF,CAAC,CAAC,CACJ,CACF,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,iBAAoC,EAAE,cAAwB;IAC9E,KAAK,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,iBAAiB,EAAE,CAAC;QAChD,KAAK,MAAM,SAAS,IAAI,c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E,CAAC;QACrD,KAAK,MAAM,OAAO,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAClC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAChC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAyB,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACrD,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,EAAE,CAAC;YAC7E,SAAS;QACX,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAlDD,4DAkDC","sourcesContent":["import { readFile, readdir } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nexport interface PostcssConfiguration {\n plugins: [name: string, options?: object | string][];\n}\n\ninterface RawPostcssConfiguration {\n plugins?: Record<string, object | string | boolean> | (string | [string, object])[];\n}\n\nconst postcssConfigurationFiles: string[] = ['postcss.config.json', '.postcssrc.json'];\n\ninterface SearchDirectory {\n root: string;\n files: Set<string>;\n}\n\nasync function generateSearchDirectories(roots: string[]): Promise<SearchDirectory[]> {\n return await Promise.all(\n roots.map(root =>\n readdir(root, { withFileTypes: true }).then(entries => ({\n root,\n files: new Set(entries.filter(entry => entry.isFile()).map(entry => entry.name)),\n })),\n ),\n );\n}\n\nfunction findFile(searchDirectories: SearchDirectory[], potentialFiles: string[]): string | undefined {\n for (const { root, files } of searchDirectories) {\n for (const potential of potentialFiles) {\n if (files.has(potential)) {\n return join(root, potential);\n }\n }\n }\n\n return undefined;\n}\n\nasync function readPostcssConfiguration(configurationFile: string): Promise<RawPostcssConfiguration> {\n const data = await readFile(configurationFile, 'utf-8');\n const config = JSON.parse(data) as RawPostcssConfiguration;\n\n return config;\n}\n\nexport async function loadPostcssConfiguration(projectRoot: string): Promise<PostcssConfiguration | undefined> {\n // A configuration file can exist in the project or workspace root\n const searchDirectories = await generateSearchDirectories([projectRoot]);\n\n const configPath = findFile(searchDirectories, postcssConfigurationFiles);\n if (!configPath) {\n return undefined;\n }\n\n const raw = await readPostcssConfiguration(configPath);\n\n // If no plugins are defined, consider it equivalent to no configuration\n if (!raw.plugins || typeof raw.plugins !== 'object') {\n return undefined;\n }\n\n // Normalize plugin array form\n if (Array.isArray(raw.plugins)) {\n if (raw.plugins.length < 1) {\n return undefined;\n }\n\n const config: PostcssConfiguration = { plugins: [] };\n for (const element of raw.plugins) {\n if (typeof element === 'string') {\n config.plugins.push([element]);\n } else {\n config.plugins.push(element);\n }\n }\n\n return config;\n }\n\n // Normalize plugin object map form\n const entries = Object.entries(raw.plugins);\n if (entries.length < 1) {\n return undefined;\n }\n\n const config: PostcssConfiguration = { plugins: [] };\n for (const [name, options] of entries) {\n if (!options || (typeof options !== 'object' && typeof options !== 'string')) {\n continue;\n }\n\n config.plugins.push([name, options]);\n }\n\n return config;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-packagr",
|
|
3
|
-
"version": "17.2.0
|
|
3
|
+
"version": "17.2.0",
|
|
4
4
|
"description": "Compile and package Angular libraries in Angular Package Format (APF)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apf",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"rollup": "^4.5.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@angular/compiler-cli": "^17.0.0 || ^17.
|
|
63
|
+
"@angular/compiler-cli": "^17.0.0 || ^17.2.0-next.0 || ^17.3.0-next.0",
|
|
64
64
|
"tailwindcss": "^2.0.0 || ^3.0.0",
|
|
65
65
|
"tslib": "^2.3.0",
|
|
66
66
|
"typescript": ">=5.2 <5.4"
|