Skip to content
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

Task/fp 1499 ui pattern demo - fix css import paths #35

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8d5129c
feat: fp-1499, core-styles pattern demo
wesleyboar Jul 23, 2022
a36963f
fix: css import paths
wesleyboar Jul 23, 2022
592962e
fix: pattern demo deps as peer not dev
wesleyboar Jul 25, 2022
c1f5d24
fix(core-styles): relative import bootstrap pagination
wesleyboar Jul 25, 2022
5803ef7
feat: updates from tup-ui (except paths)
wesleyboar Jul 25, 2022
ff2568c
Merge branch 'task/fp-1499-cms-pattern-library' into task/fp-1499-cms…
wesleyboar Jul 25, 2022
86365e7
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 25, 2022
e49de31
Merge branch 'task/fp-1499-cms-pattern-library' into task/fp-1499-cms…
wesleyboar Jul 25, 2022
ea8d093
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 25, 2022
855fa88
Merge branch 'task/fp-1499-cms-pattern-library' into task/fp-1499-cms…
wesleyboar Jul 25, 2022
cd05d96
chore: clone lint "fix" from tup-ui
wesleyboar Jul 26, 2022
0df8610
fix: fp-1726 allow int. + ext. global css
wesleyboar Jul 28, 2022
0e32ba1
Merge branch 'task/fp-1499-cms-pattern-library' into task/fp-1499-cms…
wesleyboar Jul 28, 2022
44f928d
feat(core-styles): fp-1499 drop excess file affix
wesleyboar Jul 29, 2022
ceb4328
feat(core-styles): fp-1499 tarball
wesleyboar Jul 29, 2022
cbba0f3
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 29, 2022
75e2379
Merge branch 'task/fp-1499-cms-pattern-library' into task/fp-1499-cms…
wesleyboar Jul 29, 2022
5d24083
feat(core-styles): fp-1726 c-button, a tag support
wesleyboar Aug 8, 2022
cb22095
Merge branch 'task/fp-1499-cms-pattern-library' into task/fp-1499-cms…
wesleyboar Aug 8, 2022
0a5ecce
chore(core-styles): fp-1499 remove tarball
wesleyboar Aug 8, 2022
8f0f1ae
chore: fp-1499 add node version to readme
wesleyboar Aug 9, 2022
3522b86
Merge branch 'task/fp-1499-cms-pattern-library' into task/fp-1499-cms…
wesleyboar Aug 9, 2022
2b129f6
Merge branch 'main' into task/fp-1499-cms-pattern-library--general-fi…
wesleyboar Aug 16, 2022
8a38f52
Merge branch 'main' into task/fp-1499-cms-pattern-library--general-fi…
wesleyboar Dec 6, 2022
4cc335a
Merge branch 'main' into task/fp-1499-cms-pattern-library--general-fi…
wesleyboar Jul 4, 2023
895486b
Merge branch 'main' into task/fp-1499-cms-pattern-library--general-fi…
wesleyboar Jul 6, 2023
b8e4a82
Merge branch 'main' into task/fp-1499-cms-pattern-library--general-fi…
wesleyboar Nov 22, 2023
e660f6a
Merge branch 'main' into task/fp-1499-cms-pattern-library--general-fi…
wesleyboar Jan 8, 2024
d3a1f47
Merge branch 'main' into task/fp-1499-cms-pattern-library--general-fi…
wesleyboar Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"// postcss-preset-env": "Using bleeding edge because https://github.com/csstools/postcss-plugins/issues/481#issuecomment-1334903391",
"postcss-replace": "To edit relative paths to fonts"
},
"devDependencies": {
"peerDependencies": {
"@frctl/fractal": "^1.5.15",
"@frctl/handlebars": "^1.2.15",
"@frctl/mandelbrot": "^1.10.1",
Expand Down
4 changes: 1 addition & 3 deletions src/.postcssrc.base.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
plugins:
postcss-import:
path:
- 'src/lib'
postcss-import: {}

postcss-extend: {}

Expand Down
37 changes: 35 additions & 2 deletions src/bin/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ function config(customConfigFiles = [], cssVersion) {
});
const mergedJson = merge(...configObjects);

// Update version property
const updatedJson = updateVersion(mergedJson, cssVersion);
// Update properties
let updatedJson = updateVersion(mergedJson, cssVersion);
updatedJson = resolveImportFromPaths(updatedJson);
const configYaml = yaml.dump(updatedJson);

// Write final config file
Expand All @@ -55,6 +56,38 @@ function updateVersion(config, version) {
return config;
}

/**
* Update the value for the CSS version in given config data
* @param {object} config - The config data in which to update the version
* @return {object} - Updated config
*/
function resolveImportFromPaths(config) {
let paths = config['plugins']['postcss-env-function']['importFrom'];
paths = (typeof paths === 'string') ? [ paths ] : paths;
let newPaths = [];

console.log(`Resolving 'importFrom' paths`);

if (paths) {
paths.forEach(path => {
let newPath;
try {
newPath = require.resolve(path);
} catch {
newPath = path;
} finally {
newPaths.push( newPath );
}
});
} else {
newPaths = paths;
}

config['plugins']['postcss-env-function']['importFrom'] = newPaths;

return config;
}

/**
* Get JSON from YAML config file
* @param {string} filePath - YAML config file
Expand Down