A indie technical narrator of China. Aha! 😜
MAKE IT BETTER!
- Twitter: https://twitter.com/zceme
- Weibo: https://weibo.com/zceme
- Bilibili: https://space.bilibili.com/210242179
A simple yet powerful template-based Scaffolding tools.
License: MIT License
A indie technical narrator of China. Aha! 😜
MAKE IT BETTER!
npm run build 生成的生产环境的代码无法触发form的submit事件
<form bindsubmit="xx">
...
<button class="weui-btn" type="primary" formType="submit">确定</button>
...
</form>
不知道gulpfile.js中的uglify这段,是不是要加点什么进行过滤
.pipe(plugins.if(isProduction, plugins.uglify()))
Prerequisites:
caz
as a top level devDependency
in my workspaces based monoreponpm exec -- caz .templates/my-template packages/my-new-package
Expected behaviour:
Require Node.js 12.20
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
安装gulp-scss后编译报错:
'compile:scss' errored after 494 μs
TypeError: plugins.scss is not a function
请问 level-04 后面的不细分讲解了么?
At present, all modules are imported directly using the import statement, such as:
import fs from 'fs'
import pkg from './package.json'
output code
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const package_1 = __importDefault(require("./package"));
__importDefault
is too redundant.
Maybe import = require() is a better choice for the commonjs module, such as:
import fs = require('fs')
export const contents = fs.readFileSync(...)
output code
var fs_1 = require("./fs");
exports.contents = fs_1.readFileSync(...)
ref:
parse json 错误
VM250:2 app.json
Expecting 'STRING','}', got INVALID
1 | {
| ^
(anonymous) @ VM250:2
执行:npx caz nm my-project
报错:Exception occurred: _fs2.default.promises.rm is not a function
.less .xml 微信开发者工具识别不了~ 该怎么处理呢???求指教
At present, if you use the local template, if the specified template directory does not exist, should you prompt the user with some error information?
在工具里调试都没有问题,但在预览上传代码时提示:代码包大小为 3021 kb,超出限制 1997 kb,请删除文件后重试
,请问这个问题怎么解决呢?谢谢
@clack/prompts
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These problems occurred while renovating this repository. View logs.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@commitlint/cli
, @commitlint/config-conventional
)ini
, @types/ini
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
adm-zip
, @types/adm-zip
)@commitlint/cli
, @commitlint/config-conventional
)semver
, @types/semver
).github/workflows/main.yml
actions/checkout v3
actions/setup-node v3
actions/checkout v3
actions/setup-node v3
package.json
@commitlint/cli 17.7.1
@commitlint/config-conventional 17.7.0
@types/adm-zip 0.5.1
@types/ini 1.3.31
@types/lodash 4.14.198
@types/node 20.11.22
@types/semver 7.5.2
@types/validate-npm-package-name 4.0.0
adm-zip 0.5.10
cac 6.7.14
env-paths 3.0.0
fast-glob 3.3.1
husky 8.0.3
ini 4.1.1
lint-staged 14.0.1
lodash 4.17.21
node-fetch 3.3.2
ora 7.0.1
prompts 2.4.2
semver 7.5.4
socks-proxy-agent 8.0.2
ts-standard 12.0.2
tsup 7.2.0
typescript 5.2.2
validate-npm-package-name 5.0.0
vitest 0.34.4
node >=16
求源码,大神
Hey there!
First of all thank you for creating this tool.
As I was implementing a scaffold tool for a React App I noticed the following issue, which from what I can see it is located in: https://github.com/zce/caz/blob/main/src/render.ts
// With the code in https://github.com/zce/caz/blob/main/src/render.ts caz interpolates also valid Bash syntax and ES2015
// The problem is that it will throw an error for variables it tries to replace, but are not intended for interpolation and are just valid code. This is because lodash default behaviour is to try and replace also ${var} syntax.
result = _.template('${foo} something')({foo: 'bar'})
console.log(result) // prints bar something
// Fixing it would be something in the line of customising the interpolate setting to only work with <% %> wrapped variables.
const regexp = /<%=?([\s\S]+?)%>/
result = _.template('${foo} something escape', {interpolate: regexp})({foo: 'bar'})
console.log(result) // ${foo} something escape
// As you can see this is interpolated correctly, while valid ${var} is ignored.
result = _.template('<%= foo %> something interpolated', {interpolate: regexp})({foo: 'bar'})
console.log(result) // bar something interpolated
This a related issue / question opened in lodash explaing further the solution proposed: lodash/lodash#4039
I would be willing to contribute, but I first would like to hear your opinion, granted I did not test yet this code with helpers functions.
Have a nice day!
douban.find('coming_soon', 1, 3)
.then(d => this.setData({ movies: d.subjects, loading: false }))
.catch(e => {
console.error(e)
this.setData({ movies: [], loading: false })
})
module.exports = {
find (type, page = 1, count = 20, search = '') {
const params = { start: (page - 1) * count, count: count }
return fetchApi(type, search ? Object.assign(params, { q: search }) : params)
.then(res => res.data)
},
findOne (id) {
return fetchApi('subject/' + id)
.then(res => res.data)
}
}
ES5+ES6,只是写的很不ES6 不知为什么要这么写呢
前辈您好。萌新使用您的https://douban.uieee.com ,开始是好的 , 但过会儿接口就报400,然后过个20来分钟就又能请求了。望指点是什么问题呢?蟹蟹
data : {msg: "rate_limit_exceeded2: 47.93.58.139", code: 112, request: "GET /v2/movie/****"}
我在本地搭建了个nginx,可以实现http的反向代理,但是豆瓣的api:https://api.douban.com 是https的,请问怎么咋实现了,查了好多了,还是不得其法
即在项目介绍页点击level04跳到level03
下载的开发者工具是0.12.130400
Hi,
I would like to create a custom template using TypeScript instead of JavaScript (using index.ts
instead of index.js
).
Since caz itself is written in TypeScript, I expected this to be supported out of the box.
But looks like it's not.
I could not find any example. All the existing templates are written in JavaScript.
It's a bit sad because the types already in caz.
I tried to modify the sample template to use TS (added required dependencies, etc).
But it fails to compile this empty template: index.ts
import { Template } from 'caz'
const templateDef: Template = {
//...
}
export default templateDef
I get this error:
> tsc
node_modules/caz/lib/init/index.d.ts:1:44 - error TS2307: Cannot find module './types' or its corresponding type declarations.
1 import { Options, Context, Template } from './types';
~~~~~~~~~
Any idea/suggestion ?
看了大神的教程获益匪浅,非常感谢!我感觉分支说明写的让我们这些新人能清晰的了解整个项目代码是怎么一步步写出来的,希望大神可以继续完成分支说明!
Hello,
I know that, by design, you prefer to have simple and lightweight templates. That's the reason why you "inherit" caz dependencies in the templates.
However, sometimes it may be desirable to allow the template to have its own dependencies.
I had the case where I just needed one additional library.
And I could not with the current implementation ;(
So, I forked your project to add the possiblity to optionally install template dependencies.
This is done by passing an additional flag in the command-line.
If you don't pass it, it keeps the current behaviour.
Would you be interested in merging this feature into the codebase ?
I think this would be better than having separate "forks" with different features.
If so, let me know, and I will submit a PR.
In the meantime, you can test this feature with the fork.
I already have one template using this feature:
npx ozeebee/caz ozeebee/cdk-project-template [project-name] --tpldeps
Thanks !
npm run dev后生成的dist文件, 用微信开发者工具打开dist就报错:https://api.map.baidu.com 不在以下 request 合法域名,为什么报错文档没相关说明,请问怎么解决?
{"msg":"Invalid request","code":999,"request":"GET /v2/isbn/9787508662091"}
你好 我使用你的接口去请求 但是你的网址为什么我在小程序上面 关掉了域名检测 会报这个错误
用chrome浏览器直接请求就不会。请问原因是?
Request URL:https://douban.uieee.com/v2/movie/in_theaters
Request Method:GET
Status Code:400 Bad Request
Remote Address:47.93.58.139:443
Referrer Policy:no-referrer-when-downgrade
At present, only the necessary information is output in the console, and there is no log for each work link, which is extremely unfriendly for users.
Appropriate log output for key steps.
从搭建一个微信小程序开始- 腾讯云
https://www.qcloud.com/act/event/yingyonghao.html
# other options
proxy = sock5://127.0.0.1:1080
$ ALL_PROXY=socks5://127.0.0.1:1080 caz nm my-module
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.