@poveste/vendors 0.1.0 → 0.1.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@poveste/vendors",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "Bundled vendors for histoire",
6
6
  "author": {
7
7
  "name": "Sorin Gitlan"
@@ -15,6 +15,10 @@
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
+ "files": [
19
+ "dist",
20
+ "src"
21
+ ],
18
22
  "sideEffects": false,
19
23
  "exports": {
20
24
  "./floating-vue": "./dist/client/b-floating-vue.js",
package/entries.js DELETED
@@ -1,9 +0,0 @@
1
- export const entries = [
2
- 'src/client/b-floating-vue.ts',
3
- 'src/client/b-iconify.ts',
4
- 'src/client/b-pinia.ts',
5
- 'src/client/b-scroll.ts',
6
- 'src/client/b-vue-router.ts',
7
- 'src/client/b-vue-use.ts',
8
- 'src/client/b-vue.ts',
9
- ]
package/floating-vue.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import Default from './dist/client/b-floating-vue'
2
-
3
- export default Default
4
- export * from './dist/client/b-floating-vue'
package/iconify.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import Default from './dist/client/b-iconify'
2
-
3
- export default Default
4
- export * from './dist/client/b-iconify'
package/pinia.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import Default from './dist/client/b-pinia'
2
-
3
- export default Default
4
- export * from './dist/client/b-pinia'
package/rollup.config.mjs DELETED
@@ -1,119 +0,0 @@
1
- import { createRequire } from 'node:module'
2
- import path from 'node:path'
3
- import { fileURLToPath } from 'node:url'
4
- import commonjs from '@rollup/plugin-commonjs'
5
- import resolve from '@rollup/plugin-node-resolve'
6
- import { execaSync } from 'execa'
7
- import fs from 'fs-extra'
8
- import { globbySync } from 'globby'
9
- import { defineConfig } from 'rollup'
10
- import ts from 'rollup-plugin-typescript2'
11
- import { entries } from './entries.js'
12
-
13
- const require = createRequire(import.meta.url)
14
- const __dirname = path.dirname(fileURLToPath(import.meta.url))
15
-
16
- export default defineConfig({
17
- input: entries,
18
-
19
- plugins: [
20
- resolve({ preferBuiltins: true }),
21
- commonjs(),
22
- ts({
23
- check: false,
24
- tsconfigOverride: {
25
- compilerOptions: {
26
- rootDir: 'src/client',
27
- },
28
- },
29
- }),
30
- {
31
- name: 'define',
32
- transform(code) {
33
- return code.replace(/__VUE_OPTIONS_API__/g, 'true')
34
- },
35
- },
36
- {
37
- name: 'process-build',
38
- closeBundle() {
39
- try {
40
- const pkg = fs.readJsonSync('./package.json')
41
- const tempDir = path.resolve('./node_modules/.temp/histoire-vendors')
42
- fs.ensureDirSync(tempDir)
43
- fs.emptyDirSync(tempDir)
44
- const targetDtsDir = path.resolve('./dist/client/node_modules')
45
- fs.ensureDirSync(targetDtsDir)
46
- fs.emptyDirSync(targetDtsDir)
47
- const tempPkg = {
48
- name: 'histoire-vendors-temp',
49
- version: '0.0.0',
50
- dependencies: {},
51
- }
52
- const pkgExports = {}
53
- const files = globbySync('./dist/client/*.d.ts', { cwd: __dirname })
54
- for (const file of files) {
55
- // Retrieve imports from dts
56
- {
57
- let content = fs.readFileSync(file, 'utf-8')
58
- content = content.replace(/from '(.*)'/g, (match, p1) => {
59
- const data = fs.readJsonSync(require.resolve(`./node_modules/${p1}/package.json`))
60
- const versionSelector = data.version
61
- tempPkg.dependencies[p1] = versionSelector
62
- return `from './node_modules/${p1}'`
63
- })
64
- fs.writeFileSync(file, content, 'utf-8')
65
- }
66
- // Create entry files in root
67
- {
68
- const filepath = file.replace(/\.d\.ts$/, '')
69
- const content = `import Default from '${filepath}'
70
-
71
- export default Default
72
- export * from '${filepath}'\n`.replace(/\n/g, process.platform === 'win32' ? '\r\n' : '\n')
73
- fs.writeFileSync(path.basename(file).replace(/^b-/, ''), content, 'utf-8')
74
- }
75
- // Exports (package.json)
76
- const importName = path.basename(file).replace(/\.d\.ts$/, '').replace(/^b-/, '')
77
- pkgExports[`./${importName}`] = file.replace(/\.d\.ts$/, '.js')
78
- }
79
- // Install dependencies in temp module
80
- {
81
- const tempPkgFile = path.resolve(tempDir, 'package.json')
82
- fs.writeJsonSync(tempPkgFile, tempPkg)
83
- execaSync('npm', ['install', '--prefer-offline --legacy-peer-deps'], { cwd: tempDir })
84
- const dtsFiles = globbySync(['**/*.d.{ts,mts}', '**/package.json'], {
85
- cwd: path.join(tempDir, 'node_modules'),
86
- dot: true,
87
- })
88
- for (const dtsFile of dtsFiles) {
89
- const absoluteDtsFile = path.resolve(tempDir, 'node_modules', dtsFile)
90
- fs.copySync(absoluteDtsFile, path.resolve(targetDtsDir, dtsFile))
91
- }
92
- }
93
- // Update exports field in package.json
94
- pkgExports['./*'] = './*'
95
- pkg.exports = pkgExports
96
- fs.writeJsonSync('./package.json', pkg, { spaces: 2 })
97
- }
98
- catch (e) {
99
- console.error(e)
100
- }
101
- },
102
- },
103
- ],
104
-
105
- output: {
106
- format: 'es',
107
- exports: 'auto',
108
- entryFileNames: '[name].js',
109
- chunkFileNames: '[name].js',
110
- assetFileNames: '[name][extname]',
111
- hoistTransitiveImports: false,
112
- dir: 'dist/client',
113
- },
114
-
115
- external: [],
116
-
117
- treeshake: false,
118
- preserveEntrySignatures: 'strict',
119
- })
package/scroll.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import Default from './dist/client/b-scroll'
2
-
3
- export default Default
4
- export * from './dist/client/b-scroll'
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- // Volar
5
- "jsx": "preserve",
6
- "lib": [
7
- "ESNext",
8
- "DOM"
9
- ],
10
- "module": "ESNext",
11
- "moduleResolution": "node",
12
- "resolveJsonModule": true,
13
- "types": [
14
- "node"
15
- ],
16
- "strictBindCallApply": true,
17
- "strictFunctionTypes": true,
18
- "alwaysStrict": true,
19
- // Strict
20
- "noImplicitAny": false,
21
- "noImplicitThis": true,
22
- "declaration": true,
23
- "outDir": "dist",
24
- "removeComments": false,
25
- "sourceMap": false,
26
- "allowSyntheticDefaultImports": true,
27
- "esModuleInterop": true,
28
- "skipLibCheck": true,
29
- "preserveWatchOutput": true
30
- },
31
- "include": [
32
- "src"
33
- ]
34
- }
package/vue-router.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import Default from './dist/client/b-vue-router'
2
-
3
- export default Default
4
- export * from './dist/client/b-vue-router'
package/vue-use.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import Default from './dist/client/b-vue-use'
2
-
3
- export default Default
4
- export * from './dist/client/b-vue-use'
package/vue.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import Default from './dist/client/b-vue'
2
-
3
- export default Default
4
- export * from './dist/client/b-vue'