sekre
v0.0.1
Published
1. Make code changes. 2. Run `npm run build` supaya ke build `./dist` nya. 3. Push ke repo, nanti yg dipake sama consuming project itu yang `./dist` nya doang. Karena di `./package.json` di set
Downloads
64
Readme
How to contribute
- Make code changes.
- Run
npm run build
supaya ke build./dist
nya. - Push ke repo, nanti yg dipake sama consuming project itu yang
./dist
nya doang. Karena di./package.json
di set
{
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": ["dist/**/*"]
}
Notes Kalo ada nambah dependency itu di ./package.json, cari tau aja bedanya apa dan kenapa gak disimpen di "dependency"
"peerDependencies": {
"pkg/lib": "^5"
},
"devDependencies": {
"pkg/lib": "^5"
}
Install
Install pkg.
npm i [email protected]:PDR-Tech/sekre.git
Pre-req
Need to install deps used in this project.
npm install @types/[email protected] [email protected] [email protected] react@^18 react-dom@^18 tailwindcss@^3.3.5 typescript@^5
Contoh pake awp
NEXT_PUBLIC_BASE_URL
di .env, tambahin ini juga dinext.config.js
-> .js ya bukan .ts
const nextConfig = {
env: {
NEXT_PUBLIC_BASE_URL: process.env.NEXT_PUBLIC_BASE_URL || "",
},
};
module.exports = nextConfig;
Sample.
const handleFetchData = async () => {
const params = {
method: "GET",
url: "/example-endpoint",
};
try {
const response = await awp(params);
console.log("API Response:", response);
} catch (error) {
console.error("API Error:", error);
}
};
Contoh pake tailwind config
- Add this to tailwind.config.ts inside the project dir.
import { tailwindConfig } from "sekre";
export default {
...tailwindConfig,
theme: {
...tailwindConfig.theme,
},
};
- Add this css import path to ./src/app/global.css.
@import "../../node_modules/sekre/dist/global.css";