@component-hook/create-app 1.0.4 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +106 -82
  2. package/dist/index.js +35 -18
  3. package/package.json +1 -1
  4. package/template-vue/.github/actions/setup-environment/action.yml +45 -45
  5. package/template-vue/.github/renovate.json +12 -12
  6. package/template-vue/.github/workflows/ci.yml +22 -22
  7. package/template-vue/.github/workflows/deploy.yml +27 -27
  8. package/template-vue/.github/workflows/preview.yml +17 -17
  9. package/template-vue/.gitlab/setup.yml +18 -18
  10. package/template-vue/.husky/commit-msg +3 -3
  11. package/template-vue/.husky/pre-commit +3 -3
  12. package/template-vue/.vscode/extensions.json +10 -10
  13. package/template-vue/.vscode/settings.json +27 -27
  14. package/template-vue/LICENSE +21 -21
  15. package/template-vue/README.md.art +81 -100
  16. package/template-vue/_gitignore +38 -38
  17. package/template-vue/_gitlab-ci.yml +22 -22
  18. package/template-vue/index.html.art +28 -26
  19. package/template-vue/lint-staged.config.js +2 -0
  20. package/template-vue/package.json +71 -73
  21. package/template-vue/playwright.config.ts +12 -23
  22. package/template-vue/postcss.config.js +11 -10
  23. package/template-vue/src/__tests__/e2e/{IndexPage.spec.ts → home.spec.ts} +9 -5
  24. package/template-vue/src/__tests__/setup/unit-test.ts +1 -1
  25. package/template-vue/src/__tests__/unit/components/{indexPage → home}/HelloWorld.test.ts +3 -3
  26. package/template-vue/src/__tests__/unit/render/index.ts +4 -4
  27. package/template-vue/src/components/svg-icon/index.ts +1 -0
  28. package/template-vue/src/locales/en-US.json +3 -3
  29. package/template-vue/src/locales/zh-TW.json +3 -3
  30. package/template-vue/src/main.ts +6 -7
  31. package/template-vue/src/{components/indexPage → pages/home/components}/HelloWorld.vue +3 -8
  32. package/template-vue/src/pages/{IndexPage.vue → home/index.vue} +14 -3
  33. package/template-vue/src/router/index.ts +2 -2
  34. package/template-vue/src/stores/modules/{config.ts → config.ts.art} +1 -1
  35. package/template-vue/src/styles/base.css +48 -0
  36. package/template-vue/src/styles/common/all.css +1 -0
  37. package/template-vue/src/styles/common/button.css +15 -0
  38. package/template-vue/src/styles/index.css +3 -0
  39. package/template-vue/src/styles/tailwind.css +1 -0
  40. package/template-vue/src/vite-env.d.ts +13 -12
  41. package/template-vue/tsconfig.app.json +13 -13
  42. package/template-vue/tsconfig.json +14 -14
  43. package/template-vue/tsconfig.node.json +12 -12
  44. package/template-vue/tsconfig.vitest.json +8 -8
  45. package/template-vue/vite.config.ts +12 -11
  46. package/template-vue/vitest.config.ts +1 -1
  47. package/template-vue/public/mockServiceWorker.js +0 -307
  48. package/template-vue/src/components.d.ts +0 -14
  49. package/template-vue/src/styles/common/all.postcss +0 -1
  50. package/template-vue/src/styles/common/button.postcss +0 -12
  51. package/template-vue/src/styles/index.postcss +0 -1
  52. package/template-vue/src/styles/tailwind.postcss +0 -39
  53. package/template-vue/tailwind.config.js +0 -20
  54. /package/template-vue/src/assets/images/{svgIcons → svg-icons}/vue.svg +0 -0
  55. /package/template-vue/src/components/{common/SvgIcon.vue → svg-icon/src/index.vue} +0 -0
package/README.md CHANGED
@@ -1,82 +1,106 @@
1
- # @component-hook/create-app
2
-
3
- Scaffolding a basic `typescript` project.
4
-
5
- > **Compatibility Note:**
6
- > Requires [Node.js](https://nodejs.org/en/) version 18+, 20+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
7
-
8
- <p>
9
- <a href="https://npm-stat.com/charts.html?package=@component-hook/create-app">
10
- <img src="https://img.shields.io/npm/dm/@component-hook/create-app.svg" alt="npm"/>
11
- </a>
12
- <a href="https://www.npmjs.com/package/@component-hook/create-app">
13
- <img src="https://img.shields.io/npm/v/@component-hook/create-app.svg" alt="npm"/>
14
- </a>
15
- </p>
16
-
17
- ## Create Project
18
-
19
- ```bash
20
- $ npm create @component-hook/app@latest
21
-
22
- # or use yarn
23
- $ yarn create @component-hook/app
24
-
25
- # or use pnpm
26
- $ pnpm create @component-hook/app
27
- ```
28
-
29
- Then follow the prompts!
30
-
31
- You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a project, run:
32
-
33
- ```bash
34
- $ npm create @component-hook/app@latest basic-app -- --template vue
35
-
36
- # yarn
37
- $ yarn create @component-hook/app basic-app --template vue
38
-
39
- # pnpm
40
- $ pnpm create @component-hook/app basic-app --template vue
41
- ```
42
-
43
- Currently supported template presets include:
44
-
45
- - `vue`
46
-
47
- ## Project Default Setup
48
-
49
- - [Vite](https://cn.vite.dev/)
50
- - [TypeScript](https://www.typescriptlang.org/)
51
- - [Axios](https://github.com/axios/axios)
52
- - [TailwindcSS](https://tailwindcss.com/)
53
- - [PostCSS](https://postcss.org/) w/ `postcss-nesting` plugin
54
- - [Cssnano](https://cssnano.github.io/cssnano/) for minimizing production CSS
55
- - [Postcss-pxtorem](https://www.npmjs.com/package/postcss-pxtorem) generates rem units from pixel units
56
- - [Vite-plugin-svg-icons](https://github.com/vbenjs/vite-plugin-svg-icons) generate svg sprite map
57
- - [Eslint](https://eslint.org/)
58
- - [@component-hook/eslint-plugin](https://www.npmjs.com/package/@component-hook/eslint-plugin?activeTab=readme)
59
- - [Prettier](https://prettier.io/)
60
- - [Husky](https://www.npmjs.com/package/husky) to improves commits
61
- - if encounter npx: command not found, can execute `ln -s $(which npx) /usr/local/bin/npx` in zsh
62
- - [commitlint](https://commitlint.js.org/#/) checks if your commit messages meet the conventional commit format
63
- - [lint-staged](https://github.com/okonet/lint-staged) filter files checked by pre commit lint
64
- - Alias `@` to `<project_root>/src`
65
- - Mock use [msw](https://mswjs.io/)
66
- - `npx msw init ./public`
67
- - Unit test use [Vitest](https://vitest.dev/) + [Testing Library](https://testing-library.com/)
68
- - [jsdom](https://www.npmjs.com/package/jsdom)
69
- - [@vitest/coverage-v8](https://vitest.dev/guide/coverage.html)
70
- - [@testing-library/jest-dom](https://testing-library.com/docs/ecosystem-jest-dom/)
71
- - [@testing-library/user-event](https://testing-library.com/docs/ecosystem-user-event/)
72
- - E2E test use [playwright](https://playwright.dev/)
73
- - [Rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer) visualize and analyze your Rollup bundle to see which modules are taking up space
74
- - Predefined and fully typed global variables:
75
- - `VITE_APP_VERSION` is read from `package.json` version at build time
76
- - `VITE_APP_BUILD_EPOCH` is populated as `new Date().getTime()` at build time
77
- - Github workflows (default)
78
- - ci - on workflow call and dispatch
79
- - deploy - on push main branch
80
- - preview - on pull request
81
- - Gitlab CI (use `--gitlab` command create project)
82
- - run tests - on branches, merge request and manual
1
+ # @component-hook/create-app
2
+
3
+ Scaffolding a basic `typescript` project.
4
+
5
+ > **Compatibility Note:**
6
+ > Requires [Node.js](https://nodejs.org/en/) version 20+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
7
+
8
+ <p>
9
+ <a href="https://npm-stat.com/charts.html?package=@component-hook/create-app">
10
+ <img src="https://img.shields.io/npm/dm/@component-hook/create-app.svg" alt="npm"/>
11
+ </a>
12
+ <a href="https://www.npmjs.com/package/@component-hook/create-app">
13
+ <img src="https://img.shields.io/npm/v/@component-hook/create-app.svg" alt="npm"/>
14
+ </a>
15
+ </p>
16
+
17
+ ## Create Project
18
+
19
+ ```bash
20
+ $ npm create @component-hook/app@latest
21
+
22
+ # or use yarn
23
+ $ yarn create @component-hook/app
24
+
25
+ # or use pnpm
26
+ $ pnpm create @component-hook/app
27
+ ```
28
+
29
+ Then follow the prompts!
30
+
31
+ You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a project, run:
32
+
33
+ ```bash
34
+ $ npm create @component-hook/app@latest basic-app -- --template vue
35
+
36
+ # yarn
37
+ $ yarn create @component-hook/app basic-app --template vue
38
+
39
+ # pnpm
40
+ $ pnpm create @component-hook/app basic-app --template vue
41
+ ```
42
+
43
+ Currently supported template presets include:
44
+
45
+ - `vue`
46
+
47
+ ## Project Features Overview
48
+
49
+ This project leverages modern frontend practices and tooling, covering development experience, code quality, testing, and deployment.
50
+
51
+ ### Development Experience
52
+
53
+ - **Written in TypeScript**: Provides type safety and better maintainability.
54
+ - **Styled with Tailwind CSS**: Utility-first CSS framework for fast and consistent UI styling.
55
+ - **SVG Support**: Integrated [`vite-plugin-svg-icons`](https://github.com/vbenjs/vite-plugin-svg-icons) to use SVGs as Vue components.
56
+
57
+ ### API & Mocking
58
+
59
+ - Handles HTTP requests using `axios`.
60
+ - Uses `msw` (Mock Service Worker) for mocking APIs, enabling smooth local development and testing.
61
+
62
+ ### Code Quality
63
+
64
+ - Enforces consistent code style with `ESLint` and `Prettier`.
65
+ - Enhanced with:
66
+ - `husky`: For Git hooks.
67
+ - `lint-staged`: Only runs linters on staged files.
68
+ - `commitlint`: Ensures commit messages follow conventional format.
69
+
70
+ ### Testing
71
+
72
+ - Unit testing with `Vitest` + `Testing Library`.
73
+ - End-to-end (E2E) testing using `Playwright`.
74
+
75
+ ### Optimization
76
+
77
+ - Minifies CSS with `cssnano`.
78
+ - Converts px to rem using `postcss-pxtorem` for responsive design.
79
+ - Uses `rollup-plugin-visualizer` to analyze bundle sizes.
80
+
81
+ ### CI / CD
82
+
83
+ - Integrated `GitHub Actions` and `GitLab CI` for automated testing and deployment.
84
+
85
+ ### Project Structure & Conventions
86
+
87
+ - The project root alias `@` points to the `src` directory (`<project_root>/src`).
88
+ - ESLint uses a custom plugin: [`@component-hook/eslint-plugin`](https://www.npmjs.com/package/@component-hook/eslint-plugin).
89
+
90
+ ### Tip: Solving `npx: command not found`
91
+
92
+ If you encounter `npx: command not found`, run the following command to create a symbolic link:
93
+
94
+ ```bash
95
+ ln -s $(which npx) /usr/local/bin/npx
96
+ ```
97
+
98
+ ### Predefined Global Variables
99
+
100
+ These variables are injected at build time and are fully typed:
101
+
102
+ | Variable Name | Description |
103
+ | ---------------------- | -------------------------------------------- |
104
+ | `VITE_APP_VERSION` | Read from `package.json` version |
105
+ | `VITE_APP_BUILD_EPOCH` | Timestamp generated at build time |
106
+ | `VITE_APP_MOCK` | Indicates whether the mock environment is on |
package/dist/index.js CHANGED
@@ -1,28 +1,29 @@
1
1
  // src/index.ts
2
+ import { readdirSync as readdirSync2, statSync } from "node:fs";
3
+ import { readdir, readFile, writeFile } from "node:fs/promises";
2
4
  import path2 from "node:path";
3
5
  import { fileURLToPath } from "node:url";
4
- import { readdir, readFile, writeFile } from "node:fs/promises";
5
- import minimist from "minimist";
6
- import colors2 from "picocolors";
7
- import { copy, ensureDirSync } from "fs-extra/esm";
8
6
  import artTemplate from "art-template";
7
+ import { copy, ensureDirSync } from "fs-extra/esm";
8
+ import minimist from "minimist";
9
9
  import ora from "ora";
10
+ import colors2 from "picocolors";
11
+
12
+ // src/constants.ts
13
+ var DEFAULT_PROJECT_NAME = "basic-project";
14
+ var TEMPLATES = ["vue"];
15
+ var GITHUB_ACTIONS = "GitHub Actions";
16
+ var GITLAB_CI = "GitLab CI";
10
17
 
11
18
  // src/prompts.ts
12
19
  import { existsSync as existsSync2 } from "node:fs";
13
- import prompts from "prompts";
14
20
  import colors from "picocolors";
21
+ import prompts from "prompts";
15
22
 
16
23
  // src/utils.ts
17
- import path from "node:path";
18
24
  import { existsSync, readdirSync } from "node:fs";
25
+ import path from "node:path";
19
26
  import { remove } from "fs-extra/esm";
20
-
21
- // src/config.ts
22
- var DEFAULT_PROJECT_NAME = "basic-project";
23
- var TEMPLATES = ["vue"];
24
-
25
- // src/utils.ts
26
27
  function formatTargetDir(targetDir) {
27
28
  if (!targetDir) return targetDir;
28
29
  targetDir = targetDir.trim();
@@ -46,6 +47,9 @@ function isValidPackageName(projectName) {
46
47
  function toValidPackageName(projectName) {
47
48
  return projectName.trim().toLowerCase().replaceAll(/\s+/g, "-").replace(/^[._]/, "").replaceAll(/[^a-z\d\-~]+/g, "-");
48
49
  }
50
+ function toUpperCasePackageName(projectName) {
51
+ return projectName.split("-").map((str) => `${str[0].toUpperCase()}${str.slice(1)}`).join(" ");
52
+ }
49
53
  function getPkgManagerInfo() {
50
54
  const userAgent = process.env.npm_config_user_agent;
51
55
  if (!userAgent) return;
@@ -108,7 +112,7 @@ function operationPrompts({ targetDir, template }) {
108
112
  type: (_, { projectName: nameAnswer }) => {
109
113
  return isValidPackageName(getProjectName(nameAnswer)) ? null : "text";
110
114
  },
111
- name: "projectName",
115
+ name: "packageName",
112
116
  message: styleTitle("Package name:"),
113
117
  initial: (_, { projectName: nameAnswer }) => toValidPackageName(getProjectName(nameAnswer)),
114
118
  validate: (name) => {
@@ -154,7 +158,7 @@ Available templates:
154
158
  ${colors2.green("vue")}
155
159
  `;
156
160
  async function copyTemplateFolder(root, templateDir, packageName) {
157
- const isGitlab = argv.lab || argv.gitlab;
161
+ const isGitlab = argv.l || argv.gitlab;
158
162
  const [files, pkgJson] = await Promise.all([
159
163
  readdir(templateDir),
160
164
  readFile(path2.join(templateDir, "package.json"), "utf-8")
@@ -172,11 +176,24 @@ async function copyTemplateFolder(root, templateDir, packageName) {
172
176
  }
173
177
  const templatePath = path2.join(templateDir, file);
174
178
  if (file.endsWith(".art")) {
175
- const name = packageName.split("-").map((str) => `${str[0].toUpperCase()}${str.slice(1)}`).join(" ");
176
- const renderedResult = artTemplate(templatePath, { projectName: name });
177
- return writeFile(targetPath.replace(".art", ""), renderedResult);
179
+ const isScript = file.endsWith(".js.art") || file.endsWith(".ts.art");
180
+ const name = isScript ? packageName : toUpperCasePackageName(packageName);
181
+ const replacedPath = targetPath.replace(".art", "");
182
+ const renderedResult = artTemplate(templatePath, {
183
+ projectName: name,
184
+ gitRepository: isGitlab ? GITLAB_CI : GITHUB_ACTIONS
185
+ });
186
+ ensureDirSync(path2.dirname(replacedPath));
187
+ return writeFile(replacedPath, renderedResult);
188
+ }
189
+ if (statSync(templatePath).isDirectory()) {
190
+ const subFiles = readdirSync2(templatePath);
191
+ const rewriteOrCopySubFilePromises = subFiles.map((subFile) => rewriteOrCopyFile(path2.join(file, subFile)));
192
+ return Promise.all(rewriteOrCopySubFilePromises).then(() => {
193
+ });
194
+ } else {
195
+ return copy(templatePath, targetPath);
178
196
  }
179
- return copy(templatePath, targetPath);
180
197
  };
181
198
  pkg.name = packageName;
182
199
  return Promise.all([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-hook/create-app",
3
- "version": "1.0.4",
3
+ "version": "1.1.1",
4
4
  "description": "Scaffolding a basic typescript project",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,45 +1,45 @@
1
- name: Setup environment
2
-
3
- description: Install dependencies
4
-
5
- runs:
6
- using: composite
7
- steps:
8
- - name: install Node.js
9
- uses: actions/setup-node@v4
10
- with:
11
- node-version: 20
12
-
13
- - name: install pnpm
14
- uses: pnpm/action-setup@v4
15
- with:
16
- run_install: false
17
-
18
- - name: get pnpm store directory
19
- id: pnpm-cache
20
- shell: bash
21
- run: |
22
- echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
23
-
24
- - name: setup pnpm cache
25
- uses: actions/cache@v4
26
- with:
27
- path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
28
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
29
- restore-keys: |
30
- ${{ runner.os }}-pnpm-store-
31
-
32
- - name: setup node_modules cache
33
- id: dependencies-cache
34
- uses: actions/cache@v4
35
- with:
36
- path: |
37
- **/node_modules
38
- key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
39
- restore-keys: |
40
- ${{ runner.os }}-node-modules-
41
-
42
- - name: install dependencies
43
- if: steps.dependencies-cache.outputs.cache-hit != 'true'
44
- shell: bash
45
- run: pnpm install
1
+ name: Setup environment
2
+
3
+ description: Install dependencies
4
+
5
+ runs:
6
+ using: composite
7
+ steps:
8
+ - name: install Node.js
9
+ uses: actions/setup-node@v4
10
+ with:
11
+ node-version: 20
12
+
13
+ - name: install pnpm
14
+ uses: pnpm/action-setup@v4
15
+ with:
16
+ run_install: false
17
+
18
+ - name: get pnpm store directory
19
+ id: pnpm-cache
20
+ shell: bash
21
+ run: |
22
+ echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
23
+
24
+ - name: setup pnpm cache
25
+ uses: actions/cache@v4
26
+ with:
27
+ path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
28
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
29
+ restore-keys: |
30
+ ${{ runner.os }}-pnpm-store-
31
+
32
+ - name: setup node_modules cache
33
+ id: dependencies-cache
34
+ uses: actions/cache@v4
35
+ with:
36
+ path: |
37
+ **/node_modules
38
+ key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
39
+ restore-keys: |
40
+ ${{ runner.os }}-node-modules-
41
+
42
+ - name: install dependencies
43
+ if: steps.dependencies-cache.outputs.cache-hit != 'true'
44
+ shell: bash
45
+ run: pnpm install
@@ -1,12 +1,12 @@
1
- {
2
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
- "extends": ["config:base", "group:allNonMajor", "schedule:weekly", ":semanticCommitTypeAll(chore)"],
4
- "labels": ["dependencies"],
5
- "rangeStrategy": "bump",
6
- "packageRules": [
7
- {
8
- "depTypeList": ["peerDependencies"],
9
- "enabled": false
10
- }
11
- ]
12
- }
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": ["config:base", "group:allNonMajor", "schedule:weekly", ":semanticCommitTypeAll(chore)"],
4
+ "labels": ["dependencies"],
5
+ "rangeStrategy": "bump",
6
+ "packageRules": [
7
+ {
8
+ "depTypeList": ["peerDependencies"],
9
+ "enabled": false
10
+ }
11
+ ]
12
+ }
@@ -1,22 +1,22 @@
1
- name: CI Pipeline
2
-
3
- on:
4
- workflow_call:
5
- workflow_dispatch:
6
-
7
- jobs:
8
- CI:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v4
12
- - name: setup environment
13
- uses: './.github/actions/setup-environment'
14
-
15
- - name: install Playwright browsers
16
- run: npx playwright install --with-deps
17
-
18
- - name: run unit test
19
- run: pnpm test:unit
20
-
21
- - name: run e2e test
22
- run: pnpm test:ci-e2e
1
+ name: CI Pipeline
2
+
3
+ on:
4
+ workflow_call:
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ CI:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - name: setup environment
13
+ uses: './.github/actions/setup-environment'
14
+
15
+ - name: install Playwright browsers
16
+ run: npx playwright install --with-deps
17
+
18
+ - name: run unit test
19
+ run: pnpm test:unit
20
+
21
+ - name: run e2e test
22
+ run: pnpm test:ci-e2e
@@ -1,27 +1,27 @@
1
- name: Deploy to Production
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- paths:
7
- - 'src/**'
8
- - 'pnpm-lock.yaml'
9
- - 'package.json'
10
-
11
- jobs:
12
- CI:
13
- uses: './.github/workflows/ci.yml'
14
-
15
- deploy:
16
- runs-on: ubuntu-latest
17
- needs: CI
18
- steps:
19
- - uses: actions/checkout@v4
20
- # - name: setup environment
21
- # uses: './.github/actions/setup-environment'
22
-
23
- # - name: build production
24
- # run: pnpm build:production
25
-
26
- # - name: deploy to production
27
- # run: pnpm deploy
1
+ name: Deploy to Production
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'src/**'
8
+ - 'pnpm-lock.yaml'
9
+ - 'package.json'
10
+
11
+ jobs:
12
+ CI:
13
+ uses: './.github/workflows/ci.yml'
14
+
15
+ deploy:
16
+ runs-on: ubuntu-latest
17
+ needs: CI
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ # - name: setup environment
21
+ # uses: './.github/actions/setup-environment'
22
+
23
+ # - name: build production
24
+ # run: pnpm build:production
25
+
26
+ # - name: deploy to production
27
+ # run: pnpm deploy
@@ -1,17 +1,17 @@
1
- name: Prewiew Pull Request
2
-
3
- on:
4
- pull_request:
5
- types: [opened, synchronize, reopened]
6
-
7
- jobs:
8
- CI:
9
- uses: './.github/workflows/ci.yml'
10
-
11
- preview:
12
- runs-on: ubuntu-latest
13
- needs: CI
14
- steps:
15
- - uses: actions/checkout@v4
16
- # - name: setup environment
17
- # uses: './.github/actions/setup-environment'
1
+ name: Prewiew Pull Request
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened]
6
+
7
+ jobs:
8
+ CI:
9
+ uses: './.github/workflows/ci.yml'
10
+
11
+ preview:
12
+ runs-on: ubuntu-latest
13
+ needs: CI
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ # - name: setup environment
17
+ # uses: './.github/actions/setup-environment'
@@ -1,18 +1,18 @@
1
- variables:
2
- NODE_VERSION: '20'
3
- CACHE_KEY: '${CI_PROJECT_PATH_SLUG}-${CI_COMMIT_REF_SLUG}'
4
-
5
- image: node:${NODE_VERSION}-alpine
6
-
7
- cache:
8
- key: ${CACHE_KEY}
9
- paths:
10
- - .pnpm-store
11
- - node_modules/
12
- policy: pull-push
13
-
14
- before_script:
15
- - corepack enable
16
- - corepack prepare --activate
17
- - pnpm config set store-dir .pnpm-store
18
- - pnpm install
1
+ variables:
2
+ NODE_VERSION: '20'
3
+ CACHE_KEY: '${CI_PROJECT_PATH_SLUG}-${CI_COMMIT_REF_SLUG}'
4
+
5
+ image: node:${NODE_VERSION}-alpine
6
+
7
+ cache:
8
+ key: ${CACHE_KEY}
9
+ paths:
10
+ - .pnpm-store
11
+ - node_modules/
12
+ policy: pull-push
13
+
14
+ before_script:
15
+ - corepack enable
16
+ - corepack prepare --activate
17
+ - pnpm config set store-dir .pnpm-store
18
+ - pnpm install
@@ -1,3 +1,3 @@
1
- #!/bin/sh
2
-
3
- npx --no -- commitlint --edit ${1}
1
+ #!/bin/sh
2
+
3
+ npx --no -- commitlint --edit ${1}
@@ -1,3 +1,3 @@
1
- #!/bin/sh
2
-
3
- npx lint-staged
1
+ #!/bin/sh
2
+
3
+ npx lint-staged
@@ -1,10 +1,10 @@
1
- {
2
- "recommendations": [
3
- "vue.volar",
4
- "bradlc.vscode-tailwindcss",
5
- "esbenp.prettier-vscode",
6
- "csstools.postcss",
7
- "cpylua.language-postcss",
8
- "streetsidesoftware.code-spell-checker"
9
- ]
10
- }
1
+ {
2
+ "recommendations": [
3
+ "vue.volar",
4
+ "bradlc.vscode-tailwindcss",
5
+ "esbenp.prettier-vscode",
6
+ "csstools.postcss",
7
+ "cpylua.language-postcss",
8
+ "streetsidesoftware.code-spell-checker"
9
+ ]
10
+ }