Registry / web-framework / scarletsframe-compiler

scarletsframe-compiler

JSON →
library0.7.2jsnpmunverified

A Gulp-based compiler for ScarletsFrame, a framework for building web components with .sf files. Version 0.7.2 is the latest stable release. It compiles .sf files into JavaScript, CSS, and HTML, and integrates with BrowserSync for live reloading. Differentiators include a macro system for appending HTML to body and file path injection via #this.path. The project appears to be low-maintenance with infrequent updates.

npm install scarletsframe-compiler
INSTALL
IMPORT
SIG · SCARLETSFRAME-COMP
S
scarletsframe-compiler
web-frameworkjavascriptv0.7.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const sfcompiler = require('scarletsframe-compiler');
import sfcompiler from 'scarletsframe-compiler';
Package does not provide ESM exports; use CommonJS require.
sfcompiler
const sfcompiler = require('scarletsframe-compiler');
const sfcompiler = require('scarletsframe-compiler').default;
No default export; the module itself is the compiler.
Gulp tasks
const { task } = require('gulp'); const sfcompiler = require('scarletsframe-compiler');
The package exposes Gulp tasks; no specific function exports documented.

Shows how to set up a Gulp task using scarletsframe-compiler to compile .sf files and serve with BrowserSync.

// Install dependencies // npm install gulp browser-sync scarletsframe-compiler --save-dev // gulpfile.js const gulp = require('gulp'); const browserSync = require('browser-sync').create(); const sfcompiler = require('scarletsframe-compiler'); // Use sfcompiler to define tasks (example from default template) gulp.task('compile', function() { return gulp.src('src/**/*.sf') .pipe(sfcompiler()) .pipe(gulp.dest('dist')); }); gulp.task('serve', function() { browserSync.init({ server: { baseDir: './' } }); gulp.watch('src/**/*.sf', gulp.series('compile')).on('change', browserSync.reload); }); gulp.task('default', gulp.series('compile', 'serve'));
scarletsframe-compiler --version
Debug
Known issues
gotchaRequires Gulp and BrowserSync as peer dependencies; not a standalone compiler.
fix
Install gulp and browser-sync as devDependencies.
affects: >=0.0.0
gotchaNo ESM exports; only CommonJS require works.
fix
Use require instead of import statements.
affects: >=0.0.0
breakingAPI changes between 0.5.x and 0.6.x may break existing gulpfile configurations.
fix
Check changelog for migration steps.
affects: >=0.6.0
deprecatedThe #this.path injection in JavaScript macros is a non-standard feature; may be removed in future versions.
fix
Use alternative template engines or avoid relying on it.
affects: >=0.7.0
gotchaWindows users must set text encoding to Unix (LF) in Sublime Text to avoid compilation issues.
fix
Change line endings to LF in your editor.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'scarletsframe-compiler'
Package not installed or missing from node_modules.
fix
Run npm install scarletsframe-compiler --save-dev
gulp.series is not a function
Using gulp 3.x which does not have gulp.series; requires gulp 4+.
fix
Upgrade to gulp 4: npm install gulp@4 --save-dev
TypeError: sfcompiler is not a function
Wrong import style (ESM default import instead of CommonJS).
fix
Use const sfcompiler = require('scarletsframe-compiler');
ReferenceError: window is not defined
Browser-specific code used in Node.js context (e.g., BrowserSync).
fix
Ensure you are not using browser-only APIs in .sf files that are processed server-side.
Upgrade
Version history
0.7.2latest on npm
Audit
Dependencies
gulprequiredBuild system for compiling .sf files
browser-syncrequiredLive reloading during development
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
scarletsframe-compiler — npm install scarletsframe-compiler · libregistry