Code Monkey home page Code Monkey logo

valaxy-theme-starter's Introduction

Valaxy-Theme-Starter(vue)

npm npm dev dependency version

This is a template for creating a valaxy theme.

Usage

Clone to local

Use pnpm, because we need its workspace.

npx degit YunYouJun/valaxy-theme-starter valaxy-theme-name

cd valaxy-theme-name

# If you don't have pnpm installed
npm install -g pnpm

pnpm i

Development

# dev node
pnpm dev
# dev client
pnpm demo

Build

pnpm build

Release

Publish to npm.

Manual

pnpm ci:publish

Auto by GitHub Actions

You can release it by github actions.

Click Settings -> Secrets -> Actions in your GitHub repo.

Add New repository secret:

  • NPM_TOKEN: your npm token (Generate from your npm Access Tokens - Automation)
npm run release
# choose your version to automatic release

Checklist

  • Change the author name in LICENSE & package.json & .github
  • Write ThemeConfig & Other init content
  • Rename valaxy-theme-starter to valaxy-theme-<name> (custom it)
  • Change theme: 'starter' to theme: <name> in valaxy.config.ts
  • Each of your Vue components should have a namespace
    • For example: YunTest.vue for valaxy-theme-yun

About Checklist Rename

Rename valaxy-theme-starter with valaxy-theme-name in the package.json and valaxy.config.ts files.

PS: there are a total of four files that need to be rename

valaxy-theme-name
  - package.json
  - demo
    - package.json
    - valaxy.config.ts
  - theme
    - package.json

Let's write the theme & docs!

Thanks

Starter theme ref theme:

valaxy-theme-starter's People

Contributors

hikariyo avatar yunyoujun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hairyf

valaxy-theme-starter's Issues

归档页点击排序按钮报错的问题

如下图:
image
image

原因:
代码中在进行数组逆序时,直接在原数组使用了reverse函数,导致原数组发生变化从而导致递归

修改:
在YunPostCollpase.vue这个文件中将

const sortedYears = computed(() => {
  const y = years.value
  const arr = y.sort((a, b) => b - a)
  return isDesc.value ? arr : arr.reverse()
})

修改为

const sortedYears = computed(() => {
  const y = years.value
  const arr = y.sort((a, b) => b - a)
  return isDesc.value ? arr : [...arr].reverse()
})

更新 `valaxy` 版本导致 `sass` 出现问题

valaxy 更新到 0.14.28 后,会出现 sass 报错。

U}PSFTF7T2PU(RJ)UBKV QY

可以观察到给出报错 EISDIR,所以有解决方案:在 markdown.scss ·与 css-vars.scss 中将第一行的 @use 语句加上 index.scss

@use "valaxy/client/styles/mixins/index.scss" /* ... */

按理来说 index.scss 应该被自动加载,我在本地跑了 sass1.60 (对应 valaxy 0.14.25) 与 1.62 (对应 valaxy 0.14.28) 版本都没有出现问题,不知导致本仓库出现报错的具体原因。但无论如何,上述解决方案是可行的。

feat: add vsocde settings eslint.validate

添加更多的 eslint.validate 支持格式化更多文件

  "eslint.validate": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact",
    "vue",
    "html",
    "json",
    "jsonc",
    "json5",
    "markdown"
  ],

pnpm  warn: Issues with peer dependencies found

image

pnpm.peerDependencyRules should be added in root package

  "pnpm": {
    "peerDependencyRules": {
      "ignoreMissing": [
        "@types/markdown-it",
        "@algolia/client-search",
        "@types/react",
        "react",
        "react-dom"
      ]
    }
  }

After the first download, execute the `pnpm build` command, prompt for build failure

Operating Steps:
0. Create a new repository from valaxy-theme-starter (use the temeplate)

  1. git clone [email protected]:zmxlt/valaxy-theme-aurora.git
  2. cd valaxy-theme-aurora
  3. pnpm i success
  4. pnpm dev success
  5. pnpm demo success
  6. pnpm build report errors
D:\blog\valaxy-theme-aurora\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected][email protected][email protected]\node_modules\vite-ssg\dist\shared\vite-ssg.45ed6849.cjs:1048
        throw new Error(`${kolorist.gray("[vite-ssg]")} ${kolorist.red(`Error on page: ${kolorist.cyan(route)}`)}
              ^

Error: [vite-ssg] Error on page: /:all(.*)*
Error: ENOENT: no such file or directory, open 'D:\blog\valaxy-theme-aurora\demo\dist\:all(.*)*.html'
    at D:\blog\valaxy-theme-aurora\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected][email protected][email protected]\node_modules\vite-ssg\dist\shared\vite-ssg.45ed6849.cjs:1048:15
    at async run (D:\blog\valaxy-theme-aurora\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected][email protected][email protected]\node_modules\vite-ssg\dist\shared\vite-ssg.45ed6849.cjs:629:36)

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.