@windwalker-io/fusion-next 0.1.0

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/jest.config.ts ADDED
@@ -0,0 +1,214 @@
1
+ /**
2
+ * For a detailed explanation regarding each configuration property, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ import type {Config} from 'jest';
7
+ import { createDefaultPreset } from 'ts-jest';
8
+
9
+ const tsJestTransformCfg = createDefaultPreset({
10
+ tsconfig: 'tsconfig.json',
11
+ useESM: true,
12
+ });
13
+
14
+ const config: Config = {
15
+ // preset: 'ts-jest',
16
+ preset: 'ts-jest/presets/default-esm',
17
+ // All imported modules in your tests should be mocked automatically
18
+ // automock: false,
19
+
20
+ // Stop running tests after `n` failures
21
+ // bail: 0,
22
+
23
+ // The directory where Jest should store its cached dependency information
24
+ // cacheDirectory: "C:\\Users\\...\\AppData\\Local\\Temp\\jest",
25
+
26
+ // Automatically clear mock calls, instances, contexts and results before every test
27
+ clearMocks: true,
28
+
29
+ // Indicates whether the coverage information should be collected while executing the test
30
+ // collectCoverage: false,
31
+
32
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
33
+ // collectCoverageFrom: undefined,
34
+
35
+ // The directory where Jest should output its coverage files
36
+ // coverageDirectory: undefined,
37
+
38
+ // An array of regexp pattern strings used to skip coverage collection
39
+ // coveragePathIgnorePatterns: [
40
+ // "\\\\node_modules\\\\"
41
+ // ],
42
+
43
+ // Indicates which provider should be used to instrument code for coverage
44
+ coverageProvider: "v8",
45
+
46
+ // A list of reporter names that Jest uses when writing coverage reports
47
+ // coverageReporters: [
48
+ // "json",
49
+ // "text",
50
+ // "lcov",
51
+ // "clover"
52
+ // ],
53
+
54
+ // An object that configures minimum threshold enforcement for coverage results
55
+ // coverageThreshold: undefined,
56
+
57
+ // A path to a custom dependency extractor
58
+ // dependencyExtractor: undefined,
59
+
60
+ // Make calling deprecated APIs throw helpful error messages
61
+ // errorOnDeprecated: false,
62
+
63
+ // The default configuration for fake timers
64
+ // fakeTimers: {
65
+ // "enableGlobally": false
66
+ // },
67
+
68
+ // Force coverage collection from ignored files using an array of glob patterns
69
+ // forceCoverageMatch: [],
70
+
71
+ // A path to a module which exports an async function that is triggered once before all test suites
72
+ // globalSetup: undefined,
73
+
74
+ // A path to a module which exports an async function that is triggered once after all test suites
75
+ // globalTeardown: undefined,
76
+
77
+ // A set of global variables that need to be available in all test environments
78
+ // globals: {},
79
+
80
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
81
+ // maxWorkers: "50%",
82
+
83
+ // An array of directory names to be searched recursively up from the requiring module's location
84
+ // moduleDirectories: [
85
+ // "node_modules"
86
+ // ],
87
+
88
+ // An array of file extensions your modules use
89
+ // moduleFileExtensions: [
90
+ // "js",
91
+ // "mjs",
92
+ // "cjs",
93
+ // "jsx",
94
+ // "ts",
95
+ // "mts",
96
+ // "cts",
97
+ // "tsx",
98
+ // "json",
99
+ // "node"
100
+ // ],
101
+
102
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
103
+ // moduleNameMapper: {},
104
+
105
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
106
+ // modulePathIgnorePatterns: [],
107
+
108
+ // Activates notifications for test results
109
+ // notify: false,
110
+
111
+ // An enum that specifies notification mode. Requires { notify: true }
112
+ // notifyMode: "failure-change",
113
+
114
+ // A preset that is used as a base for Jest's configuration
115
+ // preset: undefined,
116
+
117
+ // Run tests from one or more projects
118
+ // projects: undefined,
119
+
120
+ // Use this configuration option to add custom reporters to Jest
121
+ // reporters: undefined,
122
+
123
+ // Automatically reset mock state before every test
124
+ // resetMocks: false,
125
+
126
+ // Reset the module registry before running each individual test
127
+ // resetModules: false,
128
+
129
+ // A path to a custom resolver
130
+ // resolver: undefined,
131
+
132
+ // Automatically restore mock state and implementation before every test
133
+ // restoreMocks: false,
134
+
135
+ // The root directory that Jest should scan for tests and modules within
136
+ // rootDir: undefined,
137
+
138
+ // A list of paths to directories that Jest should use to search for files in
139
+ // roots: [
140
+ // "<rootDir>"
141
+ // ],
142
+
143
+ // Allows you to use a custom runner instead of Jest's default test runner
144
+ // runner: "jest-runner",
145
+
146
+ // The paths to modules that run some code to configure or set up the testing environment before each test
147
+ // setupFiles: [],
148
+
149
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
150
+ // setupFilesAfterEnv: [],
151
+
152
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
153
+ // slowTestThreshold: 5,
154
+
155
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
156
+ // snapshotSerializers: [],
157
+
158
+ // The test environment that will be used for testing
159
+ // testEnvironment: "node",
160
+ //
161
+ // extensionsToTreatAsEsm: ['.mts', '.ts'],
162
+
163
+ // Options that will be passed to the testEnvironment
164
+ // testEnvironmentOptions: {},
165
+
166
+ // Adds a location field to test results
167
+ // testLocationInResults: false,
168
+
169
+ // The glob patterns Jest uses to detect test files
170
+ testMatch: [
171
+ "**/tests/**/*.test.?([mc])[jt]s?(x)",
172
+ // "**/?(*.)+(spec|test).?([mc])[jt]s?(x)"
173
+ ],
174
+
175
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
176
+ testPathIgnorePatterns: [
177
+ './tests/dest/',
178
+ './tests/src/',
179
+ ],
180
+
181
+ // The regexp pattern or array of patterns that Jest uses to detect test files
182
+ // testRegex: [],
183
+
184
+ // This option allows the use of a custom results processor
185
+ // testResultsProcessor: undefined,
186
+
187
+ // This option allows use of a custom test runner
188
+ // testRunner: "jest-circus/runner",
189
+
190
+ // A map from regular expressions to paths to transformers
191
+ transform: {
192
+ ...tsJestTransformCfg.transform
193
+ },
194
+
195
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
196
+ // transformIgnorePatterns: [
197
+ // "\\\\node_modules\\\\",
198
+ // "\\.pnp\\.[^\\\\]+$"
199
+ // ],
200
+
201
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
202
+ // unmockedModulePathPatterns: undefined,
203
+
204
+ // Indicates whether each individual test should be reported during the run
205
+ // verbose: undefined,
206
+
207
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
208
+ // watchPathIgnorePatterns: [],
209
+
210
+ // Whether to use watchman for file crawling
211
+ // watchman: true,
212
+ };
213
+
214
+ export default config;
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@windwalker-io/fusion-next",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "types": "dist/index.d.ts",
6
+ "description": "Windwalker Fusion",
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.js",
9
+ "repository": "https://github.com/ventoviro/windwalker-core",
10
+ "author": "Simon Asika",
11
+ "license": "MIT",
12
+ "scripts": {
13
+ "clean": "rimraf test/dest",
14
+ "build": "vite build",
15
+ "dev": "vite build --watch --mode development",
16
+ "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
17
+ "try": "yarn clean && yarn vite build ./tests",
18
+ "vite": "vite"
19
+ },
20
+ "dependencies": {
21
+ "archy": "^1.0.0",
22
+ "chalk": "^5.6.0",
23
+ "fast-glob": "^3.3.3",
24
+ "fs-extra": "^11.3.1",
25
+ "minimist": "^1.2.8",
26
+ "sass": "^1.92.1",
27
+ "typescript": "^5.9.2",
28
+ "yargs": "^18.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@jest/globals": "^30.1.2",
32
+ "@types/archy": "^0.0.36",
33
+ "@types/fs-extra": "^11",
34
+ "@types/jest": "^30.0.0",
35
+ "@types/lodash-es": "^4.17.12",
36
+ "@types/minimist": "^1",
37
+ "@types/node": "^24.3.0",
38
+ "@types/yargs": "^17.0.33",
39
+ "@vitejs/plugin-vue": "^6.0.1",
40
+ "cross-env": "^10.0.0",
41
+ "lodash-es": "^4.17.21",
42
+ "jest": "^30.1.3",
43
+ "rimraf": "^6.0.1",
44
+ "ts-jest": "^29.4.1",
45
+ "ts-node": "^10.9.2",
46
+ "tslib": "^2.8.1",
47
+ "tsx": "^4.20.4",
48
+ "unplugin-dts": "^1.0.0-beta.6",
49
+ "vite": "^7.1.3",
50
+ "vite-plugin-dts": "^4.5.4",
51
+ "vue": "^3.5.20"
52
+ },
53
+ "packageManager": "yarn@4.9.4+sha512.7b1cb0b62abba6a537b3a2ce00811a843bea02bcf53138581a6ae5b1bf563f734872bd47de49ce32a9ca9dcaff995aa789577ffb16811da7c603dcf69e73750b"
54
+ }
@@ -0,0 +1,2 @@
1
+ error.png
2
+ https://www.iconfinder.com/icons/345380/warning_watch_out_icon
Binary file
Binary file
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Part of cati project.
3
+ *
4
+ * @copyright Copyright (C) 2023 __ORGANIZATION__.
5
+ * @license __LICENSE__
6
+ */
7
+
8
+ import '@windwalker-io/unicorn';
9
+ import 'systemjs';
10
+ import 'axios';
11
+
12
+ declare global {
13
+ var S: typeof System;
14
+ }
@@ -0,0 +1,5 @@
1
+ declare module '*.vue' {
2
+ import { defineComponent } from 'vue'
3
+ const component: ReturnType<typeof defineComponent>
4
+ export default component
5
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Part of cati project.
3
+ *
4
+ * @copyright Copyright (C) 2023 __ORGANIZATION__.
5
+ * @license __LICENSE__
6
+ */
7
+
8
+ import Vue from 'vue'
9
+
10
+ declare module '@vue/runtime-core' {
11
+ interface ComponentCustomProperties {
12
+ $lang: Function;
13
+ questionProp: Function;
14
+ introtext: Function;
15
+ }
16
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,71 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { resolve } from 'path';
3
+ import { defineConfig } from "vite";
4
+ import dts from "unplugin-dts/vite";
5
+ const dependencies = JSON.parse(readFileSync('./package.json', 'utf8')).dependencies || {};
6
+
7
+ export default defineConfig(({ mode }) => {
8
+ return {
9
+ resolve: {
10
+ alias: {
11
+ '@': resolve('./src'),
12
+ },
13
+ },
14
+ build: {
15
+ lib: {
16
+ entry: 'src/index.ts',
17
+ formats: ['es', 'cjs'],
18
+ },
19
+ sourcemap: true,
20
+ rollupOptions: {
21
+ external: [
22
+ /^node:/,
23
+ 'fs',
24
+ 'path',
25
+ 'url',
26
+ 'util',
27
+ 'crypto',
28
+ 'module',
29
+ 'os',
30
+ 'child_process',
31
+ 'worker_threads',
32
+ 'tty',
33
+ 'vite',
34
+ ...Object.keys(dependencies),
35
+ ],
36
+ output: [
37
+ {
38
+ format: 'es',
39
+ entryFileNames: 'index.js',
40
+ inlineDynamicImports: true,
41
+ },
42
+ {
43
+ format: 'cjs',
44
+ entryFileNames: 'index.cjs',
45
+ inlineDynamicImports: true,
46
+ exports: 'named',
47
+ },
48
+ ],
49
+ treeshake: { moduleSideEffects: false },
50
+ },
51
+ target: 'esnext',
52
+ outDir: 'dist',
53
+ emptyOutDir: true,
54
+ minify: false,
55
+ },
56
+ plugins: [
57
+ dts({
58
+ // entryRoot: 'src',
59
+ // pathsToAliases: true,
60
+ outDirs: 'dist',
61
+ tsconfigPath: './tsconfig.json',
62
+ insertTypesEntry: true,
63
+ // merge to 1 file
64
+ // rollupTypes: true,
65
+ bundleTypes: true,
66
+ }),
67
+ ],
68
+ };
69
+ });
70
+
71
+