Skip to content

Commit

Permalink
Revert "feat: typescript support (#185)"
Browse files Browse the repository at this point in the history
This reverts commit 8797f7f.
  • Loading branch information
JiLiZART authored Apr 23, 2024
1 parent 8797f7f commit bb81aca
Show file tree
Hide file tree
Showing 149 changed files with 3,715 additions and 6,147 deletions.
5 changes: 0 additions & 5 deletions .changeset/khaki-cobras-hide.md

This file was deleted.

25 changes: 0 additions & 25 deletions .devcontainer/devcontainer.json

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ jobs:
cache: 'pnpm'

- name: Install
run: pnpm i --frozen-lockfile --strict-peer-dependencies
run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Run the lint
run: pnpm run lint
run: pnpm lint

- name: Install coverage
run: pnpm install --global codecov

- name: Run the coverage
run: pnpm run cover
run: pnpm cover

- name: Run the coverage
run: codecov
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,3 @@ typings/
# benchmark test files
benchmark/html5
.nx

.nx


.nx/cache
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
registry=https://registry.npmjs.org/
link-workspace-packages=true
9 changes: 5 additions & 4 deletions .swcrc-commonjs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"module": {
"type": "commonjs",

Expand All @@ -10,12 +9,14 @@
},
"jsc": {
"transform": {
"optimizer": {}
"optimizer": {
"simplify": false
}
},
"loose": true,
"parser": {
"syntax": "typescript",
"tsx": true
"syntax": "ecmascript",
"jsx": true
}
}
}
9 changes: 5 additions & 4 deletions .swcrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"module": {
"type": "es6",
"strict": false,
Expand All @@ -10,13 +9,15 @@
"minify": false,
"jsc": {
"transform": {
"optimizer": {}
"optimizer": {
"simplify": false
}
},
"target": "es2018",
"loose": true,
"parser": {
"syntax": "typescript",
"tsx": true
"syntax": "ecmascript",
"jsx": true
},
"externalHelpers": false
}
Expand Down
8 changes: 4 additions & 4 deletions benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ suite
});
})
.add('@bbob/parser lexer old', () => {
const lexer1 = require('./lexer_old');
const lexer1 = require('@bbob/parser/lib/lexer_old');

return require('@bbob/parser').parse(stub, {
return require('@bbob/parser/lib/index').parse(stub, {
onlyAllowTags: ['ch'],
createTokenizer: lexer1.createLexer,
});
})
.add('@bbob/parser lexer', () => {
const lexer2 = require('@bbob/parser');
const lexer2 = require('@bbob/parser/lib/lexer');

return require('@bbob/parser').parse(stub, {
return require('@bbob/parser/lib/index').parse(stub, {
onlyAllowTags: ['ch'],
createTokenizer: lexer2.createLexer,
});
Expand Down
3 changes: 1 addition & 2 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"url": "https://artkost.ru/"
},
"dependencies": {
"@bbob/parser": "*",
"@bbob/plugin-helper": "*",
"@bbob/parser": "workspace:*",
"benchmark": "2.1.4",
"picocolors": "1.0.0",
"xbbcode-parser": "0.1.2",
Expand Down
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@
"message": "chore(release): publish %s"
}
},
"npmClient": "pnpm",
"useNx": true,
"useWorkspaces": true
"useNx": true
}
83 changes: 7 additions & 76 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,12 @@
{
"targetDefaults": {
"types": {
"dependsOn": [
"^types"
],
"outputs": ["{projectRoot}/types"],
"cache": true
},
"build": {
"dependsOn": [
"^types",
"^build:commonjs",
"^build:es",
"^build:umd"
],
"outputs": ["{projectRoot}/lib", "{projectRoot}/es", "{projectRoot}/dist"],
"cache": true
},
"test": {
"dependsOn": [
"^build",
"^test"
]
},
"cover": {
"dependsOn": [
"^build",
"^cover"
],
"outputs": ["{projectRoot}/coverage"]
},
"lint": {
"dependsOn": [
"^lint"
]
},
"build:commonjs": {
"dependsOn": [
"^build:es",
"^build:commonjs"
],
"outputs": ["{projectRoot}/lib"],
"cache": true
},
"build:es": {
"dependsOn": [
"^build:es"
],
"outputs": ["{projectRoot}/es"],
"cache": true
},
"build:umd": {
"dependsOn": [
"^build:es",
"^build:umd"
],
"outputs": ["{projectRoot}/dist"],
"cache": true
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"defaultBase": "master",
"extends": "nx/presets/npm.json",
"plugins": [
{
"plugin": "@nx/eslint/plugin",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"targetName": "eslint:lint",
"extensions": [
"ts",
"tsx",
"js",
"jsx",
"html",
"vue"
]
"cacheableOperations": ["build"]
}
}
]
},
"targetDefaults": {},
"defaultBase": "master"
}
68 changes: 26 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "bbob",
"scripts": {
"prepublishOnly": "npm run test",
"bootstrap": "pnpm re",
"bootstrap": "lerna bootstrap --no-ci",
"publish-ci": "npm run build && lerna publish from-package --yes --include-merged-tags --conventional-commits",
"publish-canary": "npm run build && lerna publish --yes --include-merged-tags --conventional-commits --no-private --no-git-tag-version",
"publish-from-packages": "npm run build && lerna publish from-package --yes --include-merged-tags --conventional-commits --create-release github",
Expand All @@ -11,13 +10,11 @@
"publish-minor": "npm run build && lerna version minor --include-merged-tags --conventional-commits --no-git-tag-version --no-private",
"size": "nx run-many --target=size",
"bundlesize": "nx run-many --target=bundlesize",
"test": "nx run-many --target=test",
"test": "npm run build && nx run-many --target=link && nx run-many --target=test",
"cover": "nx run-many --target=cover",
"build": "nx run-many --target=build",
"types": "nx run-many --target=types",
"release": "npm run build && changeset publish",
"lint": "nx run-many --target=lint",
"cleanup": "node scripts/cleanup"
"lint": "nx run-many --target=link && npm run build && nx run-many --target=lint"
},
"author": {
"name": "Nikolay Kostyurin <[email protected]>",
Expand All @@ -29,13 +26,14 @@
"@changesets/cli": "2.26.2",
"@commitlint/cli": "13.2.1",
"@commitlint/config-conventional": "13.2.0",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-replace": "5.0.5",
"@size-limit/preset-small-lib": "11.0.1",
"@swc/cli": "0.3.10",
"@swc/core": "1.3.107",
"@swc/jest": "0.2.36",
"@nrwl/cli": "15.3.3",
"@rollup/plugin-commonjs": "23.0.2",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-replace": "5.0.1",
"@size-limit/preset-small-lib": "6.0.1",
"@swc/cli": "0.1.57",
"@swc/core": "1.3.16",
"@swc/jest": "0.2.23",
"@testing-library/dom": "9.3.1",
"@testing-library/jest-dom": "6.1.2",
"bundlesize2": "0.0.31",
Expand All @@ -48,26 +46,18 @@
"eslint-plugin-react": "7.26.1",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "7.0.2",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"lerna": "7.4.1",
"jest": "29.5.0",
"jest-environment-jsdom": "29.6.4",
"lerna": "6.0.3",
"lint-staged": "11.2.3",
"microtime": "3.0.0",
"nx": "18.3.3",
"posthtml-render": "3.0.0",
"rimraf": "5.0.5",
"rollup": "4.1.5",
"nx": "15.3.3",
"posthtml-render": "^3.0.0",
"rimraf": "^3.0.2",
"rollup": "3.3.0",
"rollup-plugin-gzip": "3.1.0",
"rollup-plugin-swc3": "0.11.0",
"size-limit": "11.0.1",
"typescript": "5.1.6",
"@types/node": "20.4.5",
"@types/jest": "29.5.3",
"@types/react": "18.2.18",
"@nx/eslint": "18.3.3",
"@nx/rollup": "18.3.3",
"@nx/jest": "18.3.3",
"@bbob/scripts": "*"
"rollup-plugin-swc3": "0.7.0",
"size-limit": "6.0.1"
},
"publishConfig": {
"access": "public",
Expand All @@ -79,18 +69,15 @@
}
},
"pkgTasks": {
"build:commonjs": "@/cross-env BABEL_ENV=commonjs NODE_ENV=production @/swc ./src/ --config-file ../../.swcrc-commonjs.json --out-dir lib --strip-leading-paths",
"build:es": "@/cross-env BABEL_ENV=es NODE_ENV=production @/swc ./src/ --config-file ../../.swcrc.json --out-dir es --strip-leading-paths",
"build:umd": "@/cross-env BABEL_ENV=rollup NODE_ENV=production @/rollup --config ../../rollup.config.mjs",
"build": "npm run build:es && npm run build:commonjs && npm run build:umd",
"build-commonjs": "@/cross-env BABEL_ENV=commonjs NODE_ENV=production @/swc --config-file ../../.swcrc-commonjs.json --out-dir lib src",
"build-es": "@/cross-env BABEL_ENV=es NODE_ENV=production @/swc --config-file ../../.swcrc.json --out-dir es src",
"build-umd": "@/cross-env BABEL_ENV=rollup NODE_ENV=production @/rollup --config ../../rollup.config.mjs",
"test": "@/jest",
"cover": "@/jest --coverage .",
"cover": "@/jest --config ../../jest.config.js --coverage .",
"lint": "@/eslint .",
"types": "@/tsc",
"bundlesize": "npm run build && @/cross-env NODE_ENV=production @/bundlesize .",
"size": "npm run build && @/cross-env NODE_ENV=production @/size-limit ."
"bundlesize": "npm run build && @/cross-env NODE_ENV=production @/bundlesize ."
},
"packageManager": "pnpm@8.15.1",
"packageManager": "pnpm@8.7.6",
"pnpm": {
"overrides": {
"semver@>=7.0.0 <7.5.2": ">=7.5.2",
Expand All @@ -113,8 +100,5 @@
}
}
}
},
"nx": {
"includedScripts": []
}
}
5 changes: 0 additions & 5 deletions packages/bbob-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
coverage
dist
lib
es
types
test/*.d.ts
test/*.map
8 changes: 3 additions & 5 deletions packages/bbob-cli/.npmignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pnpm-lock.yaml
package-lock.json
coverage
src
!dist
!lib
!es
*.test.js
dist
!lib
15 changes: 2 additions & 13 deletions packages/bbob-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
# @bbob/cli
[![install size](https://packagephobia.now.sh/badge?p=@bbob/cli)](https://packagephobia.now.sh/result?p=@bbob/html) [![Known Vulnerabilities](https://snyk.io/test/github/JiLiZART/bbob/badge.svg?targetFile=packages%2Fbbob-cli%2Fpackage.json)](https://snyk.io/test/github/JiLiZART/bbob?targetFile=packages%2Fbbob-cli%2Fpackage.json)
#@bbob/cli

> Converts bbcode string to html
Convert BBCode to HTML

```shell
npm i -g @bbob/cli
```

```shell
echo "[i]Text[/i]" | bbob

# prints
<span style="font-style: italic;">Text</span>
```
Loading

0 comments on commit bb81aca

Please sign in to comment.