Gathering detailed insights and metrics for kkt
Gathering detailed insights and metrics for kkt
Gathering detailed insights and metrics for kkt
Gathering detailed insights and metrics for kkt
@kkt/less-modules
Support for regular less files and *.module.less files.
@kkt/raw-modules
Makes it easy to use the webpack raw-loader.
@kkt/scope-plugin-options
This will modify the CRA ModuleScopePlugin plugin that prevents to import modules from outside the `src` directory.
@kkt/doc
Document Preview
Create React apps with no build configuration, Cli tool for creating react apps.
npm install kkt
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (54.54%)
JavaScript (18.4%)
HTML (13.22%)
Less (7.34%)
CSS (5.66%)
SCSS (0.37%)
Stylus (0.34%)
Shell (0.12%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
50 Stars
1,236 Commits
12 Forks
1 Watchers
20 Branches
4 Contributors
Updated on Jan 31, 2025
Latest Version
7.5.5
Package Id
kkt@7.5.5
Unpacked Size
122.03 kB
Size
29.27 kB
File Count
64
NPM Version
10.2.3
Node Version
18.19.0
Published on
Jan 04, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
28
1
Create React apps with no build configuration, Cli tool for creating react apps. Another tool, kkt-ssr
, Is a lightweight framework for static and server-rendered applications.
As of KKT 6.x
this repo is "lightly" maintained mostly by the community at this point.
kkt test
@kkt/ncc
support.You will need Node.js
installed on your system.
1npm install kkt
Initialize the project from one of the examples, Let's quickly create a react application:
1$ npx create-kkt my-app -e uiw 2# or npm 3$ npm create kkt my-app -e `<Example Name>` 4# or yarn 5$ yarn create kkt my-app -e `<Example Name>`
You can download the following examples directly. Download page.
basic
- The react base application. Open in CodeSandbox
bundle
- Package the UMD package for developing the React component library.bundle-node
- Simple CLI for compiling a Node.js module into a single file.electron
- Use an example of Electronjs
.less
- Use an example of Less
. Open in CodeSandbox
markdown
- Use an example of Markdown
. Open in CodeSandbox
react-component-tsx
- Create a project containing the website for the react component library.react-router
- Use react-router
for the project. Open in CodeSandbox
scss
- Use an example of Scss
. Open in CodeSandbox
stylus
- Use an example of Stylus
. Open in CodeSandbox
typescript
- Use an example of TypeScript
. Open in CodeSandbox
uiw
- Use uiw
for the project. Open in CodeSandbox
@kkt/ncc
simple CLI for compiling a Node.js module into a single file. Supports TypeScript.
Create your app using create-react-app and then rewire it.
1npm install kkt --save-dev
1"dependencies": { 2 ... 3- "react-scripts": "4.0.1", 4+ "kkt": "7.0.6", 5 .... 6}, 7"scripts": { 8- "start": "react-scripts start", 9+ "start": "kkt start", 10- "build": "react-scripts build", 11+ "build": "kkt build", 12- "test": "react-scripts test", 13+ "test": "kkt test", 14- "eject": "react-scripts eject" 15},
⚠️ Note: Do NOT flip the call for the eject script. That gets run only once for a project, after which you are given full control over the webpack configuration making kkt
no longer required. There are no configuration options to rewire for the eject script.
1# Start the Dev Server 2$ npm start 3# Build your app 4$ npm run build
Supports .kktrc.js
and .kktrc.ts
. @7.5+
above supports .cjs
, .mjs
, .ts
, .js
.
1.kktrc.js 2.kktrc.ts 3.kktrc.cjs 4.kktrc.mjs 5.config/kktrc.js 6.config/kktrc.ts 7.config/kktrc.cjs 8.config/kktrc.mjs 9kkt.config.js 10kkt.config.ts 11kkt.config.cjs 12kkt.config.mjs
1import express from 'express'; 2import { Configuration } from 'webpack'; 3import WebpackDevServer from 'webpack-dev-server'; 4import { LoaderConfOptions, MockerAPIOptions, DevServerOptions } from 'kkt'; 5 6export interface WebpackConfiguration extends Configuration { 7 devServer?: WebpackDevServer.Configuration; 8 /** Configuring the Proxy Manually */ 9 proxySetup?: (app: express.Application) => MockerAPIOptions; 10} 11export declare type KKTRC = { 12 proxySetup?: (app: express.Application) => MockerAPIOptions; 13 devServer?: (config: WebpackDevServer.Configuration, options: DevServerOptions) => WebpackDevServer.Configuration; 14 default?: (conf: WebpackConfiguration, evn: 'development' | 'production', options: LoaderConfOptions) => WebpackConfiguration | Promise<WebpackConfiguration>; 15};
1import webpack from 'webpack'; 2import WebpackDevServer from 'webpack-dev-server'; 3import lessModules from '@kkt/less-modules'; 4import { LoaderConfOptions, WebpackConfiguration } from 'kkt'; 5 6export default (conf: WebpackConfiguration, env: string, options: LoaderConfOptions) => { 7 // The Webpack config to use when compiling your react app for development or production. 8 // ...add your webpack config 9 conf = lessModules(conf, env, options); 10 return conf; 11}
1export const devServer = (config: WebpackDevServer.Configuration) => { 2 // Change the https certificate options to match your certificate, using the .env file to 3 // set the file paths & passphrase. 4 const fs = require('fs'); 5 config.https = { 6 key: fs.readFileSync(process.env.REACT_HTTPS_KEY, 'utf8'), 7 cert: fs.readFileSync(process.env.REACT_HTTPS_CERT, 'utf8'), 8 ca: fs.readFileSync(process.env.REACT_HTTPS_CA, 'utf8'), 9 passphrase: process.env.REACT_HTTPS_PASS 10 }; 11 // Return your customised Webpack Development Server config. 12 return config; 13};
1import express from 'express'; 2import { createProxyMiddleware } from 'http-proxy-middleware'; 3import { LoaderConfOptions, WebpackConfiguration, MockerAPIOptions } from 'kkt'; 4export default (conf: WebpackConfiguration, evn: 'development' | 'production') => { 5 //.... 6 conf.proxySetup = (app: express.Application): MockerAPIOptions => { 7 app.use('/api', createProxyMiddleware({ 8 target: 'http://localhost:5000', 9 changeOrigin: true, 10 })); 11 return { 12 path: path.resolve('./mocker/index.js'), 13 }; 14 }; 15 return conf; 16}
Or use another way to manually configure the proxy.
1import express from 'express'; 2import { createProxyMiddleware } from 'http-proxy-middleware'; 3import { MockerAPIOptions } from 'kkt'; 4/** 5 * Still available, may be removed in the future. (仍然可用,将来可能会被删除。) 6 */ 7export const proxySetup = (app: express.Application): MockerAPIOptions => { 8 app.use('/api', createProxyMiddleware({ 9 target: 'http://localhost:5000', 10 changeOrigin: true, 11 })); 12 /** 13 * Mocker API Options 14 * https://www.npmjs.com/package/mocker-api 15 */ 16 return { 17 path: path.resolve('./mocker/index.js'), 18 option: { 19 proxy: { 20 '/repos/(.*)': 'https://api.github.com/', 21 }, 22 changeHost: true, 23 } 24 } 25}
1Usage: kkt [start|build|test|doc] [--help|h] 2 3 Displays help information. 4 5Options: 6 7 --version, -v Show version number 8 --help, -h Displays help information. 9 --app-src Specify the entry directory. 10 --docs Static asset preview in package(Dev mode works). 11 --no-open-browser Do not open in browser. 12 --no-clear-console Do not clear the command line information. 13 14Example: 15 16$ kkt build 17$ kkt build --app-src ./website 18$ kkt test 19$ kkt test --env=jsdom 20$ kkt test --env=jsdom --coverage 21$ kkt start 22$ kkt start --no-open-browser 23$ kkt start --watch 24$ kkt start --no-clear-console 25$ kkt start --app-src ./website 26# Static asset preview in "@uiw/doc" package. 27# Default preview: http://localhost:3000/_doc/ 28$ kkt start --docs @uiw/doc/web 29# Specify a static website route "_uiw/doc" 30# Default preview: http://localhost:3000/_uiw/doc 31$ kkt start --docs @uiw/doc/web:_uiw/doc 32 33# Run static services separately 34$ kkt doc --path @uiw/doc/web 35$ kkt doc --path @uiw/doc/web:_uiw/doc --port 30002 36$ kkt doc --path @uiw/doc/web:_uiw/doc -p 30002 37$ kkt doc --path ./build/doc -p 30002
Add homepage
to package.json
The step below is important!
Open your package.json and add a homepage field for your project:
1"homepage": "https://myusername.github.io/my-app",
or for a GitHub user page:
1"homepage": "https://myusername.github.io",
or for a custom domain page:
1"homepage": "https://mywebsite.com",
KKT uses the homepage
field to determine the root URL in the built HTML file.
Runs the project in development mode.
1# npm run bootstrap 2npm run hoist 3npm run build 4 5npm run lib:watch 6npm run kkt:watch 7 8npm run hoist
Builds the app for production to the build folder.
1npm run build
@timarney for having created react-app-rewired.
Alternatives
As always, thanks to our amazing contributors!
Made with contributors.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More