@salty-css/core 0.2.0-alpha.3 → 0.2.0-fix-astro-fixes-06-2026.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.
- package/bin/main.cjs +7 -6
- package/bin/main.js +7 -6
- package/package.json +1 -1
package/bin/main.cjs
CHANGED
|
@@ -613,7 +613,7 @@ const ensureGitignoreSaltygen = async (rootDir) => {
|
|
|
613
613
|
compiler_saltyCompiler.logger.info("Edit file: " + path$1);
|
|
614
614
|
await promises.writeFile(path$1, existing + "\n\n# Salty-CSS\nsaltygen\n");
|
|
615
615
|
};
|
|
616
|
-
const importSaltygenIntoCss = async (projectDir, explicitCssFile) => {
|
|
616
|
+
const importSaltygenIntoCss = async (projectDir, saltygenDir, explicitCssFile) => {
|
|
617
617
|
const target = explicitCssFile ?? await findGlobalCssFile(projectDir);
|
|
618
618
|
if (!target) {
|
|
619
619
|
compiler_saltyCompiler.logger.warn("Could not find a CSS file to import the generated CSS. Please add it manually.");
|
|
@@ -624,7 +624,7 @@ const importSaltygenIntoCss = async (projectDir, explicitCssFile) => {
|
|
|
624
624
|
if (cssFileContent === void 0) return;
|
|
625
625
|
if (cssFileContent.includes("saltygen")) return;
|
|
626
626
|
const cssFileFolder = path.join(cssFilePath, "..");
|
|
627
|
-
const relPath = path.relative(cssFileFolder, path.join(
|
|
627
|
+
const relPath = path.relative(cssFileFolder, path.join(saltygenDir, "saltygen/index.css"));
|
|
628
628
|
compiler_saltyCompiler.logger.info("Adding global import statement to CSS file: " + cssFilePath);
|
|
629
629
|
await promises.writeFile(cssFilePath, `@import '${relPath}';
|
|
630
630
|
` + cssFileContent);
|
|
@@ -649,6 +649,7 @@ const registerInitCommand = (program) => {
|
|
|
649
649
|
compiler_saltyCompiler.logger.info("Initializing a new Salty-CSS project!");
|
|
650
650
|
const framework = await detectFramework(ctx);
|
|
651
651
|
compiler_saltyCompiler.logger.info(`Detected framework: ${framework.name}`);
|
|
652
|
+
const sourceDir = path.join(ctx.projectDir, framework.srcDirectory);
|
|
652
653
|
const plannedIntegrations = await planIntegrations(ctx);
|
|
653
654
|
if (!ctx.skipInstall) {
|
|
654
655
|
const packages = [
|
|
@@ -660,8 +661,8 @@ const registerInitCommand = (program) => {
|
|
|
660
661
|
await npmInstall(...packages);
|
|
661
662
|
}
|
|
662
663
|
const projectFiles = await Promise.all([readTemplate("salty.config.ts"), readTemplate("saltygen/index.css")]);
|
|
663
|
-
await promises.mkdir(
|
|
664
|
-
await Promise.all(projectFiles.map(({ fileName, content }) => writeProjectFile(
|
|
664
|
+
await promises.mkdir(sourceDir, { recursive: true });
|
|
665
|
+
await Promise.all(projectFiles.map(({ fileName, content }) => writeProjectFile(sourceDir, fileName, content)));
|
|
665
666
|
const pathDefaults = computePathDefaults({
|
|
666
667
|
framework: framework.name,
|
|
667
668
|
integrations: plannedIntegrations.map((p) => p.name),
|
|
@@ -669,11 +670,11 @@ const registerInitCommand = (program) => {
|
|
|
669
670
|
});
|
|
670
671
|
await writeProjectToRc(ctx.cwd, ctx.relativeProjectPath, framework, pathDefaults);
|
|
671
672
|
await ensureGitignoreSaltygen(ctx.cwd);
|
|
672
|
-
await importSaltygenIntoCss(ctx.projectDir, opts.cssFile);
|
|
673
|
+
await importSaltygenIntoCss(ctx.projectDir, sourceDir, opts.cssFile);
|
|
673
674
|
await applyIntegrationPlans(plannedIntegrations);
|
|
674
675
|
await wirePrepareScript();
|
|
675
676
|
compiler_saltyCompiler.logger.info("Running the build to generate initial CSS...");
|
|
676
|
-
const compiler = new compiler_saltyCompiler.SaltyCompiler(
|
|
677
|
+
const compiler = new compiler_saltyCompiler.SaltyCompiler(sourceDir);
|
|
677
678
|
await compiler.generateCss();
|
|
678
679
|
compiler_saltyCompiler.logger.info("🎉 Salty CSS project initialized successfully!");
|
|
679
680
|
compiler_saltyCompiler.logger.info("Next steps:");
|
package/bin/main.js
CHANGED
|
@@ -610,7 +610,7 @@ const ensureGitignoreSaltygen = async (rootDir) => {
|
|
|
610
610
|
logger.info("Edit file: " + path);
|
|
611
611
|
await writeFile(path, existing + "\n\n# Salty-CSS\nsaltygen\n");
|
|
612
612
|
};
|
|
613
|
-
const importSaltygenIntoCss = async (projectDir, explicitCssFile) => {
|
|
613
|
+
const importSaltygenIntoCss = async (projectDir, saltygenDir, explicitCssFile) => {
|
|
614
614
|
const target = explicitCssFile ?? await findGlobalCssFile(projectDir);
|
|
615
615
|
if (!target) {
|
|
616
616
|
logger.warn("Could not find a CSS file to import the generated CSS. Please add it manually.");
|
|
@@ -621,7 +621,7 @@ const importSaltygenIntoCss = async (projectDir, explicitCssFile) => {
|
|
|
621
621
|
if (cssFileContent === void 0) return;
|
|
622
622
|
if (cssFileContent.includes("saltygen")) return;
|
|
623
623
|
const cssFileFolder = join(cssFilePath, "..");
|
|
624
|
-
const relPath = relative(cssFileFolder, join(
|
|
624
|
+
const relPath = relative(cssFileFolder, join(saltygenDir, "saltygen/index.css"));
|
|
625
625
|
logger.info("Adding global import statement to CSS file: " + cssFilePath);
|
|
626
626
|
await writeFile(cssFilePath, `@import '${relPath}';
|
|
627
627
|
` + cssFileContent);
|
|
@@ -646,6 +646,7 @@ const registerInitCommand = (program) => {
|
|
|
646
646
|
logger.info("Initializing a new Salty-CSS project!");
|
|
647
647
|
const framework = await detectFramework(ctx);
|
|
648
648
|
logger.info(`Detected framework: ${framework.name}`);
|
|
649
|
+
const sourceDir = join(ctx.projectDir, framework.srcDirectory);
|
|
649
650
|
const plannedIntegrations = await planIntegrations(ctx);
|
|
650
651
|
if (!ctx.skipInstall) {
|
|
651
652
|
const packages = [
|
|
@@ -657,8 +658,8 @@ const registerInitCommand = (program) => {
|
|
|
657
658
|
await npmInstall(...packages);
|
|
658
659
|
}
|
|
659
660
|
const projectFiles = await Promise.all([readTemplate("salty.config.ts"), readTemplate("saltygen/index.css")]);
|
|
660
|
-
await mkdir(
|
|
661
|
-
await Promise.all(projectFiles.map(({ fileName, content }) => writeProjectFile(
|
|
661
|
+
await mkdir(sourceDir, { recursive: true });
|
|
662
|
+
await Promise.all(projectFiles.map(({ fileName, content }) => writeProjectFile(sourceDir, fileName, content)));
|
|
662
663
|
const pathDefaults = computePathDefaults({
|
|
663
664
|
framework: framework.name,
|
|
664
665
|
integrations: plannedIntegrations.map((p) => p.name),
|
|
@@ -666,11 +667,11 @@ const registerInitCommand = (program) => {
|
|
|
666
667
|
});
|
|
667
668
|
await writeProjectToRc(ctx.cwd, ctx.relativeProjectPath, framework, pathDefaults);
|
|
668
669
|
await ensureGitignoreSaltygen(ctx.cwd);
|
|
669
|
-
await importSaltygenIntoCss(ctx.projectDir, opts.cssFile);
|
|
670
|
+
await importSaltygenIntoCss(ctx.projectDir, sourceDir, opts.cssFile);
|
|
670
671
|
await applyIntegrationPlans(plannedIntegrations);
|
|
671
672
|
await wirePrepareScript();
|
|
672
673
|
logger.info("Running the build to generate initial CSS...");
|
|
673
|
-
const compiler = new SaltyCompiler(
|
|
674
|
+
const compiler = new SaltyCompiler(sourceDir);
|
|
674
675
|
await compiler.generateCss();
|
|
675
676
|
logger.info("🎉 Salty CSS project initialized successfully!");
|
|
676
677
|
logger.info("Next steps:");
|