create-qs 0.0.0 → 0.8.23
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/README.md +140 -2
- package/index.js +1884 -0
- package/package.json +31 -5
- package/template/default/.quicksilver/.gitattributes +4 -0
- package/template/default/.quicksilver/manual/en-US/00-setup.md +199 -0
- package/template/default/.quicksilver/manual/zh-CN/00-setup.md +199 -0
- package/template/default/.quicksilver/manual/zh-TW/00-setup.md +199 -0
- package/template/default/AGENTS.md +333 -0
- package/template/default/README.md +5 -0
- package/template/default/_gitignore +70 -0
- package/template/default/build.gradle.kts +5 -0
- package/template/default/eslint.config.js +137 -0
- package/template/default/gradle/repo.settings.gradle.kts +90 -0
- package/template/default/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/default/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/default/gradle.properties +15 -0
- package/template/default/gradlew +248 -0
- package/template/default/gradlew.bat +93 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/build.gradle.kts +8 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/data/demo/README.md +11 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/data/init/rows/menus.jsons +1 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/data/init/rows/misc.jsons +15 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/data/upgrade/draft.jsons +1 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/src/main/kotlin/{{API_PACKAGE}}/AutoConfiguration.kt +25 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +1 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/src/test/kotlin/{{API_PACKAGE}}/SmokeTests.kt +61 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/api/src/test/kotlin/{{API_PACKAGE}}/TestConfiguration.kt +6 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/module.yaml +8 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/web/package.json +25 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/web/src/module.ts +16 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/web/src/vite-env.d.ts +10 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/web/tsconfig.app.json +7 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/web/tsconfig.json +7 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/web/tsconfig.node.json +7 -0
- package/template/default/modules/{{MODULE_DIRECTORY}}/web/vite.config.ts +11 -0
- package/template/default/package.json +76 -0
- package/template/default/pnpm-workspace.yaml +40 -0
- package/template/default/publishing.yaml +52 -0
- package/template/default/quicksilver.yaml +13 -0
- package/template/default/run/api/build.gradle.kts +8 -0
- package/template/default/run/api/config/README.md +76 -0
- package/template/default/run/api/config/application-dev.yaml +45 -0
- package/template/default/run/api/config/application-h2.yaml +22 -0
- package/template/default/run/api/config/application-mariadb.yaml +22 -0
- package/template/default/run/api/config/application-mssql.yaml +22 -0
- package/template/default/run/api/config/application-oracle.yaml +22 -0
- package/template/default/run/api/config/application-postgresql.yaml +22 -0
- package/template/default/run/api/config/application-test.yaml +28 -0
- package/template/default/run/api/config/application.yaml +84 -0
- package/template/default/run/api/config/logback-test.xml +141 -0
- package/template/default/run/api/config/logback.xml +142 -0
- package/template/default/run/web/index.html +14 -0
- package/template/default/run/web/index.ts +6 -0
- package/template/default/run/web/package.json +18 -0
- package/template/default/run/web/static/config.js +15 -0
- package/template/default/run/web/tsconfig.app.json +4 -0
- package/template/default/run/web/tsconfig.json +7 -0
- package/template/default/run/web/tsconfig.node.json +4 -0
- package/template/default/run/web/vite.config.ts +21 -0
- package/template/default/settings.gradle.kts +19 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import typescript from '@typescript-eslint/eslint-plugin';
|
|
4
|
+
import typescriptParser from '@typescript-eslint/parser';
|
|
5
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
js.configs.recommended,
|
|
9
|
+
{
|
|
10
|
+
ignores: [
|
|
11
|
+
'**/node_modules/**',
|
|
12
|
+
'**/iconfont.js',
|
|
13
|
+
'.git/**',
|
|
14
|
+
|
|
15
|
+
// Written by `pnpm install` and `pnpm qs sources`, not project code
|
|
16
|
+
'.agents/**',
|
|
17
|
+
'.claude/**',
|
|
18
|
+
'.quicksilver/**',
|
|
19
|
+
|
|
20
|
+
'build/**',
|
|
21
|
+
'local/**',
|
|
22
|
+
|
|
23
|
+
'modules/*/*/build/**',
|
|
24
|
+
'modules/*/*/dist/**',
|
|
25
|
+
'modules/*/*/static/**',
|
|
26
|
+
'run/*/local/**',
|
|
27
|
+
'run/*/dist/**',
|
|
28
|
+
'run/*/static/**',
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// ------------------------------------------------------------------------
|
|
33
|
+
// Global languageOptions & rules
|
|
34
|
+
// ------------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
plugins: {
|
|
38
|
+
'@stylistic': stylistic,
|
|
39
|
+
},
|
|
40
|
+
languageOptions: {
|
|
41
|
+
ecmaVersion: 'latest',
|
|
42
|
+
sourceType: 'module',
|
|
43
|
+
globals: {
|
|
44
|
+
...globals.browser,
|
|
45
|
+
...globals.node,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
// --- General syntax rules ---
|
|
50
|
+
'no-console': 'warn',
|
|
51
|
+
'no-redeclare': 'off',
|
|
52
|
+
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
53
|
+
|
|
54
|
+
// --- Stylistic rules (alphabetical order) ---
|
|
55
|
+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
56
|
+
'@stylistic/array-bracket-spacing': ['error', 'never'],
|
|
57
|
+
'@stylistic/arrow-parens': ['error', 'as-needed'],
|
|
58
|
+
'@stylistic/block-spacing': ['error', 'always'],
|
|
59
|
+
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
60
|
+
'@stylistic/comma-dangle': ['error', 'always-multiline'],
|
|
61
|
+
'@stylistic/comma-spacing': ['error', { before: false, after: true }],
|
|
62
|
+
'@stylistic/dot-location': ['error', 'property'],
|
|
63
|
+
'@stylistic/eol-last': ['error', 'always'],
|
|
64
|
+
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
65
|
+
'@stylistic/function-paren-newline': ['error', 'consistent'],
|
|
66
|
+
'@stylistic/indent': ['error', 4, { SwitchCase: 1 }],
|
|
67
|
+
'@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
68
|
+
'@stylistic/keyword-spacing': ['error', { before: true, after: true }],
|
|
69
|
+
'@stylistic/max-len': ['error', {
|
|
70
|
+
code: 120,
|
|
71
|
+
tabWidth: 4,
|
|
72
|
+
ignoreUrls: true,
|
|
73
|
+
ignoreComments: false,
|
|
74
|
+
ignoreRegExpLiterals: true,
|
|
75
|
+
ignoreStrings: true,
|
|
76
|
+
ignoreTemplateLiterals: true,
|
|
77
|
+
}],
|
|
78
|
+
'@stylistic/new-parens': 'error',
|
|
79
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
80
|
+
'@stylistic/no-multiple-empty-lines': ['error', { max: 1 }],
|
|
81
|
+
'@stylistic/no-tabs': 'error',
|
|
82
|
+
'@stylistic/no-trailing-spaces': 'error',
|
|
83
|
+
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
84
|
+
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
|
|
85
|
+
'@stylistic/one-var-declaration-per-line': ['error', 'always'],
|
|
86
|
+
'@stylistic/padded-blocks': ['error', 'never'],
|
|
87
|
+
'@stylistic/quotes': ['error', 'single', { 'avoidEscape': true }],
|
|
88
|
+
'@stylistic/semi': ['error', 'always'],
|
|
89
|
+
'@stylistic/space-before-function-paren': ['error', {
|
|
90
|
+
anonymous: 'never',
|
|
91
|
+
named: 'never',
|
|
92
|
+
asyncArrow: 'always',
|
|
93
|
+
catch: 'always',
|
|
94
|
+
}],
|
|
95
|
+
'@stylistic/space-in-parens': ['error', 'never'],
|
|
96
|
+
'@stylistic/space-infix-ops': 'error',
|
|
97
|
+
'@stylistic/spaced-comment': ['error', 'always', { markers: ['/'] }],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
// ------------------------------------------------------------------------
|
|
102
|
+
// TypeScript
|
|
103
|
+
// ------------------------------------------------------------------------
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
files: ['**/*.{ts,tsx}'],
|
|
107
|
+
languageOptions: {
|
|
108
|
+
parser: typescriptParser,
|
|
109
|
+
// No `project`: none of the rules below needs type information. Enabling a rule that
|
|
110
|
+
// does (the *-type-checked sets) requires `projectService: true` here.
|
|
111
|
+
parserOptions: {
|
|
112
|
+
ecmaVersion: 'latest',
|
|
113
|
+
sourceType: 'module',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
plugins: {
|
|
117
|
+
'@typescript-eslint': typescript,
|
|
118
|
+
},
|
|
119
|
+
rules: {
|
|
120
|
+
...typescript.configs.recommended.rules,
|
|
121
|
+
'no-undef': 'off',
|
|
122
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
123
|
+
'@typescript-eslint/no-redeclare': 'off',
|
|
124
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
125
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
// ------------------------------------------------------------------------
|
|
130
|
+
// JavaScript
|
|
131
|
+
// ------------------------------------------------------------------------
|
|
132
|
+
|
|
133
|
+
{
|
|
134
|
+
files: ['**/*.{js,jsx,mjs,cjs}'],
|
|
135
|
+
rules: {},
|
|
136
|
+
},
|
|
137
|
+
];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// The repository that serves the Quicksilver Gradle plugin and the platform artifacts, and the login
|
|
2
|
+
// for it. settings.gradle.kts applies this script. It sets up both the repository the plugin is
|
|
3
|
+
// downloaded from and the repositories of every project, so the rules below are written only once.
|
|
4
|
+
// Do not edit it: the address and the login come from the quicksilver.repo.* keys, and the comment
|
|
5
|
+
// in gradle.properties says where each one belongs. See .quicksilver/manual/en-US/00-setup.md.
|
|
6
|
+
|
|
7
|
+
// Read the keys with `providers.gradleProperty(...)`: `startParameter.projectProperties` only carries
|
|
8
|
+
// `-P` arguments and would silently ignore every gradle.properties file. Values are trimmed because
|
|
9
|
+
// gradle.properties keeps trailing spaces.
|
|
10
|
+
fun property(key: String) = providers.gradleProperty(key).orNull?.trim()?.takeIf { it.isNotEmpty() }
|
|
11
|
+
|
|
12
|
+
val userProperties = gradle.gradleUserHomeDir.resolve("gradle.properties")
|
|
13
|
+
val repo = property("quicksilver.repo.url")
|
|
14
|
+
?: throw GradleException("quicksilver.repo.url is not set. Set it in $userProperties for every"
|
|
15
|
+
+ " project on this machine, or in this project's gradle.properties for everyone on the"
|
|
16
|
+
+ " project. See .quicksilver/manual/en-US/00-setup.md")
|
|
17
|
+
|
|
18
|
+
// The login is <prefix>.user and <prefix>.password. The prefix defaults to quicksilver.repo, so a
|
|
19
|
+
// machine with one repository sets quicksilver.repo.user and quicksilver.repo.password. Naming another
|
|
20
|
+
// prefix in quicksilver.repo.credentials lets projects on one machine log in to different repositories
|
|
21
|
+
// with different accounts. An empty quicksilver.repo.credentials= turns the login off, for a project
|
|
22
|
+
// pinned to a repository that allows anonymous reads.
|
|
23
|
+
val credentialsSetting = providers.gradleProperty("quicksilver.repo.credentials").orNull?.trim()
|
|
24
|
+
val loginOff = credentialsSetting == ""
|
|
25
|
+
val namedPrefix = credentialsSetting?.takeIf { it.isNotEmpty() }
|
|
26
|
+
val prefix = namedPrefix ?: "quicksilver.repo"
|
|
27
|
+
|
|
28
|
+
// Every check below fails here on purpose. Without them the build goes on anonymously and ends with a
|
|
29
|
+
// "plugin was not found" that never mentions credentials.
|
|
30
|
+
//
|
|
31
|
+
// The project's gradle.properties is committed, so the login never belongs there. Gradle merges it with
|
|
32
|
+
// the user's file, so the project file is read on its own to tell them apart.
|
|
33
|
+
val projectProperties = java.util.Properties()
|
|
34
|
+
settingsDir.resolve("gradle.properties").takeIf { it.isFile }?.reader()?.use { projectProperties.load(it) }
|
|
35
|
+
val committed = listOf("quicksilver.repo.user", "quicksilver.repo.password", "$prefix.user", "$prefix.password")
|
|
36
|
+
.distinct()
|
|
37
|
+
.filter { !projectProperties.getProperty(it).isNullOrBlank() }
|
|
38
|
+
if (committed.isNotEmpty()) {
|
|
39
|
+
throw GradleException("${committed.joinToString(" and ")} must not be in this project's"
|
|
40
|
+
+ " gradle.properties, which is committed. Put the login in $userProperties")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// A file: repository takes no login, and Gradle refuses one on it. An empty
|
|
44
|
+
// quicksilver.repo.credentials= turns the login off as well.
|
|
45
|
+
val loginSkipped = repo.startsWith("file:") || loginOff
|
|
46
|
+
val repoUser = property("$prefix.user")
|
|
47
|
+
val repoPassword = property("$prefix.password")
|
|
48
|
+
val missing = listOfNotNull(
|
|
49
|
+
"$prefix.user".takeIf { repoUser == null },
|
|
50
|
+
"$prefix.password".takeIf { repoPassword == null },
|
|
51
|
+
)
|
|
52
|
+
// Neither half set means an anonymous repository, unless a prefix was named on purpose
|
|
53
|
+
if (!loginSkipped && (missing.size == 1 || (namedPrefix != null && missing.isNotEmpty()))) {
|
|
54
|
+
val reason = if (namedPrefix != null) "quicksilver.repo.credentials is '$prefix', so" else "Half a login is set:"
|
|
55
|
+
throw GradleException("$reason $userProperties must set ${missing.joinToString(" and ")}")
|
|
56
|
+
}
|
|
57
|
+
val login = !loginSkipped && missing.isEmpty()
|
|
58
|
+
|
|
59
|
+
fun RepositoryHandler.quicksilver() = maven {
|
|
60
|
+
url = uri(repo)
|
|
61
|
+
// A login over http:// travels in clear text. That is allowed on purpose, since intranet
|
|
62
|
+
// repositories are often plain http. The docs ask for https:// instead.
|
|
63
|
+
isAllowInsecureProtocol = repo.startsWith("http://")
|
|
64
|
+
if (login) {
|
|
65
|
+
credentials {
|
|
66
|
+
username = repoUser
|
|
67
|
+
password = repoPassword
|
|
68
|
+
}
|
|
69
|
+
// Send the login with every request. Without this, Gradle only sends it after a 401, and
|
|
70
|
+
// repositories that answer an anonymous request with 404 never get it.
|
|
71
|
+
authentication {
|
|
72
|
+
create<BasicAuthentication>("basic")
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Where the Quicksilver plugin is downloaded from
|
|
78
|
+
pluginManagement.repositories {
|
|
79
|
+
quicksilver()
|
|
80
|
+
gradlePluginPortal()
|
|
81
|
+
mavenCentral()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Where every project resolves the platform artifacts and third-party libraries from
|
|
85
|
+
gradle.allprojects {
|
|
86
|
+
repositories {
|
|
87
|
+
quicksilver()
|
|
88
|
+
mavenCentral()
|
|
89
|
+
}
|
|
90
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
kotlin.code.style=official
|
|
2
|
+
|
|
3
|
+
# The Quicksilver platform version. The root Gradle plugin, and every com.qsrun
|
|
4
|
+
# dependency declared without a version, resolve to it. `pnpm qs upgrade <version>` rewrites this
|
|
5
|
+
# line together with catalogs.quicksilver in pnpm-workspace.yaml.
|
|
6
|
+
quicksilver.version={{QUICKSILVER_VERSION}}
|
|
7
|
+
|
|
8
|
+
# The Maven repository that serves the Quicksilver Gradle plugin and the platform artifacts, such as
|
|
9
|
+
# https://nexus-server/repository/maven-public/. Ask whoever provides you with Quicksilver for it.
|
|
10
|
+
# Set it in ~/.gradle/gradle.properties to cover every project on this machine (that file takes
|
|
11
|
+
# precedence), or here to pin it for everyone on the project. The build stops at startup while
|
|
12
|
+
# neither is set. A login, if the repository needs one, goes in ~/.gradle/gradle.properties only,
|
|
13
|
+
# as quicksilver.repo.user and quicksilver.repo.password: this file is committed, and the build
|
|
14
|
+
# stops if either key shows up here. See .quicksilver/manual/en-US/00-setup.md.
|
|
15
|
+
quicksilver.repo.url=
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Copyright © 2015 the original authors.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
##############################################################################
|
|
22
|
+
#
|
|
23
|
+
# Gradle start up script for POSIX generated by Gradle.
|
|
24
|
+
#
|
|
25
|
+
# Important for running:
|
|
26
|
+
#
|
|
27
|
+
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
|
28
|
+
# noncompliant, but you have some other compliant shell such as ksh or
|
|
29
|
+
# bash, then to run this script, type that shell name before the whole
|
|
30
|
+
# command line, like:
|
|
31
|
+
#
|
|
32
|
+
# ksh Gradle
|
|
33
|
+
#
|
|
34
|
+
# Busybox and similar reduced shells will NOT work, because this script
|
|
35
|
+
# requires all of these POSIX shell features:
|
|
36
|
+
# * functions;
|
|
37
|
+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
|
38
|
+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
|
39
|
+
# * compound commands having a testable exit status, especially «case»;
|
|
40
|
+
# * various built-in commands including «command», «set», and «ulimit».
|
|
41
|
+
#
|
|
42
|
+
# Important for patching:
|
|
43
|
+
#
|
|
44
|
+
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
|
45
|
+
# by Bash, Ksh, etc; in particular arrays are avoided.
|
|
46
|
+
#
|
|
47
|
+
# The "traditional" practice of packing multiple parameters into a
|
|
48
|
+
# space-separated string is a well documented source of bugs and security
|
|
49
|
+
# problems, so this is (mostly) avoided, by progressively accumulating
|
|
50
|
+
# options in "$@", and eventually passing that to Java.
|
|
51
|
+
#
|
|
52
|
+
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
53
|
+
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
|
54
|
+
# see the in-line comments for details.
|
|
55
|
+
#
|
|
56
|
+
# There are tweaks for specific operating systems such as AIX, CygWin,
|
|
57
|
+
# Darwin, MinGW, and NonStop.
|
|
58
|
+
#
|
|
59
|
+
# (3) This script is generated from the Groovy template
|
|
60
|
+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
61
|
+
# within the Gradle project.
|
|
62
|
+
#
|
|
63
|
+
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
64
|
+
#
|
|
65
|
+
##############################################################################
|
|
66
|
+
|
|
67
|
+
# Attempt to set APP_HOME
|
|
68
|
+
|
|
69
|
+
# Resolve links: $0 may be a link
|
|
70
|
+
app_path=$0
|
|
71
|
+
|
|
72
|
+
# Need this for daisy-chained symlinks.
|
|
73
|
+
while
|
|
74
|
+
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
|
75
|
+
[ -h "$app_path" ]
|
|
76
|
+
do
|
|
77
|
+
ls=$( ls -ld "$app_path" )
|
|
78
|
+
link=${ls#*' -> '}
|
|
79
|
+
case $link in #(
|
|
80
|
+
/*) app_path=$link ;; #(
|
|
81
|
+
*) app_path=$APP_HOME$link ;;
|
|
82
|
+
esac
|
|
83
|
+
done
|
|
84
|
+
|
|
85
|
+
# This is normally unused
|
|
86
|
+
# shellcheck disable=SC2034
|
|
87
|
+
APP_BASE_NAME=${0##*/}
|
|
88
|
+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
89
|
+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
90
|
+
|
|
91
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
92
|
+
MAX_FD=maximum
|
|
93
|
+
|
|
94
|
+
warn () {
|
|
95
|
+
echo "$*"
|
|
96
|
+
} >&2
|
|
97
|
+
|
|
98
|
+
die () {
|
|
99
|
+
echo
|
|
100
|
+
echo "$*"
|
|
101
|
+
echo
|
|
102
|
+
exit 1
|
|
103
|
+
} >&2
|
|
104
|
+
|
|
105
|
+
# OS specific support (must be 'true' or 'false').
|
|
106
|
+
cygwin=false
|
|
107
|
+
msys=false
|
|
108
|
+
darwin=false
|
|
109
|
+
nonstop=false
|
|
110
|
+
case "$( uname )" in #(
|
|
111
|
+
CYGWIN* ) cygwin=true ;; #(
|
|
112
|
+
Darwin* ) darwin=true ;; #(
|
|
113
|
+
MSYS* | MINGW* ) msys=true ;; #(
|
|
114
|
+
NONSTOP* ) nonstop=true ;;
|
|
115
|
+
esac
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# Determine the Java command to use to start the JVM.
|
|
120
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
121
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
122
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
123
|
+
JAVACMD=$JAVA_HOME/jre/sh/java
|
|
124
|
+
else
|
|
125
|
+
JAVACMD=$JAVA_HOME/bin/java
|
|
126
|
+
fi
|
|
127
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
128
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
129
|
+
|
|
130
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
131
|
+
location of your Java installation."
|
|
132
|
+
fi
|
|
133
|
+
else
|
|
134
|
+
JAVACMD=java
|
|
135
|
+
if ! command -v java >/dev/null 2>&1
|
|
136
|
+
then
|
|
137
|
+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
138
|
+
|
|
139
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
140
|
+
location of your Java installation."
|
|
141
|
+
fi
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
# Increase the maximum file descriptors if we can.
|
|
145
|
+
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
146
|
+
case $MAX_FD in #(
|
|
147
|
+
max*)
|
|
148
|
+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
149
|
+
# shellcheck disable=SC2039,SC3045
|
|
150
|
+
MAX_FD=$( ulimit -H -n ) ||
|
|
151
|
+
warn "Could not query maximum file descriptor limit"
|
|
152
|
+
esac
|
|
153
|
+
case $MAX_FD in #(
|
|
154
|
+
'' | soft) :;; #(
|
|
155
|
+
*)
|
|
156
|
+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
157
|
+
# shellcheck disable=SC2039,SC3045
|
|
158
|
+
ulimit -n "$MAX_FD" ||
|
|
159
|
+
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
160
|
+
esac
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
# Collect all arguments for the java command, stacking in reverse order:
|
|
164
|
+
# * args from the command line
|
|
165
|
+
# * the main class name
|
|
166
|
+
# * -classpath
|
|
167
|
+
# * -D...appname settings
|
|
168
|
+
# * --module-path (only if needed)
|
|
169
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
|
170
|
+
|
|
171
|
+
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
172
|
+
if "$cygwin" || "$msys" ; then
|
|
173
|
+
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
174
|
+
|
|
175
|
+
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
176
|
+
|
|
177
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
178
|
+
for arg do
|
|
179
|
+
if
|
|
180
|
+
case $arg in #(
|
|
181
|
+
-*) false ;; # don't mess with options #(
|
|
182
|
+
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
|
183
|
+
[ -e "$t" ] ;; #(
|
|
184
|
+
*) false ;;
|
|
185
|
+
esac
|
|
186
|
+
then
|
|
187
|
+
arg=$( cygpath --path --ignore --mixed "$arg" )
|
|
188
|
+
fi
|
|
189
|
+
# Roll the args list around exactly as many times as the number of
|
|
190
|
+
# args, so each arg winds up back in the position where it started, but
|
|
191
|
+
# possibly modified.
|
|
192
|
+
#
|
|
193
|
+
# NB: a `for` loop captures its iteration list before it begins, so
|
|
194
|
+
# changing the positional parameters here affects neither the number of
|
|
195
|
+
# iterations, nor the values presented in `arg`.
|
|
196
|
+
shift # remove old arg
|
|
197
|
+
set -- "$@" "$arg" # push replacement arg
|
|
198
|
+
done
|
|
199
|
+
fi
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
203
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
204
|
+
|
|
205
|
+
# Collect all arguments for the java command:
|
|
206
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
|
207
|
+
# and any embedded shellness will be escaped.
|
|
208
|
+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
|
209
|
+
# treated as '${Hostname}' itself on the command line.
|
|
210
|
+
|
|
211
|
+
set -- \
|
|
212
|
+
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
213
|
+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
|
214
|
+
"$@"
|
|
215
|
+
|
|
216
|
+
# Stop when "xargs" is not available.
|
|
217
|
+
if ! command -v xargs >/dev/null 2>&1
|
|
218
|
+
then
|
|
219
|
+
die "xargs is not available"
|
|
220
|
+
fi
|
|
221
|
+
|
|
222
|
+
# Use "xargs" to parse quoted args.
|
|
223
|
+
#
|
|
224
|
+
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
225
|
+
#
|
|
226
|
+
# In Bash we could simply go:
|
|
227
|
+
#
|
|
228
|
+
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
|
229
|
+
# set -- "${ARGS[@]}" "$@"
|
|
230
|
+
#
|
|
231
|
+
# but POSIX shell has neither arrays nor command substitution, so instead we
|
|
232
|
+
# post-process each arg (as a line of input to sed) to backslash-escape any
|
|
233
|
+
# character that might be a shell metacharacter, then use eval to reverse
|
|
234
|
+
# that process (while maintaining the separation between arguments), and wrap
|
|
235
|
+
# the whole thing up as a single "set" statement.
|
|
236
|
+
#
|
|
237
|
+
# This will of course break if any of these variables contains a newline or
|
|
238
|
+
# an unmatched quote.
|
|
239
|
+
#
|
|
240
|
+
|
|
241
|
+
eval "set -- $(
|
|
242
|
+
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
|
243
|
+
xargs -n1 |
|
|
244
|
+
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
|
245
|
+
tr '\n' ' '
|
|
246
|
+
)" '"$@"'
|
|
247
|
+
|
|
248
|
+
exec "$JAVACMD" "$@"
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
@rem
|
|
2
|
+
@rem Copyright 2015 the original author or authors.
|
|
3
|
+
@rem
|
|
4
|
+
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
@rem you may not use this file except in compliance with the License.
|
|
6
|
+
@rem You may obtain a copy of the License at
|
|
7
|
+
@rem
|
|
8
|
+
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
@rem
|
|
10
|
+
@rem Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
@rem See the License for the specific language governing permissions and
|
|
14
|
+
@rem limitations under the License.
|
|
15
|
+
@rem
|
|
16
|
+
@rem SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
@rem
|
|
18
|
+
|
|
19
|
+
@if "%DEBUG%"=="" @echo off
|
|
20
|
+
@rem ##########################################################################
|
|
21
|
+
@rem
|
|
22
|
+
@rem Gradle startup script for Windows
|
|
23
|
+
@rem
|
|
24
|
+
@rem ##########################################################################
|
|
25
|
+
|
|
26
|
+
@rem Set local scope for the variables with windows NT shell
|
|
27
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
28
|
+
|
|
29
|
+
set DIRNAME=%~dp0
|
|
30
|
+
if "%DIRNAME%"=="" set DIRNAME=.
|
|
31
|
+
@rem This is normally unused
|
|
32
|
+
set APP_BASE_NAME=%~n0
|
|
33
|
+
set APP_HOME=%DIRNAME%
|
|
34
|
+
|
|
35
|
+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
36
|
+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
37
|
+
|
|
38
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
39
|
+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
40
|
+
|
|
41
|
+
@rem Find java.exe
|
|
42
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
43
|
+
|
|
44
|
+
set JAVA_EXE=java.exe
|
|
45
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
46
|
+
if %ERRORLEVEL% equ 0 goto execute
|
|
47
|
+
|
|
48
|
+
echo. 1>&2
|
|
49
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
|
50
|
+
echo. 1>&2
|
|
51
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
52
|
+
echo location of your Java installation. 1>&2
|
|
53
|
+
|
|
54
|
+
goto fail
|
|
55
|
+
|
|
56
|
+
:findJavaFromJavaHome
|
|
57
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
58
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
59
|
+
|
|
60
|
+
if exist "%JAVA_EXE%" goto execute
|
|
61
|
+
|
|
62
|
+
echo. 1>&2
|
|
63
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
|
64
|
+
echo. 1>&2
|
|
65
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
66
|
+
echo location of your Java installation. 1>&2
|
|
67
|
+
|
|
68
|
+
goto fail
|
|
69
|
+
|
|
70
|
+
:execute
|
|
71
|
+
@rem Setup the command line
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@rem Execute Gradle
|
|
76
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
|
77
|
+
|
|
78
|
+
:end
|
|
79
|
+
@rem End local scope for the variables with windows NT shell
|
|
80
|
+
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
81
|
+
|
|
82
|
+
:fail
|
|
83
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
84
|
+
rem the _cmd.exe /c_ return code!
|
|
85
|
+
set EXIT_CODE=%ERRORLEVEL%
|
|
86
|
+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
87
|
+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
88
|
+
exit /b %EXIT_CODE%
|
|
89
|
+
|
|
90
|
+
:mainEnd
|
|
91
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
92
|
+
|
|
93
|
+
:omega
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Demo data
|
|
2
|
+
|
|
3
|
+
This folder holds demo data, rows that exist only to show and test the product, such as sample customers and orders. Production installs do not need them.
|
|
4
|
+
|
|
5
|
+
- Put the rows in `.jsons` files in this folder or in subfolders of it. Other files, such as this README, are skipped.
|
|
6
|
+
- On a fresh install of the module, the files run after everything in `data/init/`, sorted by name level by level with each subfolder run where it sorts, and they can refer to rows written there.
|
|
7
|
+
- Development and test profiles load demo data, as set by `quicksilver.datasource.auto-init.demo-data` in `run/api/config/application-dev.yaml`. On a production install the installer asks first, and does not load it by default.
|
|
8
|
+
- A module that is already installed never loads demo data. Draft sync does not run these files either, so an existing database does not pick up files added or changed here. To load them, set `drop-first: true` for one start, then set it back to `false`. The rebuild clears the whole development database, including rows entered through the UI.
|
|
9
|
+
- Do not copy demo rows into `data/upgrade/draft.jsons`. Upgrades never load demo data.
|
|
10
|
+
|
|
11
|
+
The rules for data files are in section 10 of [`.agents/skills/qs-jsons/references/json-command.md`](../../../../../.agents/skills/qs-jsons/references/json-command.md), and in the developer manual at [`.quicksilver/manual/en-US/06-data.md`](../../../../../.quicksilver/manual/en-US/06-data.md). Both are written by `pnpm install`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{MODULE_MENU}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This file is the default place for the module's rows, and its first command is the module row
|
|
2
|
+
// below. When one kind of rows grows into a topic of its own, move it to a file of its own in rows/,
|
|
3
|
+
// named with a plural noun and with underscores between words. The usual names follow.
|
|
4
|
+
//
|
|
5
|
+
// menus.jsons menus
|
|
6
|
+
// roles.jsons roles and grants
|
|
7
|
+
// dictionaries.jsons dictionaries shared by several units
|
|
8
|
+
// texts.jsons texts (ac.text)
|
|
9
|
+
// error_messages.jsons error messages (ac.error_message)
|
|
10
|
+
// settings.jsons setting groups and setting definitions
|
|
11
|
+
//
|
|
12
|
+
// pnpm qs new unit appends to menus.jsons and roles.jsons. The files in rows/ have no ordering
|
|
13
|
+
// dependencies between them, and each row is written by one file only.
|
|
14
|
+
|
|
15
|
+
{ $insert: 'ac.module', id: '{{MODULE_ID}}', name: '{{MODULE_DIRECTORY}}', code: '{{MODULE_CODE}}', icon: 'quicksilver:module-work', {{MODULE_DEFAULT_MENU}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Upgrade draft. Write data changes here along with the matching init changes. pnpm qs data freeze renames it to a versioned upgrade file.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package {{API_PACKAGE}}
|
|
2
|
+
|
|
3
|
+
import com.qsrun.quicksilver.core.application.startup.QsExcludeFilter
|
|
4
|
+
import jakarta.annotation.PostConstruct
|
|
5
|
+
import org.slf4j.LoggerFactory
|
|
6
|
+
import org.springframework.context.annotation.ComponentScan
|
|
7
|
+
import org.springframework.context.annotation.ComponentScan.Filter
|
|
8
|
+
import org.springframework.context.annotation.Configuration
|
|
9
|
+
import org.springframework.context.annotation.FilterType
|
|
10
|
+
|
|
11
|
+
@Configuration
|
|
12
|
+
@ComponentScan(
|
|
13
|
+
basePackages = ["{{API_PACKAGE}}"],
|
|
14
|
+
// QsExcludeFilter keeps @QsController / @QsService / @QsDao out of the regular bean scan —
|
|
15
|
+
// Quicksilver registers them itself. Without it they are scanned as plain beans and skipped.
|
|
16
|
+
excludeFilters = [Filter(type = FilterType.CUSTOM, classes = [QsExcludeFilter::class])],
|
|
17
|
+
)
|
|
18
|
+
class AutoConfiguration {
|
|
19
|
+
private val logger = LoggerFactory.getLogger(AutoConfiguration::class.java)
|
|
20
|
+
|
|
21
|
+
@PostConstruct
|
|
22
|
+
fun afterInit() {
|
|
23
|
+
logger.info("${AutoConfiguration::class.qualifiedName} is active, scanning package {{API_PACKAGE}}")
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{API_PACKAGE}}.AutoConfiguration
|