stacks 0.0.9 → 0.37.3
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.
- package/.gitignore +10 -0
- package/LICENSE.md +21 -0
- package/README.md +65 -104
- package/auto-imports.d.ts +826 -0
- package/bin/stacks.mjs +4 -0
- package/components.d.ts +22 -0
- package/core/actions/README.md +59 -0
- package/core/actions/node_modules/.bin/markdown-it +17 -0
- package/core/actions/node_modules/.bin/mkdist +17 -0
- package/core/actions/node_modules/.bin/tsc +17 -0
- package/core/actions/node_modules/.bin/tsserver +17 -0
- package/core/actions/package.json +64 -0
- package/core/actions/src/copy-types.ts +22 -0
- package/core/actions/src/generate/component-meta.ts +94 -0
- package/core/actions/src/generate/index.ts +4 -0
- package/core/actions/src/generate/lib-entries.ts +106 -0
- package/core/actions/src/generate/package-json.ts +87 -0
- package/core/actions/src/generate/vscode-custom-data.ts +28 -0
- package/core/actions/src/generate/vue-compat.ts +17 -0
- package/core/actions/src/generate-component-meta.ts +19 -0
- package/core/actions/src/generate-ide-helpers.ts +23 -0
- package/core/actions/src/generate-lib-entries.ts +22 -0
- package/core/actions/src/generate-package-json.ts +15 -0
- package/core/actions/src/generate-vscode-custom-data.ts +20 -0
- package/core/actions/src/generate-vue-compat.ts +10 -0
- package/core/arrays/README.md +59 -0
- package/core/arrays/node_modules/.bin/mkdist +17 -0
- package/core/arrays/node_modules/.bin/tsc +17 -0
- package/core/arrays/node_modules/.bin/tsserver +17 -0
- package/core/arrays/package.json +50 -0
- package/core/arrays/src/index.ts +3 -0
- package/core/build/README.md +59 -0
- package/core/build/entries/README.md +7 -0
- package/core/build/node_modules/.bin/acorn +17 -0
- package/core/build/node_modules/.bin/browserslist +17 -0
- package/core/build/node_modules/.bin/jiti +17 -0
- package/core/build/node_modules/.bin/mkdist +17 -0
- package/core/build/node_modules/.bin/rollup +17 -0
- package/core/build/node_modules/.bin/vite +17 -0
- package/core/build/node_modules/.bin/vite-ssg +17 -0
- package/core/build/node_modules/.bin/vue-docgen-web-types +17 -0
- package/core/build/package.json +71 -0
- package/core/build/src/example-vue.ts +26 -0
- package/core/build/src/example-wc.ts +26 -0
- package/core/build/src/functions.ts +56 -0
- package/core/build/src/index.ts +7 -0
- package/core/build/src/pages.ts +50 -0
- package/core/build/src/stacks.ts +204 -0
- package/core/build/src/vue-components.ts +76 -0
- package/core/build/src/web-components.ts +63 -0
- package/core/build/web-types.config.cjs +4 -0
- package/core/build/web-types.ts +14 -0
- package/core/collections/README.md +59 -0
- package/core/collections/node_modules/.bin/mkdist +17 -0
- package/core/collections/node_modules/.bin/tsc +17 -0
- package/core/collections/node_modules/.bin/tsserver +17 -0
- package/core/collections/package.json +54 -0
- package/core/collections/src/index.ts +1 -0
- package/core/fs/README.md +59 -0
- package/core/fs/node_modules/.bin/mkdist +17 -0
- package/core/fs/package.json +56 -0
- package/core/fs/src/index.ts +170 -0
- package/core/helpers/node_modules/.bin/mkdist +17 -0
- package/core/helpers/package.json +58 -0
- package/core/helpers/src/index.ts +129 -0
- package/core/modules/README.md +61 -0
- package/core/modules/node_modules/.bin/acorn +17 -0
- package/core/modules/node_modules/.bin/mkdist +17 -0
- package/core/modules/package.json +51 -0
- package/core/modules/src/i18n.ts +23 -0
- package/core/modules/src/nprogress.ts +12 -0
- package/core/modules/src/pwa.ts +12 -0
- package/core/objects/README.md +59 -0
- package/core/objects/node_modules/.bin/mkdist +17 -0
- package/core/objects/node_modules/.bin/tsc +17 -0
- package/core/objects/node_modules/.bin/tsserver +17 -0
- package/core/objects/package.json +51 -0
- package/core/objects/src/index.ts +1 -0
- package/core/paths/node_modules/.bin/mkdist +17 -0
- package/core/paths/node_modules/.bin/tsc +17 -0
- package/core/paths/node_modules/.bin/tsserver +17 -0
- package/core/paths/package.json +51 -0
- package/core/paths/src/index.ts +178 -0
- package/core/router/README.md +59 -0
- package/core/router/node_modules/.bin/mkdist +17 -0
- package/core/router/package.json +51 -0
- package/core/router/src/index.ts +14 -0
- package/core/security/README.md +59 -0
- package/core/security/node_modules/.bin/mkdist +17 -0
- package/core/security/package.json +56 -0
- package/core/security/src/crypt.ts +14 -0
- package/core/security/src/hash.ts +52 -0
- package/core/security/src/index.ts +3 -0
- package/core/security/src/key.ts +11 -0
- package/core/strings/README.md +59 -0
- package/core/strings/node_modules/.bin/mkdist +17 -0
- package/core/strings/node_modules/.bin/tsc +17 -0
- package/core/strings/node_modules/.bin/tsserver +17 -0
- package/core/strings/package.json +63 -0
- package/core/strings/src/index.ts +14 -0
- package/core/types/README.md +59 -0
- package/core/types/node_modules/.bin/markdown-it +17 -0
- package/core/types/node_modules/.bin/mkdist +17 -0
- package/core/types/node_modules/.bin/vite +17 -0
- package/core/types/node_modules/.bin/vitepress +17 -0
- package/core/types/package.json +60 -0
- package/core/types/src/app.ts +131 -0
- package/core/types/src/auto-imports.ts +3 -0
- package/core/types/src/build.ts +3 -0
- package/core/types/src/cli.ts +49 -0
- package/core/types/src/components.ts +66 -0
- package/core/types/src/deploy.ts +11 -0
- package/core/types/src/docs.ts +3 -0
- package/core/types/src/exit-code.ts +10 -0
- package/core/types/src/fs.ts +17 -0
- package/core/types/src/git.ts +131 -0
- package/core/types/src/hashing.ts +107 -0
- package/core/types/src/i18n.ts +19 -0
- package/core/types/src/index.ts +21 -0
- package/core/types/src/inspect.ts +10 -0
- package/core/types/src/layout.ts +8 -0
- package/core/types/src/library.ts +148 -0
- package/core/types/src/manifest.ts +9 -0
- package/core/types/src/markdown.ts +198 -0
- package/core/types/src/pages.ts +8 -0
- package/core/types/src/pwa.ts +8 -0
- package/core/types/src/ssg.ts +3 -0
- package/core/types/src/ui.ts +141 -0
- package/core/ui/README.md +60 -0
- package/core/ui/node_modules/.bin/mkdist +17 -0
- package/core/ui/node_modules/.bin/tsc +17 -0
- package/core/ui/node_modules/.bin/tsserver +17 -0
- package/core/ui/node_modules/.bin/vite +17 -0
- package/core/ui/node_modules/.bin/vue-tsc +17 -0
- package/core/ui/package.json +62 -0
- package/core/ui/src/index.ts +60 -0
- package/custom-elements.json +14 -0
- package/examples/vue-components/App.vue +12 -0
- package/examples/vue-components/favicon.png +0 -0
- package/examples/vue-components/index.html +20 -0
- package/examples/web-components/favicon.png +0 -0
- package/examples/web-components/index.html +13 -0
- package/functions/node_modules/.bin/artisan +17 -0
- package/functions/node_modules/.bin/stacks +17 -0
- package/functions/node_modules/.bin/stx +17 -0
- package/functions/package.json +40 -0
- package/netlify.toml +18 -0
- package/nitro.config.ts +6 -0
- package/package.json +224 -27
- package/pages/App.vue +26 -0
- package/pages/index.html +23 -0
- package/pages/main.ts +26 -0
- package/pages/public/_headers +3 -0
- package/pages/public/favicon-dark.svg +3 -0
- package/pages/public/favicon.svg +3 -0
- package/pages/public/pwa-192x192.png +0 -0
- package/pages/public/pwa-512x512.png +0 -0
- package/pages/public/safari-pinned-tab.svg +41 -0
- package/pages/styles/main.css +29 -0
- package/pages/styles/markdown.css +28 -0
- package/scripts/ensure-env.sh +248 -0
- package/shims.d.ts +29 -0
- package/simple-git-hooks.cjs +4 -0
- package/src/cli/actions/build.ts +160 -0
- package/src/cli/actions/commit.ts +9 -0
- package/src/cli/actions/dev.ts +47 -0
- package/src/cli/actions/examples.ts +74 -0
- package/src/cli/actions/fresh.ts +9 -0
- package/src/cli/actions/generate.ts +159 -0
- package/src/cli/actions/index.ts +12 -0
- package/src/cli/actions/key.ts +31 -0
- package/src/cli/actions/lint.ts +19 -0
- package/src/cli/actions/make.ts +116 -0
- package/src/cli/actions/release.ts +9 -0
- package/src/cli/actions/test.ts +39 -0
- package/src/cli/actions/types.ts +180 -0
- package/src/cli/actions/update.ts +90 -0
- package/src/cli/build.ts +49 -0
- package/src/cli/create.ts +71 -0
- package/src/cli/dev.ts +28 -0
- package/src/cli/example.ts +28 -0
- package/src/cli/generate.ts +64 -0
- package/src/cli/index.ts +13 -0
- package/src/cli/key.ts +12 -0
- package/src/cli/make.ts +47 -0
- package/src/cli/test.ts +24 -0
- package/src/cli/types.ts +18 -0
- package/src/cli/update.ts +17 -0
- package/src/cli/utility.ts +39 -0
- package/src/cli.ts +48 -0
- package/src/docs.ts +4 -0
- package/src/index.ts +22 -0
- package/tsconfig.json +96 -0
- package/vitest.config.ts +22 -0
- package/vue-components/dist/.gitkeep +0 -0
- package/vue-components/index.html +13 -0
- package/vue-components/main.ts +18 -0
- package/vue-components/node_modules/.bin/artisan +17 -0
- package/vue-components/node_modules/.bin/stacks +17 -0
- package/vue-components/node_modules/.bin/stx +17 -0
- package/vue-components/node_modules/.vite/deps/@vueuse_core.js +7847 -0
- package/vue-components/node_modules/.vite/deps/@vueuse_core.js.map +7 -0
- package/vue-components/node_modules/.vite/deps/_metadata.json +13 -0
- package/vue-components/node_modules/.vite/deps/package.json +1 -0
- package/vue-components/package.json +40 -0
- package/web-components/dist/.gitkeep +0 -0
- package/web-components/node_modules/.bin/artisan +17 -0
- package/web-components/node_modules/.bin/stacks +17 -0
- package/web-components/node_modules/.bin/stx +17 -0
- package/web-components/package.json +40 -0
- package/web-types.json +67 -0
- package/.npmignore +0 -1
- package/.travis.yml +0 -4
- package/examples/stringReverse.js +0 -41
- package/examples/sumServer.js +0 -21
- package/examples/sumWorker.js +0 -23
- package/index.js +0 -1
- package/lib/stacks.js +0 -398
- package/test/test.stacks.js +0 -148
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type MarkdownIt from 'markdown-it'
|
|
2
|
+
import type { ComponentPluginOptions } from '@mdit-vue/plugin-component'
|
|
3
|
+
import type { FrontmatterPluginOptions } from '@mdit-vue/plugin-frontmatter'
|
|
4
|
+
import type { MarkdownItEnv } from '@mdit-vue/types'
|
|
5
|
+
import type { FilterPattern } from '@rollup/pluginutils'
|
|
6
|
+
|
|
7
|
+
/** a `<meta />` property in HTML is defined with the following name/values */
|
|
8
|
+
export interface MetaProperty {
|
|
9
|
+
key?: string
|
|
10
|
+
/**
|
|
11
|
+
* the "name" property used by Facebook and other providers who
|
|
12
|
+
* use the Open Graph standards
|
|
13
|
+
*/
|
|
14
|
+
property?: string
|
|
15
|
+
/**
|
|
16
|
+
* used by google to identify the "name" of the name/value pair
|
|
17
|
+
*/
|
|
18
|
+
itemprop?: string
|
|
19
|
+
/**
|
|
20
|
+
* used by Twitter to indicate the "name" field in a meta properties
|
|
21
|
+
* name/value pairing
|
|
22
|
+
*/
|
|
23
|
+
name?: string
|
|
24
|
+
/**
|
|
25
|
+
* The value of the meta property
|
|
26
|
+
*/
|
|
27
|
+
content?: any
|
|
28
|
+
[key: string]: unknown
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Frontmatter content is represented as key/value dictionary
|
|
33
|
+
*/
|
|
34
|
+
export interface Frontmatter {
|
|
35
|
+
title?: string
|
|
36
|
+
name?: string
|
|
37
|
+
description?: string
|
|
38
|
+
meta?: MetaProperty[]
|
|
39
|
+
[key: string]: unknown
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Options {
|
|
43
|
+
/**
|
|
44
|
+
* Explicitly set the Vue version
|
|
45
|
+
*
|
|
46
|
+
* @default auto detected
|
|
47
|
+
*/
|
|
48
|
+
vueVersion?: string
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Enable head support, need to install @vueuse/head and register to App in main.js
|
|
52
|
+
*
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
headEnabled?: boolean
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The head field in frontmatter used to be used for @vueuse/head
|
|
59
|
+
*
|
|
60
|
+
* When an empty string is passed, it will use the root properties of the frontmatter
|
|
61
|
+
*
|
|
62
|
+
* @default ''
|
|
63
|
+
*/
|
|
64
|
+
headField?: string
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Parse for frontmatter
|
|
68
|
+
*
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
frontmatter?: boolean
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Parse for excerpt
|
|
75
|
+
*
|
|
76
|
+
* If `true`, it will be passed to `frontmatterPreprocess` as `frontmatter.excerpt`, replacing the `excerpt` key in frontmatter, if there's any
|
|
77
|
+
*
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
excerpt?: boolean
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Remove custom SFC block
|
|
84
|
+
*
|
|
85
|
+
* @default ['route', 'i18n']
|
|
86
|
+
*/
|
|
87
|
+
customSfcBlocks?: string[]
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Options passed to [@mdit-vue/plugin-component](https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-component)
|
|
91
|
+
*/
|
|
92
|
+
componentOptions?: ComponentPluginOptions
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Options passed to [@mdit-vue/plugin-frontmatter](https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter)
|
|
96
|
+
*/
|
|
97
|
+
frontmatterOptions?: FrontmatterPluginOptions
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Custom function to provide defaults to the frontmatter and
|
|
101
|
+
* move certain attributes into the "meta" category.
|
|
102
|
+
*
|
|
103
|
+
* Note: _overriding this will remove built-in functionality setting
|
|
104
|
+
* "meta" properties and the built-in "head" support. Do this only
|
|
105
|
+
* if you know what you're doing._
|
|
106
|
+
*/
|
|
107
|
+
frontmatterPreprocess?: (
|
|
108
|
+
frontmatter: Frontmatter,
|
|
109
|
+
options: ResolvedOptions
|
|
110
|
+
) => {
|
|
111
|
+
head: Record<string, any>
|
|
112
|
+
frontmatter: Frontmatter
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Expose frontmatter via expose API
|
|
117
|
+
*
|
|
118
|
+
* @default true
|
|
119
|
+
*/
|
|
120
|
+
exposeFrontmatter?: boolean
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Expose excerpt via expose API
|
|
124
|
+
*
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
exposeExcerpt?: boolean
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Add `v-pre` to `<code>` tag to escape curly brackets interpolation
|
|
131
|
+
*
|
|
132
|
+
* @see https://github.com/antfu/vite-plugin-vue-markdown/issues/14
|
|
133
|
+
* @default true
|
|
134
|
+
*/
|
|
135
|
+
escapeCodeTagInterpolation?: boolean
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Options passed to Markdown It
|
|
139
|
+
*/
|
|
140
|
+
markdownItOptions?: MarkdownIt.Options
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Plugins for Markdown It
|
|
144
|
+
*/
|
|
145
|
+
markdownItUses?: (
|
|
146
|
+
| MarkdownIt.PluginSimple
|
|
147
|
+
| [MarkdownIt.PluginSimple | MarkdownIt.PluginWithOptions<any>, any]
|
|
148
|
+
| any
|
|
149
|
+
)[]
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* A function providing the Markdown It instance gets the ability to apply custom
|
|
153
|
+
* settings/plugins
|
|
154
|
+
*/
|
|
155
|
+
markdownItSetup?: (MarkdownIt: MarkdownIt) => void
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Class names for wrapper div
|
|
159
|
+
*
|
|
160
|
+
* @default 'markdown-body'
|
|
161
|
+
*/
|
|
162
|
+
wrapperClasses?: string | string[]
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Component name to wrapper with
|
|
166
|
+
*
|
|
167
|
+
* @default undefined
|
|
168
|
+
*/
|
|
169
|
+
wrapperComponent?: string | undefined | null
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Custom transformations apply before and after the markdown transformation
|
|
173
|
+
*/
|
|
174
|
+
transforms?: {
|
|
175
|
+
before?: (code: string, id: string) => string
|
|
176
|
+
after?: (code: string, id: string) => string
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
include?: FilterPattern
|
|
180
|
+
exclude?: FilterPattern
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface ResolvedOptions extends Required<Options> {
|
|
184
|
+
wrapperClasses: string
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface MarkdownEnv extends MarkdownItEnv {
|
|
188
|
+
id: string
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* ### Markdown Options
|
|
193
|
+
*
|
|
194
|
+
* The Markdown options.
|
|
195
|
+
*
|
|
196
|
+
* @see https://github.com/mdit-vue/vite-plugin-vue-markdown/blob/main/src/types.ts
|
|
197
|
+
*/
|
|
198
|
+
export type MarkdownOptions = Options
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { UserShortcuts } from 'unocss'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ### UI Engine Options
|
|
5
|
+
*
|
|
6
|
+
* This type defines all of your UI Engine options. Because Stacks is full-typed, you may
|
|
7
|
+
* hover any of the options below and the definitions will be provided. In case you
|
|
8
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
9
|
+
*/
|
|
10
|
+
export interface UiOptions {
|
|
11
|
+
/**
|
|
12
|
+
* ### Shortcuts
|
|
13
|
+
*
|
|
14
|
+
* Shortcuts provide you with the ability to combine
|
|
15
|
+
* utility names for reusability purposes.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* shortcuts: {
|
|
20
|
+
* 'btn': 'px-4 py-2 rounded text-white bg-blue-500',
|
|
21
|
+
* 'btn-lg': 'btn px-6 py-3',
|
|
22
|
+
* }
|
|
23
|
+
*/
|
|
24
|
+
shortcuts: Shortcuts
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* ### Safelist
|
|
28
|
+
*
|
|
29
|
+
* Use the `safelist` option to ensure the generation of
|
|
30
|
+
* those utility classes. This is useful when certain
|
|
31
|
+
* class names don’t exist in your content files.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* safelist: [
|
|
36
|
+
* 'btn',
|
|
37
|
+
* 'btn-lg',
|
|
38
|
+
* 'btn-blue',
|
|
39
|
+
* 'btn-blue-500',
|
|
40
|
+
* ]
|
|
41
|
+
*/
|
|
42
|
+
safelist: string
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ### Trigger String
|
|
46
|
+
*
|
|
47
|
+
* The "trigger string" defines the class name markup
|
|
48
|
+
* you want to add into your components.
|
|
49
|
+
*
|
|
50
|
+
* @default ':stx:'
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* trigger: ':stx:'
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
trigger?: string
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* ### Class Prefix
|
|
61
|
+
*
|
|
62
|
+
* The prefix for the compiled class name. When transforming
|
|
63
|
+
* all utility classes into a single class, this prefix
|
|
64
|
+
* will be added to the generated CSS class name.
|
|
65
|
+
*
|
|
66
|
+
* @default 'stx-'
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* prefix: 'stx-'
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
classPrefix?: string
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* ### Hash Function
|
|
77
|
+
*
|
|
78
|
+
* The hash function used to generate the class name.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* hash: (str: string) => {
|
|
83
|
+
* return str
|
|
84
|
+
* .split('')
|
|
85
|
+
* .reduce((a, b) => {
|
|
86
|
+
* a = ((a << 5) - a) + b.charCodeAt(0)
|
|
87
|
+
* return a & a
|
|
88
|
+
* }, 0)
|
|
89
|
+
* .toString(36)
|
|
90
|
+
* }
|
|
91
|
+
*/
|
|
92
|
+
hashFn?: (str: string) => string
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* ### CSS Resets—Preset
|
|
96
|
+
*
|
|
97
|
+
* Define a standard of reset CSS stylesheets. By default, the Tailwind
|
|
98
|
+
* reset styles are utilized. You may set this value to `null`
|
|
99
|
+
* if you prefer not applying any default stylesheets.
|
|
100
|
+
*
|
|
101
|
+
* @url https://www.npmjs.com/package/@unocss/reset
|
|
102
|
+
* @todo preset needs to be added via a Vite plugin on development & build
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* reset: 'tailwind'
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
reset?: ResetPreset
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* ### Icon Sets
|
|
112
|
+
*
|
|
113
|
+
* This value defines the icon sets you want to use. When using icons, they
|
|
114
|
+
* are displayed utilizing a technique called "icons in pure css."
|
|
115
|
+
* Learn more here https://antfu.me/posts/icons-in-pure-css.
|
|
116
|
+
*
|
|
117
|
+
* @see https://stacks.ow3.org/config/icons — list of available icon sets
|
|
118
|
+
* @todo implement this into Vite build flow
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* icons: ['heroicons']
|
|
122
|
+
* ```
|
|
123
|
+
* @example
|
|
124
|
+
* ```html
|
|
125
|
+
* <i class="i-heroicons-outline-book-open w-8 h-8 text-gray-500" aria-hidden="true" />
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
icons: Record<string, () => Promise<any>>
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type Shortcuts = UserShortcuts
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* ### Style Reset — Preset
|
|
135
|
+
*
|
|
136
|
+
* This value sets the "reset preset." A preset defines certain
|
|
137
|
+
* CSS defaults to be applied.
|
|
138
|
+
*
|
|
139
|
+
* @default "tailwind"
|
|
140
|
+
*/
|
|
141
|
+
export type ResetPreset = 'tailwind' | 'normalize' | 'sanitize' | 'eric-meyer' | 'antfu' | null
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Stacks UI
|
|
2
|
+
|
|
3
|
+
This package contains the Stacks UI engine.
|
|
4
|
+
|
|
5
|
+
## ☘️ Features
|
|
6
|
+
|
|
7
|
+
wip
|
|
8
|
+
|
|
9
|
+
- ⚡️ Vue
|
|
10
|
+
- ⚡️ UnoCSS
|
|
11
|
+
|
|
12
|
+
wip
|
|
13
|
+
|
|
14
|
+
## 🤖 Usage
|
|
15
|
+
|
|
16
|
+
wip
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm i -D @stacksjs/security
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Now, you can use it in your project:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import * as ui from '@stacksjs/ui'
|
|
26
|
+
|
|
27
|
+
// wip
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Learn more in the docs.
|
|
31
|
+
|
|
32
|
+
## 🧪 Testing
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pnpm test
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 📈 Changelog
|
|
39
|
+
|
|
40
|
+
Please see our [releases](https://github.com/stacksjs/stacksjs/releases) page for more information on what has changed recently.
|
|
41
|
+
|
|
42
|
+
## 💪🏼 Contributing
|
|
43
|
+
|
|
44
|
+
Please see [CONTRIBUTING](../../.github/CONTRIBUTING.md) for details.
|
|
45
|
+
|
|
46
|
+
## 🏝 Community
|
|
47
|
+
|
|
48
|
+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
49
|
+
|
|
50
|
+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
|
|
51
|
+
|
|
52
|
+
For casual chit-chat with others using this package:
|
|
53
|
+
|
|
54
|
+
[Join the Open Web Discord Server](https://discord.ow3.org)
|
|
55
|
+
|
|
56
|
+
## 📄 License
|
|
57
|
+
|
|
58
|
+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
|
|
59
|
+
|
|
60
|
+
Made with ❤️
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/mkdist@0.3.13_typescript@4.8.4/node_modules/mkdist/dist/cli.cjs" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/mkdist@0.3.13_typescript@4.8.4/node_modules/mkdist/dist/cli.cjs" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/bin/tsc" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/bin/tsc" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/bin/tsserver" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/bin/tsserver" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@3.1.8/node_modules/vite/bin/vite.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vite@3.1.8/node_modules/vite/bin/vite.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/chrisbreuer/Code/stacks/node_modules/.pnpm/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.8_typescript@4.8.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.8_typescript@4.8.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stacksjs/ui",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.37.3",
|
|
5
|
+
"packageManager": "pnpm@7.13.6",
|
|
6
|
+
"description": "The Stacks atomic UI engine, powered by UnoCSS.",
|
|
7
|
+
"author": "Chris Breuer",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
10
|
+
"homepage": "https://github.com/stacksjs/stacks/tree/main/.stacks/core/ui#readme",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
14
|
+
"directory": "./.stacks/core/ui"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/stacksjs/stacks/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"css",
|
|
21
|
+
"atomic",
|
|
22
|
+
"ui",
|
|
23
|
+
"engine",
|
|
24
|
+
"styles",
|
|
25
|
+
"stacks",
|
|
26
|
+
"unocss"
|
|
27
|
+
],
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"main": "dist/index.mjs",
|
|
30
|
+
"module": "dist/index.mjs",
|
|
31
|
+
"types": "dist/index.d.ts",
|
|
32
|
+
"contributors": [
|
|
33
|
+
"Chris Breuer <chris@ow3.org>"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=v18.10.0",
|
|
40
|
+
"pnpm": ">=7.13.6"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "mkdist -d",
|
|
44
|
+
"dev": "mkdist -d",
|
|
45
|
+
"prepublishOnly": "pnpm run build",
|
|
46
|
+
"typecheck": "tsc --noEmit"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@iconify-json/heroicons-outline": "^1.1.4",
|
|
50
|
+
"@iconify-json/heroicons-solid": "^1.1.5",
|
|
51
|
+
"@julr/unocss-preset-forms": "^0.0.2",
|
|
52
|
+
"@unocss/transformer-compile-class": "^0.45.30",
|
|
53
|
+
"@vitejs/plugin-vue": "^3.1.2",
|
|
54
|
+
"unocss": "^0.45.30",
|
|
55
|
+
"vue": "^3.2.41",
|
|
56
|
+
"vue-tsc": "^1.0.8"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"mkdist": "^0.3.13",
|
|
60
|
+
"typescript": "^4.8.4"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { UserConfig } from 'unocss'
|
|
2
|
+
import { defineConfig, presetIcons, presetTypography, presetWind, transformerDirectives, transformerVariantGroup } from 'unocss'
|
|
3
|
+
import { presetForms } from '@julr/unocss-preset-forms'
|
|
4
|
+
import transformerCompileClass from '@unocss/transformer-compile-class'
|
|
5
|
+
// import { ui } from '../../../config'
|
|
6
|
+
import type { UiOptions as Options } from '@stacksjs/types'
|
|
7
|
+
|
|
8
|
+
const uis: Options = {
|
|
9
|
+
shortcuts: [
|
|
10
|
+
['btn', 'inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer'],
|
|
11
|
+
],
|
|
12
|
+
safelist: 'prose prose-sm m-auto text-left',
|
|
13
|
+
trigger: ':stx:',
|
|
14
|
+
classPrefix: 'stx-',
|
|
15
|
+
reset: 'tailwind',
|
|
16
|
+
icons: {
|
|
17
|
+
'heroicon-outline': () => import('@iconify-json/heroicons-outline/icons.json').then(i => i.default as any),
|
|
18
|
+
'heroicon-solid': () => import('@iconify-json/heroicons-solid/icons.json').then(i => i.default as any),
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const config: UserConfig = defineConfig({
|
|
23
|
+
shortcuts: uis.shortcuts,
|
|
24
|
+
|
|
25
|
+
presets: [
|
|
26
|
+
presetWind(), // allows for Tailwind utility classes
|
|
27
|
+
presetForms(), // allows for form Tailwind's form styling
|
|
28
|
+
presetTypography(),
|
|
29
|
+
presetIcons({
|
|
30
|
+
prefix: 'i-',
|
|
31
|
+
warn: true,
|
|
32
|
+
collections: uis.icons,
|
|
33
|
+
extraProperties: {
|
|
34
|
+
'display': 'inline-block',
|
|
35
|
+
'vertical-align': 'middle',
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
// presetWebFonts({
|
|
39
|
+
// provider: 'bunny', // privacy-friendly Google Web Fonts proxy
|
|
40
|
+
// fonts: {
|
|
41
|
+
// // these will extend the default theme
|
|
42
|
+
// sans: 'Inter',
|
|
43
|
+
// mono: 'Inter',
|
|
44
|
+
// },
|
|
45
|
+
// }),
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
transformers: [
|
|
49
|
+
transformerCompileClass({
|
|
50
|
+
classPrefix: uis.classPrefix,
|
|
51
|
+
trigger: uis.trigger,
|
|
52
|
+
}),
|
|
53
|
+
transformerDirectives(),
|
|
54
|
+
transformerVariantGroup(),
|
|
55
|
+
],
|
|
56
|
+
|
|
57
|
+
safelist: uis.safelist.split(' '),
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
export default config
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1.1,
|
|
3
|
+
"tags": [{
|
|
4
|
+
"name": ["HelloWorld", "AppHelloWorld"],
|
|
5
|
+
"description": "The Hello World custom element, built via this framework.",
|
|
6
|
+
"attributes": [{
|
|
7
|
+
"name": "greeting",
|
|
8
|
+
"description": "The greeting."
|
|
9
|
+
}]
|
|
10
|
+
}, {
|
|
11
|
+
"name": "Demo",
|
|
12
|
+
"description": "A Demo components."
|
|
13
|
+
}]
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
This is how you would implement your generated
|
|
3
|
+
library into your own frontend. You may import
|
|
4
|
+
any of the components developed.
|
|
5
|
+
-->
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { Demo } from './dist/index.mjs'
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<Demo />
|
|
12
|
+
</template>
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="./favicon.png" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Stacks Vue Example</title>
|
|
8
|
+
<link rel="stylesheet" href="./dist/style.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="app"></div>
|
|
12
|
+
|
|
13
|
+
<script type="module">
|
|
14
|
+
import { createApp } from 'vue'
|
|
15
|
+
import App from './App.vue'
|
|
16
|
+
|
|
17
|
+
createApp(App).mount('#app')
|
|
18
|
+
</script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
Binary file
|