@salty-css/core 0.0.1-alpha.55 → 0.0.1-alpha.56

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 CHANGED
@@ -7,4 +7,4 @@ saltygen
7
7
  `,S=E.replace(/(plugins: \[)/,`$1
8
8
  saltyPlugin(__dirname),`);g||await b(`-D ${$.vite}`),t.info("Adding Salty-CSS plugin to Vite config..."),await s.writeFile(L,p+S),await _(L)}const T=["next.config.js","next.config.cjs","next.config.ts","next.config.mjs"].map(e=>n.join(l,e)).find(e=>W.existsSync(e));if(T){let e=await s.readFile(T,"utf-8").catch(()=>{});if(e!==void 0&&!e.includes("withSaltyCss")){let c=!1;/\splugins([^=]*)=[^[]\[/.test(e)&&!c&&(e=e.replace(/\splugins([^=]*)=[^[]\[/,(q,x)=>` plugins${x}= [withSaltyCss,`),c=!0);const v=e.includes("module.exports"),J=v?`const { withSaltyCss } = require('@salty-css/next');
9
9
  `:`import { withSaltyCss } from '@salty-css/next';
10
- `;v&&!c?(e=e.replace(/module.exports = ([^;]+)/,(q,x)=>`module.exports = withSaltyCss(${x})`),c=!0):c||(e=e.replace(/export default ([^;]+)/,(q,x)=>`export default withSaltyCss(${x})`)),g||await b(`-D ${$.next}`),t.info("Adding Salty-CSS plugin to Next.js config..."),await s.writeFile(T,J+e),await _(T)}}t.info("🎉 Salty CSS project initialized successfully!"),t.info("Next steps:"),t.info("1. Configure variables and templates in `salty.config.ts`."),t.info("2. Create a new component with `npx salty-css generate [component-name]`."),t.info("3. Run `npx salty-css build` to generate the CSS."),t.info("4. Star the project on GitHub: https://github.com/margarita-form/salty-css"),t.info("5. Read about the features in the documentation: https://salty-css.dev")}),a.command("build [directory]").alias("b").description("Build the Salty-CSS project.").option("-d, --dir <dir>","Project directory to build the project in.").action(async function(i=H){t.info("Building the Salty-CSS project...");const{dir:r=i}=this.opts();if(!r)return h("Project directory must be provided. Add it as the first argument after build command or use the --dir option.");const o=U(r);await Y.generateCss(o)}),a.command("generate [file] [directory]").alias("g").description("Generate a new component file.").option("-f, --file <file>","File to generate.").option("-d, --dir <dir>","Project directory to generate the file in.").option("-t, --tag <tag>","HTML tag of the component.","div").option("-n, --name <name>","Name of the component.").option("-c, --className <className>","CSS class of the component.").action(async function(i,r=H){const{file:o=i,dir:u=r,tag:g,name:f,className:l}=this.opts();if(!o)return h("File to generate must be provided. Add it as the first argument after generate command or use the --file option.");if(!u)return h("Project directory must be provided. Add it as the second argument after generate command or use the --dir option.");const j=U(u),y=o.split("/").slice(0,-1).join("/");y&&await s.mkdir(n.join(j,y),{recursive:!0});const D=n.join(j,o),d=n.parse(D);d.ext||(d.ext=".ts"),d.name.endsWith(".css")||(d.name=d.name+".css"),d.base=d.name+d.ext;const w=n.format(d);if(await s.readFile(w,"utf-8").catch(()=>{})!==void 0){t.error("File already exists:",w);return}t.info("Generating a new file: "+w);const I=Z.pascalCase(f||d.base.replace(/\.css\.\w+$/,"")),{content:O}=await C("react/react-styled-file.ts",{tag:g,name:I,className:l});await s.writeFile(w,O),await _(w)}),a.command("update [version]").alias("up").description("Update Salty-CSS packages to the latest or specified version.").option("-v, --version <version>","Version to update to.").option("--legacy-peer-deps <legacyPeerDeps>","Use legacy peer dependencies (not recommended).",!1).action(async function(i="latest"){const{legacyPeerDeps:r,version:o=i}=this.opts(),u=n.join(process.cwd(),"package.json"),g=await F(u).catch(y=>h(y));if(!g)return;const f={...g.dependencies,...g.devDependencies},l=Object.keys(f).filter(y=>y==="salty-css"||y.startsWith("@salty-css/"));if(!l.length)return h("No Salty-CSS packages found in package.json. Make sure you are running update command in the same directory! Used package.json path: "+u);const j=l.map(y=>o==="@"?`${y}@${k.version}`:`${y}@${o.replace(/^@/,"")}`);r?(t.warn("Using legacy peer dependencies to update packages."),await b(...j,"--legacy-peer-deps")):await b(...j),t.info("Salty-CSS packages updated successfully!")}),a.option("-v, --version","Show the current version of Salty-CSS.").action(async function(){const i=await z();t.info("CLI is running: "+i.version);const r=n.join(process.cwd(),"package.json"),o=await F(r).catch(f=>h(f));if(!o)return;const u={...o.dependencies,...o.devDependencies},g=Object.keys(u).filter(f=>f==="salty-css"||f.startsWith("@salty-css/"));if(!g.length)return h("No Salty-CSS packages found in package.json. Make sure you are running update command in the same directory! Used package.json path: "+r);for(const f of g)t.info(`${f}: ${u[f]}`)}),a.parseAsync(process.argv)}exports.main=ie;
10
+ `;v&&!c?(e=e.replace(/module.exports = ([^;]+)/,(q,x)=>`module.exports = withSaltyCss(${x})`),c=!0):c||(e=e.replace(/export default ([^;]+)/,(q,x)=>`export default withSaltyCss(${x})`)),g||await b(`-D ${$.next}`),t.info("Adding Salty-CSS plugin to Next.js config..."),await s.writeFile(T,J+e),await _(T)}}t.info("🎉 Salty CSS project initialized successfully!"),t.info("Next steps:"),t.info("1. Configure variables and templates in `salty.config.ts`"),t.info("2. Create a new component with `npx salty-css generate [component-name]`"),t.info("3. Run `npx salty-css build` to generate the CSS"),t.info("4. Read about the features in the documentation: https://salty-css.dev"),t.info("5. Star the project on GitHub: https://github.com/margarita-form/salty-css")}),a.command("build [directory]").alias("b").description("Build the Salty-CSS project.").option("-d, --dir <dir>","Project directory to build the project in.").action(async function(i=H){t.info("Building the Salty-CSS project...");const{dir:r=i}=this.opts();if(!r)return h("Project directory must be provided. Add it as the first argument after build command or use the --dir option.");const o=U(r);await Y.generateCss(o)}),a.command("generate [file] [directory]").alias("g").description("Generate a new component file.").option("-f, --file <file>","File to generate.").option("-d, --dir <dir>","Project directory to generate the file in.").option("-t, --tag <tag>","HTML tag of the component.","div").option("-n, --name <name>","Name of the component.").option("-c, --className <className>","CSS class of the component.").action(async function(i,r=H){const{file:o=i,dir:u=r,tag:g,name:f,className:l}=this.opts();if(!o)return h("File to generate must be provided. Add it as the first argument after generate command or use the --file option.");if(!u)return h("Project directory must be provided. Add it as the second argument after generate command or use the --dir option.");const j=U(u),y=o.split("/").slice(0,-1).join("/");y&&await s.mkdir(n.join(j,y),{recursive:!0});const D=n.join(j,o),d=n.parse(D);d.ext||(d.ext=".ts"),d.name.endsWith(".css")||(d.name=d.name+".css"),d.base=d.name+d.ext;const w=n.format(d);if(await s.readFile(w,"utf-8").catch(()=>{})!==void 0){t.error("File already exists:",w);return}t.info("Generating a new file: "+w);const I=Z.pascalCase(f||d.base.replace(/\.css\.\w+$/,"")),{content:O}=await C("react/react-styled-file.ts",{tag:g,name:I,className:l});await s.writeFile(w,O),await _(w)}),a.command("update [version]").alias("up").description("Update Salty-CSS packages to the latest or specified version.").option("-v, --version <version>","Version to update to.").option("--legacy-peer-deps <legacyPeerDeps>","Use legacy peer dependencies (not recommended).",!1).action(async function(i="latest"){const{legacyPeerDeps:r,version:o=i}=this.opts(),u=n.join(process.cwd(),"package.json"),g=await F(u).catch(y=>h(y));if(!g)return;const f={...g.dependencies,...g.devDependencies},l=Object.keys(f).filter(y=>y==="salty-css"||y.startsWith("@salty-css/"));if(!l.length)return h("No Salty-CSS packages found in package.json. Make sure you are running update command in the same directory! Used package.json path: "+u);const j=l.map(y=>o==="@"?`${y}@${k.version}`:`${y}@${o.replace(/^@/,"")}`);r?(t.warn("Using legacy peer dependencies to update packages."),await b(...j,"--legacy-peer-deps")):await b(...j),t.info("Salty-CSS packages updated successfully!")}),a.option("-v, --version","Show the current version of Salty-CSS.").action(async function(){const i=await z();t.info("CLI is running: "+i.version);const r=n.join(process.cwd(),"package.json"),o=await F(r).catch(f=>h(f));if(!o)return;const u={...o.dependencies,...o.devDependencies},g=Object.keys(u).filter(f=>f==="salty-css"||f.startsWith("@salty-css/"));if(!g.length)return h("No Salty-CSS packages found in package.json. Make sure you are running update command in the same directory! Used package.json path: "+r);for(const f of g)t.info(`${f}: ${u[f]}`)}),a.parseAsync(process.argv)}exports.main=ie;
package/bin/main.js CHANGED
@@ -154,7 +154,7 @@ saltygen
154
154
  j && !r ? (t = t.replace(/module.exports = ([^;]+)/, (A, b) => `module.exports = withSaltyCss(${b})`), r = !0) : r || (t = t.replace(/export default ([^;]+)/, (A, b) => `export default withSaltyCss(${b})`)), g || await $(`-D ${D.next}`), e.info("Adding Salty-CSS plugin to Next.js config..."), await C(T, N + t), await E(T);
155
155
  }
156
156
  }
157
- e.info("🎉 Salty CSS project initialized successfully!"), e.info("Next steps:"), e.info("1. Configure variables and templates in `salty.config.ts`."), e.info("2. Create a new component with `npx salty-css generate [component-name]`."), e.info("3. Run `npx salty-css build` to generate the CSS."), e.info("4. Star the project on GitHub: https://github.com/margarita-form/salty-css"), e.info("5. Read about the features in the documentation: https://salty-css.dev");
157
+ e.info("🎉 Salty CSS project initialized successfully!"), e.info("Next steps:"), e.info("1. Configure variables and templates in `salty.config.ts`"), e.info("2. Create a new component with `npx salty-css generate [component-name]`"), e.info("3. Run `npx salty-css build` to generate the CSS"), e.info("4. Read about the features in the documentation: https://salty-css.dev"), e.info("5. Star the project on GitHub: https://github.com/margarita-form/salty-css");
158
158
  }), o.command("build [directory]").alias("b").description("Build the Salty-CSS project.").option("-d, --dir <dir>", "Project directory to build the project in.").action(async function(n = M) {
159
159
  e.info("Building the Salty-CSS project...");
160
160
  const { dir: a = n } = this.opts();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/core",
3
- "version": "0.0.1-alpha.55",
3
+ "version": "0.0.1-alpha.56",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",