xiaohanyu 最近的时间轴更新
xiaohanyu

xiaohanyu

V2EX 第 33155 号会员,加入于 2013-01-27 22:01:04 +08:00
PPResume 新年更新:新增两款简历模板
  •  2   
    分享创造  •  xiaohanyu  •  21 天前  •  最后回复来自 xiaohanyu
    8
    SaaS 产品集成 Stripe 支付的一些坑
    Stripe  •  xiaohanyu  •  99 天前  •  最后回复来自 xiaohanyu
    19
    Safari 的 bug 真是茫茫多
  •  1   
    Safari  •  xiaohanyu  •  218 天前  •  最后回复来自 xiaohanyu
    12
    xiaohanyu 最近回复了
    7 天前
    回复了 oldcai 创建的主题 Stripe Stripe 怎样收税比较简单?
    除了切换成 MoR 这种,没什么特别好的办法。

    网上有人说这种小 SaaS 除了在自己所在的国家 jurisdication 交交 sales tax ,别的可以不用管,有风险,但是不用 care 太多。
    7 天前
    回复了 Cola98 创建的主题 程序员 nextjs 正确使用方式
    @superhot

    我的项目架构 ( https://ppresume.com) 大概是这样的:

    - ppresume
    - packages/common
    - packages/api
    - packages/client

    ```sh
    $ ls -l packages package.json pnpm-workspace.yaml pnpm-lock.yaml
    -rw-r--r-- 1 hanyu staff 1485 Jan 14 21:09 package.json
    -rw-r--r-- 1 hanyu staff 744184 Dec 30 10:49 pnpm-lock.yaml
    -rw-r--r-- 1 hanyu staff 27 Jan 22 2024 pnpm-workspace.yaml

    packages:
    total 0
    drwxr-xr-x 16 hanyu staff 512 Jan 14 21:09 api
    drwxr-xr-x 24 hanyu staff 768 Jan 14 21:09 client
    drwxr-xr-x 12 hanyu staff 384 Jan 14 21:09 common
    ```

    - api: 后端 API
    - client: 前端 next.js 实现
    - common: 前后端共享的 data model/schema validation/utils 等等,不依赖 node.js 系统 API ,所以可以同时跑在两端上。

    回复你的问题:

    1. tsconfig 我没有特别配置过,common package 的 tsconfig:

    ```json
    {
    "compilerOptions": {
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,

    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "types": ["node", "jest"],

    "importHelpers": true,
    "composite": true,
    "target": "es5",

    "rootDir": "src",
    "outDir": "dist",

    "baseUrl": "."
    },

    "include": ["**/*.ts", "**/*.json"]
    }
    ```

    2. 把 common package 当成一个单独的 npm/pnpm 包引入 api/client ,不需要用嵌套路径。npm/pnpm/yarn 都有相应的 workspace 特性,我最开始用的是 yarn ,后来转到了 pnpm ,参考: https://pnpm.io/workspaces

    我的 pnpm-workspace 配置:

    ```
    packages:
    - 'packages/*'
    ```

    顶层 `package.json` 配置:

    ```
    {
    "name": "ppresume",
    "private": true,
    "version": "0.7.0",
    "dependencies": {
    "concurrently": "^8.2.1",
    "husky": "^8.0.2",
    "lint-staged": "^13.1.0",
    "prettier": "^2.8.1"
    },
    "devDependencies": {
    "@commitlint/cli": "^19.3.0",
    "@commitlint/config-conventional": "^19.2.2",
    "@trivago/prettier-plugin-sort-imports": "^4.0.0",
    "commit-and-tag-version": "^12.4.0"
    },
    "lint-staged": {
    "**/*": "prettier --write --ignore-unknown"
    },
    "resolutions": {
    "jackspeak": "2.1.1"
    },
    "scripts": {
    "api": "pnpm --filter api",
    "common": "pnpm --filter common",
    "coverage": "pnpm common build && concurrently --kill-others-on-fail \"pnpm common coverage\" \"pnpm client coverage\" \"pnpm api coverage\"",
    "client": "pnpm --filter client",
    "build": "pnpm common build && concurrently --kill-others-on-fail \"pnpm client build\" \"pnpm api build\"",
    "dev": "pnpm common build && concurrently --kill-others-on-fail \"pnpm client dev\" \"pnpm api dev\"",
    "start": "pnpm common build && concurrently --kill-others-on-fail \"pnpm client start\" \"pnpm api start\"",
    "test": "pnpm common build && concurrently --kill-others-on-fail \"pnpm common test\" \"pnpm client test\" \"pnpm api test\"",
    "release": "commit-and-tag-version --bumpFiles package.json packages/*/package.json",
    "commitlint": "commitlint --edit"
    },
    "commit-and-tag-version": {
    "writerOpts": {
    "commitsSort": false
    }
    }
    }
    ```

    `common/package.json` 的配置:

    ```
    {
    "name": "common",
    "version": "0.7.0",
    "description": "common code shared by ppresume project",
    "author": "Xiao Hanyu",
    "private": true,
    "devDependencies": {
    "@types/jest": "^29.5.5",
    "@types/lodash": "^4.14.202",
    "@types/node": "^20.5.7",
    "jest": "^29.7.0",
    "ts-jest": "^29.1.1",
    "typescript": "^5.2.2"
    },
    "main": "dist/index",
    "types": "dist/index",
    "scripts": {
    "build": "tsc --build --force",
    "coverage": "jest --coverage",
    "test": "jest"
    },
    "dependencies": {
    "escape-latex": "^1.2.0",
    "tslib": "^2.6.2"
    }
    }
    ```

    调用 `pnpm common build` 来完成 `common` package 的 build ,然后在 api/client 里直接 `import xxx from 'common'` 就可以了

    3. mono-repo 有 mono-repo 的好处的,最大的好处是出了 regression 问题可以用 `git bisect` 找 bug ,commit log 的维护重点还是靠个人/团队守规则。

    我个人项目的概况: https://x.com/hanyuxiao1988/status/1878625079829172510

    以上
    21 天前
    回复了 xiaohanyu 创建的主题 分享创造 PPResume 新年更新:新增两款简历模板
    @sikex 收到收到,太感谢了,bug 报告很详细。
    22 天前
    回复了 xiaohanyu 创建的主题 分享创造 PPResume 新年更新:新增两款简历模板
    @anUglyDog 嗯,有时候颜值就是正义么,哈哈
    22 天前
    回复了 xiaohanyu 创建的主题 分享创造 PPResume 新年更新:新增两款简历模板
    @scienhub 嗯,仁兄是懂行的哈
    22 天前
    回复了 xiaohanyu 创建的主题 分享创造 PPResume 新年更新:新增两款简历模板
    @scienhub 排版引擎是 LaTeX 呢,具体来说是 XeLaTeX 引擎,前两个月写了篇关于排版引擎技术选型的文章: https://blog.ppresume.com/posts/zh-CN/on-typesetting-engines ,供参考哈。

    中文排版也是完全支持的,而且支持简体中文、繁体中文(香港)和繁体中文(台湾)三种,具体可以看:

    - blog: https://blog.ppresume.com/posts/multi-languagues-support
    - doc: https://docs.ppresume.com/content/multi-languages
    @wincatcher 加油加油
    试验了下,挺不错的,是有打算做成类似于 similarweb 这样的工具平台么?有商业化计划么?
    问一下,网站数据是从哪里分析出来的呀?
    @realpg 你这人真是搞笑了咧,我哪里自说自话了?你怎么知道我没跟 paddle 的真人联系啊?为了开个户我还得订机票远涉重洋去找他们线下谈?你找他们线下谈他们就能接受么?

    我邮件跟他们谈过几轮,贴几段原文:

    ```
    Hi Hanyu,

    I completely understand that you have registered your company recently and therefore you do not have the processing statements required.

    However as a company, Paddle prioritises the safety and security of our valued customers, and this information is necessary for us to ensure a secure environment for all.

    As we are unable to support your business at this time, I would recommend using an alternative payment provider until you are able to provide the requested processing statements.

    I assure you that once you are able to resubmit your domain with the necessary information, our team will be more than happy to reassess the situation and provide a prompt response.

    I appreciate your understanding.
    ```

    ```
    Hi Hanyu,

    I understand the challenge you're facing. To clarify, you will need to provide processing statements from a payment processor for at least the past three months. These statements help us assess your transaction history and ensure everything aligns with our requirements.

    Yes, it typically means that you’ll need to integrate with another payment processor and generate some transaction history before applying for Paddle. Once you’re approved by Paddle, you can then migrate your customer data to our platform.

    If you have any more questions or need further assistance during this process, please feel free to reach out.
    ```

    人家已经写了:“Yes, it typically means that you’ll need to integrate with another payment processor and generate some transaction history before applying for Paddle. ”,但是这条规则就没在 paddle 的官网上明示过。

    问题是,如果我已经集成了一个 payment processor ,我干嘛还要再费那个劲迁移到 paddle 啊? MoR 的服务又不只 paddle 一家。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   698 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 20:58 · PVG 04:58 · LAX 12:58 · JFK 15:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.