Skip to content

Commit

Permalink
epic/v3: do not allow built-in-place css on main (#409)
Browse files Browse the repository at this point in the history
* test: demo action

* feat: lint dir & worflow to do so, UNTESTED

* fix: lint workflow job step names

* test: lint workflow job name

* config: lint workflow on .css change for epic/v3

* test: build .css files

* config: output paths from repo root not fs root

* fix: delete align.css

* fix: delete admonition.css

* noop: test commit (new line)

* Revert "noop: test commit (new line)"

This reverts commit 88cf542.

* noop: test commit (new line) in a .css file

* Revert "noop: test commit (new line) in a .css file"

This reverts commit d6aa2ca.
  • Loading branch information
wesleyboar authored Oct 15, 2024
1 parent 5ca4a90 commit c361098
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/only-commit-source.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

const fs = require('fs');
const path = require('path');

Expand All @@ -7,7 +9,7 @@ function findBuiltFiles( dir ) {

for ( const file of files ) {
const filePath = path.join( dir, file );
const relativePath = path.relative( path.join( __dirname, '../src'), filePath );
const relativePath = path.relative( path.join( __dirname, '../'), filePath );
const isDirectory = fs.statSync( filePath ).isDirectory();

if ( isDirectory ) {
Expand All @@ -17,14 +19,14 @@ function findBuiltFiles( dir ) {

const isProbablyBuilt = filePath.endsWith('.css');
const shouldIgnore = (
/^lib\/_imports\/[^/]+\/[^/]+\/[^/]+\.css$/.test(relativePath) ||
/_imports\/[^/]+\/[^/]+\/[^/]+\.css$/.test(relativePath) ||
filePath.endsWith('fractal.server.refresh.css') ||
relativePath.includes('_imports/vendors') ||
filePath.endsWith('README.css')
);

if ( isProbablyBuilt && ! shouldIgnore ) {
builtFiles.push(filePath);
builtFiles.push( relativePath );
}
}

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"prestart": "npm run prebuild:demo",
"build:demo": "fractal build",
"test": "bin/test.js && echo \"Test output at 'dist/_tests' (compare to test input)\"",
"lint": "npm run lint:dirs",
"lint:dirs": "bin/only-commit-source.js",
"build:watch": "npm run build:css && touch src/lib/_imports/fractal.server.refresh.css",
"prepublishOnly": "bin/only-commit-source.js && npm run build",
"watch": "npm-watch"
Expand Down

0 comments on commit c361098

Please sign in to comment.