@lls/vitescripts 2.0.23 → 23.0.0-abcd

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/package.json CHANGED
@@ -1,30 +1,29 @@
1
1
  {
2
2
  "name": "@lls/vitescripts",
3
- "version": "2.0.23",
3
+ "version": "23.0.0-abcd",
4
4
  "description": "lls vite plugins",
5
5
  "main": "src/index.mjs",
6
6
  "files": [
7
7
  "src/"
8
8
  ],
9
- "scripts": {
10
- "test": "CONF_ENV=test npx vitest run",
11
- "postinstall": "test \"$INIT_CWD\" = \"$PWD\" && npx husky install || echo 'Skipping postinstall'"
12
- },
13
9
  "dependencies": {
14
- "lightningcss": "1.22.1",
10
+ "browserslist": "4.22.1",
15
11
  "esbuild-plugin-lightningcss-modules": "0.1.1",
16
- "browserslist": "4.22.1"
12
+ "lightningcss": "1.22.1"
17
13
  },
18
14
  "type": "module",
19
15
  "author": "",
20
16
  "license": "ISC",
21
17
  "devDependencies": {
22
- "@lls/eslint-config-lls": "1.1.12",
23
- "@lls/lls-kit": "21.0.0",
24
- "husky": "8.0.3",
25
- "vitest": "0.34.6"
18
+ "@lls/lls-kit": "23.0.0",
19
+ "nano-staged": "0.8.0",
20
+ "vitest": "1.0.4"
26
21
  },
27
- "optionalDependencies": {
28
- "@lls/lls-kit": "*"
22
+ "nano-staged": {
23
+ "*.{js,jsx,mjs,tsx,ts}": "CONF_ENV=test pnpm vitest related --run"
24
+ },
25
+ "scripts": {
26
+ "test": "CONF_ENV=test pnpm vitest run",
27
+ "precommit": "pnpm nano-staged"
29
28
  }
30
- }
29
+ }
@@ -23,9 +23,9 @@ export default ({ prefix = '', llsCssModuleMacroPluginArg }) => {
23
23
  })
24
24
  build.onLoad({ filter: /module\.css$/ }, async args => {
25
25
  if (args.path.startsWith(tmpDir)) return
26
+
26
27
  const contents = await fs.promises.readFile(args.path, 'utf8').then(str => llsCssModuleMacroPluginInstance.transform(str, args.path))
27
28
  const id = args.path.replace(process.cwd(), '').replace(/\//g, '_')
28
-
29
29
  const out = path.join(tmpDir, id)
30
30
  await fs.promises.writeFile(out, contents)
31
31
  return {
@@ -21,8 +21,25 @@ const llsAssetsPlugin = (llsRepos, publicDir = 'ladleassets', { stripRoot = true
21
21
  name: 'lls:copyassets',
22
22
  async config () {
23
23
  await execP(`mkdir -p ${publicAssetDir}`)
24
+ const pnpmNameToPath = await execP('pnpm ls -r @lls/lls-drawer --json'/*'pnpm ls -r -d 0 --json'*/)
25
+ .then(({ stdout }) => JSON.parse(stdout))
26
+ .then(json => {
27
+ let drawer = null
28
+ const back = json.map(({ name, path, dependencies }) => {
29
+ if (dependencies?.['@lls/lls-drawer']?.path) {
30
+ drawer = ['@lls/lls-drawer', dependencies?.['@lls/lls-drawer']?.path + '/lib/assets/*']
31
+ }
32
+ return [name, path + '/lib/assets/*']
33
+ })
34
+ return back.concat(drawer ? [drawer] : [])
35
+ })
36
+ .then(Object.fromEntries)
37
+ .catch(e => {})
24
38
  const repoArgs = await Promise.all(llsRepos.map(async repo => {
25
39
  if (!repo.startsWith('@')) return repo
40
+ const pnpmPath = pnpmNameToPath[repo]
41
+ if (pnpmPath) return pnpmPath
42
+
26
43
  const aPath = 'lib/assets/*'
27
44
  const prefix = await fileExists(`${process.cwd()}/node_modules/${repo}`)
28
45
  ? `${process.cwd()}/node_modules/${repo}`