@newlogic-digital/core 4.0.0-rc.9 → 4.0.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.
- package/bin/newlogic-core.js +16 -0
- package/index.js +5 -0
- package/package.json +28 -13
- package/src/linkAgentSkills.js +27 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { styleText } from 'node:util'
|
|
4
|
+
import { getPackageInfo } from 'vituum/utils/common.js'
|
|
5
|
+
|
|
6
|
+
const { name } = getPackageInfo(new URL('../package.json', import.meta.url).href)
|
|
7
|
+
const [command] = process.argv.slice(2)
|
|
8
|
+
|
|
9
|
+
if (command === 'postinstall') {
|
|
10
|
+
await import('../src/createEslintStylisticConfig.js')
|
|
11
|
+
await import('../src/linkAgentSkills.js')
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
console.error(`${styleText(['cyan', 'bold'], name)} ${styleText('red', `Unknown command "${command ?? ''}".`)}`)
|
|
15
|
+
process.exitCode = 1
|
|
16
|
+
}
|
package/index.js
CHANGED
|
@@ -25,6 +25,7 @@ const defaultOptions = {
|
|
|
25
25
|
assets: [
|
|
26
26
|
'./src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
|
|
27
27
|
'./src/scripts/*.{js,ts,mjs}',
|
|
28
|
+
'./src/assets/**/*',
|
|
28
29
|
],
|
|
29
30
|
pages: [
|
|
30
31
|
'./src/pages/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
|
|
@@ -96,6 +97,10 @@ const plugin = async (options = {}) => {
|
|
|
96
97
|
const tailwindcss = (await import('@tailwindcss/vite')).default
|
|
97
98
|
|
|
98
99
|
optionalPlugins.push(tailwindcss(options.tailwindcss))
|
|
100
|
+
|
|
101
|
+
if (!fs.existsSync(resolve(process.cwd(), 'src/+.css'))) {
|
|
102
|
+
fs.writeFileSync(resolve(process.cwd(), 'src/+.css'), '@import "./styles/main.css";')
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
if (options.cssInline.paths.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newlogic-digital/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.1",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"newlogic-core": "./bin/newlogic-core.js"
|
|
8
|
+
},
|
|
6
9
|
"author": "New Logic Studio s.r.o.",
|
|
7
10
|
"description": "Set of tools that can be used to create modern web applications",
|
|
8
11
|
"license": "MIT",
|
|
9
12
|
"scripts": {
|
|
10
|
-
"postinstall": "node ./src/createEslintStylisticConfig.js && node ./src/linkAgentSkills.js",
|
|
11
13
|
"tsc": "tsc",
|
|
12
14
|
"oxlint": "oxlint",
|
|
13
15
|
"oxlint-fix": "oxlint --fix",
|
|
@@ -16,29 +18,42 @@
|
|
|
16
18
|
},
|
|
17
19
|
"dependencies": {
|
|
18
20
|
"@minify-html/node": "^0.18.1",
|
|
19
|
-
"@newlogic-digital/vite-plugin-heroicons": "^1.1.
|
|
21
|
+
"@newlogic-digital/vite-plugin-heroicons": "^1.1.1",
|
|
20
22
|
"@stylistic/eslint-plugin": "^5.10",
|
|
21
23
|
"@stylistic/stylelint-config": "^4.0.0",
|
|
22
|
-
"@vituum/vite-plugin-css-inline": "^2.0.
|
|
23
|
-
"@vituum/vite-plugin-latte": "^2.0.
|
|
24
|
-
"@vituum/vite-plugin-send": "^2.0.
|
|
24
|
+
"@vituum/vite-plugin-css-inline": "^2.0.2",
|
|
25
|
+
"@vituum/vite-plugin-latte": "^2.0.2",
|
|
26
|
+
"@vituum/vite-plugin-send": "^2.0.1",
|
|
25
27
|
"browserslist": "^4.28.1",
|
|
26
28
|
"browserslist-to-esbuild": "^2.1.1",
|
|
27
29
|
"lightningcss": "^1.32.0",
|
|
30
|
+
"npm-check-updates": "^19.6.5",
|
|
28
31
|
"oxlint": "^1.56.0",
|
|
29
32
|
"stylelint-config-standard": "^40.0.0",
|
|
30
|
-
"vituum": "^2.0.
|
|
31
|
-
|
|
33
|
+
"vituum": "^2.0.1"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@tailwindcss/vite": "4.2.2",
|
|
37
|
+
"@vituum/vite-plugin-twig": "^2.0.1",
|
|
38
|
+
"vite": "^8.0.1"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"@vituum/vite-plugin-twig": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"@tailwindcss/vite": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
32
47
|
},
|
|
33
48
|
"devDependencies": {
|
|
34
|
-
"@tailwindcss/vite": "
|
|
49
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
35
50
|
"@types/node": "^25.5",
|
|
36
|
-
"@vituum/vite-plugin-twig": "^2.0.
|
|
37
|
-
"rolldown": "^1.0.0-rc.
|
|
38
|
-
"typescript": "^5"
|
|
39
|
-
"vite": "^8.0.0"
|
|
51
|
+
"@vituum/vite-plugin-twig": "^2.0.1",
|
|
52
|
+
"rolldown": "^1.0.0-rc.10",
|
|
53
|
+
"typescript": "^5"
|
|
40
54
|
},
|
|
41
55
|
"files": [
|
|
56
|
+
"bin",
|
|
42
57
|
"icons",
|
|
43
58
|
"latte",
|
|
44
59
|
"skills",
|
package/src/linkAgentSkills.js
CHANGED
|
@@ -31,7 +31,7 @@ function getExistingTargetStat(targetPath) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function createDirectorySymlink(sourcePath, targetPath) {
|
|
35
35
|
const symlinkTarget = IS_WIN32
|
|
36
36
|
? sourcePath
|
|
37
37
|
: path.relative(path.dirname(targetPath), sourcePath)
|
|
@@ -44,7 +44,9 @@ if (!projectRoot || projectRoot === packageRoot || !fs.existsSync(sourceSkillsDi
|
|
|
44
44
|
process.exit(0)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const
|
|
47
|
+
const targetAgentsDir = path.join(projectRoot, '.agents')
|
|
48
|
+
const targetSkillsDir = path.join(targetAgentsDir, 'skills')
|
|
49
|
+
const targetClaudePath = path.join(projectRoot, '.claude')
|
|
48
50
|
const skillEntries = fs.readdirSync(sourceSkillsDir, { withFileTypes: true })
|
|
49
51
|
.filter(entry => entry.isDirectory())
|
|
50
52
|
|
|
@@ -55,6 +57,7 @@ if (skillEntries.length === 0) {
|
|
|
55
57
|
fs.mkdirSync(targetSkillsDir, { recursive: true })
|
|
56
58
|
|
|
57
59
|
let linkedCount = 0
|
|
60
|
+
let linkedClaudeDir = false
|
|
58
61
|
|
|
59
62
|
for (const entry of skillEntries) {
|
|
60
63
|
const sourcePath = path.join(sourceSkillsDir, entry.name)
|
|
@@ -74,10 +77,31 @@ for (const entry of skillEntries) {
|
|
|
74
77
|
fs.unlinkSync(targetPath)
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
|
|
80
|
+
createDirectorySymlink(sourcePath, targetPath)
|
|
78
81
|
linkedCount += 1
|
|
79
82
|
}
|
|
80
83
|
|
|
84
|
+
const claudeStat = getExistingTargetStat(targetClaudePath)
|
|
85
|
+
|
|
86
|
+
if (claudeStat) {
|
|
87
|
+
if (!claudeStat.isSymbolicLink()) {
|
|
88
|
+
console.warn(`${styleText(['cyan', 'bold'], name)} ${styleText('yellow', `Skipping ".claude" because "${targetClaudePath}" already exists and is not a symlink.`)}`)
|
|
89
|
+
}
|
|
90
|
+
else if (!isSameSymlinkTarget(targetClaudePath, targetAgentsDir)) {
|
|
91
|
+
fs.unlinkSync(targetClaudePath)
|
|
92
|
+
createDirectorySymlink(targetAgentsDir, targetClaudePath)
|
|
93
|
+
linkedClaudeDir = true
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
createDirectorySymlink(targetAgentsDir, targetClaudePath)
|
|
98
|
+
linkedClaudeDir = true
|
|
99
|
+
}
|
|
100
|
+
|
|
81
101
|
if (linkedCount > 0) {
|
|
82
102
|
console.info(`${styleText(['cyan', 'bold'], name)} ${styleText('green', `Linked ${linkedCount} skill${linkedCount === 1 ? '' : 's'} into "${targetSkillsDir}".`)}`)
|
|
83
103
|
}
|
|
104
|
+
|
|
105
|
+
if (linkedClaudeDir) {
|
|
106
|
+
console.info(`${styleText(['cyan', 'bold'], name)} ${styleText('green', `Linked "${targetClaudePath}" to "${targetAgentsDir}".`)}`)
|
|
107
|
+
}
|