@winjs-dev/create-win 1.0.0-alpha.2

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 (150) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +195 -0
  3. package/bin/create-win.js +4 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +23 -0
  6. package/dist/index.d.ts +45 -0
  7. package/dist/index.js +396 -0
  8. package/dist/template.d.ts +13 -0
  9. package/dist/template.js +123 -0
  10. package/package.json +36 -0
  11. package/templates/app/.cursor/rules/clean-code.mdc +55 -0
  12. package/templates/app/.cursor/rules/general.mdc +51 -0
  13. package/templates/app/.cursor/rules/git-conventional-commit-messages.mdc +127 -0
  14. package/templates/app/.cursor/rules/gitflow.mdc +111 -0
  15. package/templates/app/.cursor/rules/project-structure.mdc +69 -0
  16. package/templates/app/.cursor/rules/typescript.mdc +57 -0
  17. package/templates/app/.cursor/rules/vue.mdc +86 -0
  18. package/templates/app/.editorconfig.tpl +23 -0
  19. package/templates/app/.eslintignore +13 -0
  20. package/templates/app/.eslintrc.js +9 -0
  21. package/templates/app/.gitignore.tpl +55 -0
  22. package/templates/app/.husky/commit-msg +6 -0
  23. package/templates/app/.husky/pre-commit +5 -0
  24. package/templates/app/.lintstagedrc.tpl +5 -0
  25. package/templates/app/.npmrc.tpl +2 -0
  26. package/templates/app/.prettierignore +13 -0
  27. package/templates/app/.prettierrc.js +4 -0
  28. package/templates/app/.stylelintignore +6 -0
  29. package/templates/app/.stylelintrc.js +16 -0
  30. package/templates/app/.winrc.ts.tpl +95 -0
  31. package/templates/app/README.md +244 -0
  32. package/templates/app/commitlint.config.js +3 -0
  33. package/templates/app/f2elint.config.js +6 -0
  34. package/templates/app/package.json.tpl +34 -0
  35. package/templates/app/plugin.ts.tpl +23 -0
  36. package/templates/app/src/app.js +55 -0
  37. package/templates/app/src/assets/fonts/demo.css +412 -0
  38. package/templates/app/src/assets/fonts/demo_fontclass.html +42 -0
  39. package/templates/app/src/assets/fonts/demo_symbol.html +69 -0
  40. package/templates/app/src/assets/fonts/demo_unicode.html +77 -0
  41. package/templates/app/src/assets/fonts/iconfont.css +20 -0
  42. package/templates/app/src/assets/fonts/iconfont.eot +0 -0
  43. package/templates/app/src/assets/fonts/iconfont.js +96 -0
  44. package/templates/app/src/assets/fonts/iconfont.svg +36 -0
  45. package/templates/app/src/assets/fonts/iconfont.ttf +0 -0
  46. package/templates/app/src/assets/fonts/iconfont.woff +0 -0
  47. package/templates/app/src/assets/img/logo.png +0 -0
  48. package/templates/app/src/assets/js/.gitkeep +0 -0
  49. package/templates/app/src/assets/style/app.less +5 -0
  50. package/templates/app/src/assets/style/main.less +39 -0
  51. package/templates/app/src/assets/style/variable.less +53 -0
  52. package/templates/app/src/constant.js +5 -0
  53. package/templates/app/src/global.less +1 -0
  54. package/templates/app/src/icons/cat.svg +1 -0
  55. package/templates/app/src/icons/dog.svg +1 -0
  56. package/templates/app/src/layouts/index.vue +15 -0
  57. package/templates/app/src/pages/docs.vue +5 -0
  58. package/templates/app/src/pages/hello/index.vue +88 -0
  59. package/templates/app/src/pages/hello/style.less +41 -0
  60. package/templates/app/src/pages/index.vue +9 -0
  61. package/templates/app/src/services/RESTFULURL.js +3 -0
  62. package/templates/app/src/services/autoMatchBaseUrl.js +18 -0
  63. package/templates/app/src/services/index.js +11 -0
  64. package/templates/app/src/services/request.js +178 -0
  65. package/templates/app/tsconfig.json.tpl +3 -0
  66. package/templates/app/typings.d.ts +1 -0
  67. package/templates/pc/.cursor/rules/clean-code.mdc +55 -0
  68. package/templates/pc/.cursor/rules/general.mdc +51 -0
  69. package/templates/pc/.cursor/rules/git-conventional-commit-messages.mdc +127 -0
  70. package/templates/pc/.cursor/rules/gitflow.mdc +111 -0
  71. package/templates/pc/.cursor/rules/project-structure.mdc +69 -0
  72. package/templates/pc/.cursor/rules/typescript.mdc +57 -0
  73. package/templates/pc/.cursor/rules/vue.mdc +86 -0
  74. package/templates/pc/.editorconfig.tpl +23 -0
  75. package/templates/pc/.eslintignore +13 -0
  76. package/templates/pc/.eslintrc.js +9 -0
  77. package/templates/pc/.gitignore.tpl +54 -0
  78. package/templates/pc/.husky/commit-msg +6 -0
  79. package/templates/pc/.husky/pre-commit +5 -0
  80. package/templates/pc/.lintstagedrc.tpl +5 -0
  81. package/templates/pc/.npmrc.tpl +2 -0
  82. package/templates/pc/.prettierignore +13 -0
  83. package/templates/pc/.prettierrc.js +4 -0
  84. package/templates/pc/.stylelintignore +6 -0
  85. package/templates/pc/.stylelintrc.js +16 -0
  86. package/templates/pc/.winrc.ts.tpl +74 -0
  87. package/templates/pc/README.md +255 -0
  88. package/templates/pc/commitlint.config.js +3 -0
  89. package/templates/pc/f2elint.config.js +6 -0
  90. package/templates/pc/package.json.tpl +33 -0
  91. package/templates/pc/plugin.ts.tpl +23 -0
  92. package/templates/pc/src/app.js +55 -0
  93. package/templates/pc/src/assets/fonts/demo.css +412 -0
  94. package/templates/pc/src/assets/fonts/demo_fontclass.html +42 -0
  95. package/templates/pc/src/assets/fonts/demo_symbol.html +69 -0
  96. package/templates/pc/src/assets/fonts/demo_unicode.html +77 -0
  97. package/templates/pc/src/assets/fonts/iconfont.css +20 -0
  98. package/templates/pc/src/assets/fonts/iconfont.eot +0 -0
  99. package/templates/pc/src/assets/fonts/iconfont.js +96 -0
  100. package/templates/pc/src/assets/fonts/iconfont.svg +36 -0
  101. package/templates/pc/src/assets/fonts/iconfont.ttf +0 -0
  102. package/templates/pc/src/assets/fonts/iconfont.woff +0 -0
  103. package/templates/pc/src/assets/img/logo.png +0 -0
  104. package/templates/pc/src/assets/js/.gitkeep +0 -0
  105. package/templates/pc/src/assets/style/app.less +5 -0
  106. package/templates/pc/src/assets/style/main.less +39 -0
  107. package/templates/pc/src/assets/style/variable.less +53 -0
  108. package/templates/pc/src/constant.js +5 -0
  109. package/templates/pc/src/global.less +1 -0
  110. package/templates/pc/src/icons/cat.svg +1 -0
  111. package/templates/pc/src/icons/dog.svg +1 -0
  112. package/templates/pc/src/layouts/index.vue +16 -0
  113. package/templates/pc/src/pages/docs.vue +5 -0
  114. package/templates/pc/src/pages/hello/index.vue +88 -0
  115. package/templates/pc/src/pages/hello/style.less +41 -0
  116. package/templates/pc/src/pages/index.vue +9 -0
  117. package/templates/pc/src/services/RESTFULURL.js +3 -0
  118. package/templates/pc/src/services/autoMatchBaseUrl.js +18 -0
  119. package/templates/pc/src/services/index.js +11 -0
  120. package/templates/pc/src/services/request.js +178 -0
  121. package/templates/pc/tsconfig.json.tpl +3 -0
  122. package/templates/pc/typings.d.ts +1 -0
  123. package/templates/plugin/.fatherrc.ts +5 -0
  124. package/templates/plugin/.gitignore.tpl +2 -0
  125. package/templates/plugin/.npmrc.tpl +2 -0
  126. package/templates/plugin/README.md.tpl +29 -0
  127. package/templates/plugin/package.json.tpl +26 -0
  128. package/templates/plugin/src/index.ts.tpl +5 -0
  129. package/templates/plugin/tsconfig.json +19 -0
  130. package/templates/sample/.cursor/rules/clean-code.mdc +55 -0
  131. package/templates/sample/.cursor/rules/general.mdc +51 -0
  132. package/templates/sample/.cursor/rules/git-conventional-commit-messages.mdc +127 -0
  133. package/templates/sample/.cursor/rules/gitflow.mdc +111 -0
  134. package/templates/sample/.cursor/rules/project-structure.mdc +69 -0
  135. package/templates/sample/.cursor/rules/typescript.mdc +57 -0
  136. package/templates/sample/.cursor/rules/vue.mdc +86 -0
  137. package/templates/sample/.editorconfig.tpl +23 -0
  138. package/templates/sample/.gitignore.tpl +19 -0
  139. package/templates/sample/.npmrc.tpl +2 -0
  140. package/templates/sample/.winrc.ts.tpl +7 -0
  141. package/templates/sample/package.json.tpl +21 -0
  142. package/templates/sample/plugin.ts.tpl +7 -0
  143. package/templates/sample/src/assets/img/logo.png +0 -0
  144. package/templates/sample/src/layouts/index.vue +8 -0
  145. package/templates/sample/src/pages/docs.vue +5 -0
  146. package/templates/sample/src/pages/hello/index.vue +77 -0
  147. package/templates/sample/src/pages/hello/style.less +41 -0
  148. package/templates/sample/src/pages/index.vue +9 -0
  149. package/templates/sample/tsconfig.json.tpl +3 -0
  150. package/templates/sample/typings.d.ts +1 -0
@@ -0,0 +1,7 @@
1
+ // https://winjs-dev.github.io/winjs-docs/config/config.html
2
+ import { defineConfig } from '@winner-fed/winjs';
3
+
4
+ export default defineConfig({
5
+ npmClient: '{{{ npmClient }}}',
6
+ mountElementId: '{{{ appContainerName }}}'
7
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "{{{ projectName }}}",
3
+ "version": "1.0.0",
4
+ "buildVersion": "V202101-00-000",
5
+ "private": true,
6
+ "author": "{{{ author }}}",
7
+ "scripts": {
8
+ "dev": "win dev",
9
+ "build": "win build",
10
+ "postinstall": "win setup",
11
+ "setup": "win setup",
12
+ "start": "npm run dev",
13
+ "preview": "win preview"
14
+ },
15
+ "dependencies": {
16
+ "@winner-fed/winjs": "{{{ version }}}"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "^5.0.3"
20
+ }
21
+ }
@@ -0,0 +1,7 @@
1
+ import type { IApi } from 'win';
2
+
3
+ export default (api: IApi) => {
4
+ api.modifyHTML(($) => {
5
+ return $;
6
+ });
7
+ };
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <div class="pages">
3
+ <keep-alive v-if="$route.meta.keepAlive">
4
+ <router-view />
5
+ </keep-alive>
6
+ <router-view v-if="!$route.meta.keepAlive" />
7
+ </div>
8
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div>
3
+ <p>This is win docs.</p>
4
+ </div>
5
+ </template>
@@ -0,0 +1,77 @@
1
+ <script setup>
2
+ import { ref } from 'vue';
3
+ /**
4
+ * 以下仅为事例代码,可以随意扩展修改
5
+ */
6
+ const title = ref('Welcome to Your Vue.js App.');
7
+ </script>
8
+ <template>
9
+ <div class="page page-hello">
10
+ <div class="page-content">
11
+ <!-- 静态资源路径写法事例 -->
12
+ <img class="logo" src="@/assets/img/logo.png" alt="logo" />
13
+ <h1>{{ title }}</h1>
14
+ <p>
15
+ 有关自定义配置指引, 请前往
16
+ <a
17
+ href="https://cloud-templates.github.io/create-project/"
18
+ target="_blank"
19
+ rel="noopener"
20
+ >create-project 文档</a
21
+ >.
22
+ </p>
23
+ <div class="demo">
24
+ <h3>方法示例</h3>
25
+ <pre>
26
+ &lt;script setup&gt;
27
+ /**
28
+ * 以下仅为事例代码,可以随意扩展修改
29
+ */
30
+ // 工具类
31
+ import { formatDate } from &#x27;
32
+ import { ref } from &#x27;
33
+ import services from &#x27;
34
+ utils&#x27;;
35
+ vue&#x27;;
36
+ @/services&#x27;;
37
+
38
+ const msg = ref(&#x27;Welcome to Your Vue.js App.This a composition-api and setup demo&#x27;);
39
+ const message = ref(&#x27;现在时间是:&#x27; + formatDate(Date.now()));
40
+
41
+ function movieComingSoon () {
42
+ const data = {};
43
+ services
44
+ .octocat({
45
+ method: &#x27;get&#x27;,
46
+ data
47
+ })
48
+ .then((res) =&gt; {
49
+ console.log(&#x27;接口请求成功:&#x27; + JSON.stringify(res, null, 2));
50
+ })
51
+ .catch((err) =&gt; {
52
+ console.log(&#x27;接口请求异常:&#x27; + err);
53
+ });
54
+ }
55
+
56
+ movieComingSoon();
57
+ &lt;/script&gt;
58
+ &lt;template&gt;
59
+ &lt;div class=&quot;page page-hello&quot;&gt;
60
+ &lt;div class=&quot;page-content&quot;&gt;
61
+ &lt;!-- 静态资源路径写法事例 --&gt;
62
+ &lt;img src=&quot;@/assets/img/logo.png&quot; /&gt;
63
+ &lt;h1 v-text=&quot;msg&quot;&gt;&lt;/h1&gt;
64
+ &lt;h2 v-text=&quot;message&quot;&gt;&lt;/h2&gt;
65
+ &lt;svg-icon icon-name=&quot;dog&quot;&gt;&lt;/svg-icon&gt;
66
+ &lt;/div&gt;
67
+ &lt;/div&gt;
68
+ &lt;/template&gt;
69
+
70
+ &lt;style lang=&quot;less&quot; scoped src=&quot;./style.less&quot;&gt;&lt;/style&gt;
71
+ </pre>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </template>
76
+
77
+ <style lang="less" scoped src="./style.less"></style>
@@ -0,0 +1,41 @@
1
+ .page-hello {
2
+ font-family: Avenir, Helvetica, Arial, sans-serif;
3
+ -webkit-font-smoothing: antialiased;
4
+ -moz-osx-font-smoothing: grayscale;
5
+ color: #2c3e50;
6
+
7
+ .icons {
8
+ font-size: 30px;
9
+ color: #ff5648;
10
+ }
11
+
12
+ .page-content {
13
+ padding: 0 15px;
14
+ }
15
+
16
+ h1 {
17
+ margin-bottom: 20px;
18
+ text-align: center;
19
+ }
20
+
21
+ p {
22
+ line-height: 23px;
23
+ }
24
+
25
+ a {
26
+ color: #42b983;
27
+ }
28
+
29
+ .logo {
30
+ width: 200px;
31
+ height: 200px;
32
+ display: block;
33
+ margin: 30px auto;
34
+ }
35
+
36
+ .demo {
37
+ padding-top: 25px;
38
+ margin: 0 auto;
39
+ text-align: left;
40
+ }
41
+ }
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div>
3
+ <h2>Hi! Welcome to Winjs ❤️ Vue!</h2>
4
+ <p>
5
+ <img src="@/assets/img/logo.png" width="200" height="200" alt="logo" />
6
+ </p>
7
+ <p>To get started, edit <code>pages/index.vue</code> and save to reload.</p>
8
+ </div>
9
+ </template>
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./src/.win/tsconfig.json"
3
+ }
@@ -0,0 +1 @@
1
+ import 'win/typings';