taraskevizer 0.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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.github/workflows/main.yml +19 -0
- package/.github/workflows/publish.yml +33 -0
- package/.idea/codeStyles/Project.xml +70 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +8 -0
- package/.idea/taraskevizer.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.prettierignore +3 -0
- package/.prettierrc +5 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +2201 -0
- package/dist/index.mjs +2164 -0
- package/esbuild-plugins/no-debug-files.js +8 -0
- package/json/g.json +1 -0
- package/json/latinLetters.json +46 -0
- package/json/latinLettersUpperCase.json +51 -0
- package/json/softers.json +12 -0
- package/json/wordlist.json +1359 -0
- package/package.json +18 -0
- package/postprocess/index.js +6 -0
- package/postprocess/json-generator.js +39 -0
- package/src/dict.ts +1982 -0
- package/src/index.ts +3 -0
- package/src/tarask.ts +258 -0
- package/src/tools.debug.ts +20 -0
- package/src/tsconfig.json +5 -0
- package/src/types.ts +15 -0
- package/tsup.config.js +24 -0
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "taraskevizer",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup",
|
|
10
|
+
"release": "npm run build && changeset publish"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@changesets/cli": "^2.26.0",
|
|
14
|
+
"prettier": "^3.0.0",
|
|
15
|
+
"tsup": "^6.5.0",
|
|
16
|
+
"typescript": "^4.9.4"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { exists as _exists } from 'fs';
|
|
3
|
+
import { promisify } from 'util';
|
|
4
|
+
import { writeFile, mkdir } from 'fs/promises';
|
|
5
|
+
const exists = promisify(_exists);
|
|
6
|
+
const outputPath = path.resolve('json');
|
|
7
|
+
|
|
8
|
+
const regexToStr = (obj) => {
|
|
9
|
+
for (const key in obj) obj[key] = obj[key].source;
|
|
10
|
+
return obj;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let beenExecuted = false;
|
|
14
|
+
export default (source, execOnlyOnce) => {
|
|
15
|
+
if (execOnlyOnce) {
|
|
16
|
+
if (beenExecuted) return;
|
|
17
|
+
beenExecuted = true;
|
|
18
|
+
}
|
|
19
|
+
let wordlist, softers, gobj, latinLetters, latinLettersUpperCase;
|
|
20
|
+
eval(source.replace(/const|let|var|exports\.|"use strict";/g, ''));
|
|
21
|
+
exists(outputPath)
|
|
22
|
+
.then((exists) => exists || mkdir(outputPath))
|
|
23
|
+
.then(() =>
|
|
24
|
+
Promise.all(
|
|
25
|
+
[
|
|
26
|
+
['wordlist', regexToStr(wordlist)],
|
|
27
|
+
['softers', regexToStr(softers)],
|
|
28
|
+
['latinLetters', regexToStr(latinLetters)],
|
|
29
|
+
['latinLettersUpperCase', regexToStr(latinLettersUpperCase)],
|
|
30
|
+
['g', gobj],
|
|
31
|
+
].map(([fileName, obj]) =>
|
|
32
|
+
writeFile(
|
|
33
|
+
path.resolve(outputPath, fileName + '.json'),
|
|
34
|
+
JSON.stringify(obj)
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
};
|