Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from tsbb 3.x to 4.x. #439

Open
jaywcjlove opened this issue Mar 28, 2023 · 0 comments
Open

Migrate from tsbb 3.x to 4.x. #439

jaywcjlove opened this issue Mar 28, 2023 · 0 comments

Comments

@jaywcjlove
Copy link
Owner

jaywcjlove commented Mar 28, 2023

Updates in version v4

  1. Updated typescript v5 dependency
  2. Updated jest v29 dependency
  3. Refactored feature package management
  4. Refactored create-tsbb based on package internal examples generation
  5. Updated template examples
- tsbb build [options]
+ tsbb build [source…] [options]
- --entry, -e
- --emit-type
- --no-emit-type
- --disable-babel
- --no-babel-option
- --file-names, -f
+ --use-babel   Use Babel.(works in babel)
+ --bail        Exit the compile as soon as the compile fails(default: true).
 --source-maps  Enables the generation of sourcemap files.(works in babel)
 --env-name     The current active environment used during configuration loading.(works in babel)
 --esm          Output "esm" directory.(works in babel)
 --cjs          Output "cjs" directory.(works in babel)
- $ tsbb build --file-names src/main.ts --file-names src/good.ts
+ $ tsbb build src/main.ts src/good.ts
- $ tsbb build --entry src/main.ts
+ $ tsbb build src/main.ts
+ $ tsbb build src/*.ts                   # Build your project.
+ $ tsbb build src/main.ts src/good.ts    # Specify the entry directory.
$ tsbb build src/*.ts --use-babel --no-source-maps  # No ".js.map" file is generated. (works in babel)
$ tsbb watch src/*.ts --use-babel --cjs ./cjs       # Watch Output directory.
$ tsbb build src/*.ts --use-babel --esm ./es        # Output directory.
$ tsbb build src/*.ts --use-babel --use-vue         # To add Vue JSX support.
$ tsbb test                                         # Run test suites related
$ tsbb test --coverage --bail                       # Test coverage information should be collected
Usage: create-tsbb <app-name> [options] [--help|h]
Options:

  --version, -v Show version number
  --help, -h Displays help information.
-  --output, -o Output directory.
  --example, -e Example from: https://jaywcjlove.github.io/tsbb , default: "basic"
  --force, -f Overwrite target directory if it exists. default: false
-  --path, -p Specify the download target git address. default: "https://jaywcjlove.github.io/tsbb"

TypeScript Project

To configure the tsconfig.json properly, you must first define either the include or files field(s) to specify which files need to be compiled. Once you've done that, you can then specify the outDir for the output directory in the configuration.

{
  "$schema": "http://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "module": "commonjs",
    "target": "esnext",
    "outDir": "./lib",
    "strict": true,
    "skipLibCheck": true
  },
  "include": ["src/**/*"],
  "exclude": [
    "node_modules",
    "**/*.spec.ts"
  ]
}

After completing tsconfig.json configuration, you can configure scripts in package.json:

{
  "scripts": {
    "watch": "tsbb watch",
    "build": "tsbb build"
  },
  "devDependencies": {
    "tsbb": "*"
  }
}

Babel Project

Adding the parameter --use-babel to your project enables babel to compile and output cjs/esm files simultaneously, while ts is only needed for type output.

$ tsbb build "src/*ts" --use-babel

You can change the built-in settings of Babel by adding a .babelrc configuration file. Additionally, you can modify the Babel configurations for esm and cjs separately through environment variables. Please refer to the example below:

{
  "env": {
    "cjs": {
      "presets": ["@babel/preset-typescript"]
    },
    "esm": {
      "presets": ["@babel/preset-env", {
        "modules": false,
        "loose": true,
        "targets": {
          "esmodules": true,
        },
      }]
    }
  } 
}

At compile time, specify the environment variable --envName='xxx' to enable reading of relevant configurations from the settings. This environment variable can also be customized.

{
  "env": {
    "xxx": { ... }
  } 
}

jest dependency issue

jaywcjlove added a commit that referenced this issue Mar 28, 2023
jaywcjlove added a commit that referenced this issue Mar 28, 2023
github-actions bot added a commit that referenced this issue Mar 28, 2023
jaywcjlove added a commit to uiwjs/react-codepen that referenced this issue Mar 29, 2023
github-actions bot pushed a commit to uiwjs/react-codepen that referenced this issue Mar 29, 2023
jaywcjlove added a commit to jaywcjlove/sgo that referenced this issue Mar 29, 2023
jaywcjlove added a commit to uiwjs/react-codepen that referenced this issue Mar 29, 2023
jaywcjlove added a commit to uiwjs/icons that referenced this issue Mar 29, 2023
jaywcjlove added a commit to uiwjs/bootstrap-icons that referenced this issue Mar 29, 2023
jaywcjlove added a commit to jaywcjlove/icongo that referenced this issue Mar 29, 2023
jaywcjlove added a commit to tsbbjs/tsbb that referenced this issue Mar 29, 2023
* refactor: refactor tsbb.

* doc: Update README.md

* chore: update workflows config.

* chore: update scripts.

* chore: update workflows config.

* chore: update workflows config.

* chore: update workflows config.

* fix: export @tsbb/babel & @tsbb/jest.

* doc: Update README.md

* test: fix test case error.

* released v4.0.0-alpha.1 (jaywcjlove#439)

* example(react-component): update example scripts.

* example(react-component): update example scripts.

* example(react-component): update test case.

* example(react-component): update test case.

* chore: update workflows config.

* test: update example scripts.

* fix: fix create-tsbb example does not exist.

* doc: Update README.md

* released v4.0.0-alpha.2

* fix(create-tsbb): update files field in package.json

* released v4.0.0-alpha.3

* doc: update command line help document.

* released v4.0.0 jaywcjlove#439

* fix: fix babel compile cjs issue.

* perf: optimize babel transform file.

* released v4.0.1

* type(core): fix type errors.

* type: fix copy *d.ts issue.

* chore: update workflows config.

* released v4.0.2
jaywcjlove added a commit to jaywcjlove/svgtofont that referenced this issue Mar 29, 2023
github-actions bot pushed a commit to jaywcjlove/svgtofont that referenced this issue Mar 29, 2023
jaywcjlove added a commit to jaywcjlove/colors-named that referenced this issue Mar 29, 2023
github-actions bot pushed a commit to jaywcjlove/colors-named that referenced this issue Mar 29, 2023
jaywcjlove added a commit to jaywcjlove/colors-named-hex that referenced this issue Mar 29, 2023
github-actions bot pushed a commit to jaywcjlove/colors-named-hex that referenced this issue Mar 29, 2023
github-actions bot pushed a commit to jaywcjlove/colors-named that referenced this issue Mar 29, 2023
jaywcjlove added a commit to jaywcjlove/colors-named-decimal that referenced this issue Mar 29, 2023
jaywcjlove referenced this issue in jaywcjlove/colors-named-decimal Mar 29, 2023
github-actions bot pushed a commit to jaywcjlove/colors-named-decimal that referenced this issue Mar 29, 2023
jaywcjlove added a commit to jaywcjlove/parcel-plugin-markdown-string that referenced this issue Mar 29, 2023
jaywcjlove added a commit to jaywcjlove/rehype-rewrite that referenced this issue Mar 30, 2023
jaywcjlove added a commit to jaywcjlove/generate-password that referenced this issue Mar 30, 2023
github-actions bot added a commit to jaywcjlove/generate-password that referenced this issue Mar 30, 2023
jaywcjlove added a commit to jaywcjlove/code-image that referenced this issue Mar 30, 2023
jaywcjlove added a commit to jaywcjlove/validator.js that referenced this issue Apr 5, 2023
jaywcjlove added a commit to jaywcjlove/path-templater that referenced this issue Apr 6, 2023
jaywcjlove added a commit to jaywcjlove/markdown-style that referenced this issue Apr 6, 2023
github-actions bot added a commit to jaywcjlove/markdown-style that referenced this issue Apr 6, 2023
jaywcjlove added a commit to uiwjs/react-github-corners that referenced this issue Apr 7, 2023
github-actions bot added a commit to uiwjs/react-github-corners that referenced this issue Apr 7, 2023
jaywcjlove added a commit to uiwjs/react-clock that referenced this issue Apr 7, 2023
jaywcjlove added a commit to uiwjs/react-tabs-draggable that referenced this issue Apr 7, 2023
github-actions bot pushed a commit to uiwjs/react-tabs-draggable that referenced this issue Apr 7, 2023
jaywcjlove added a commit to uiwjs/react-domain-verify that referenced this issue Apr 7, 2023
jaywcjlove added a commit to jaywcjlove/tools that referenced this issue Apr 7, 2023
jaywcjlove referenced this issue in uiwjs/react-back-to-top Apr 7, 2023
jaywcjlove added a commit to uiwjs/react-markdown-editor that referenced this issue Apr 7, 2023
github-actions bot pushed a commit to uiwjs/react-markdown-editor that referenced this issue Apr 7, 2023
jaywcjlove added a commit to uiwjs/react-prismjs that referenced this issue Apr 7, 2023
github-actions bot pushed a commit to uiwjs/react-prismjs that referenced this issue Apr 7, 2023
jaywcjlove added a commit to uiwjs/react-shields that referenced this issue Apr 9, 2023
github-actions bot added a commit to uiwjs/react-shields that referenced this issue Apr 9, 2023
jaywcjlove added a commit to uiwjs/react-layout that referenced this issue Apr 10, 2023
github-actions bot pushed a commit to uiwjs/react-layout that referenced this issue Apr 10, 2023
jaywcjlove added a commit to uiwjs/react-markdown-preview that referenced this issue Apr 11, 2023
github-actions bot added a commit to uiwjs/react-markdown-preview that referenced this issue Apr 11, 2023
jaywcjlove added a commit to uiwjs/react-code-preview-layout that referenced this issue Apr 18, 2023
github-actions bot added a commit to uiwjs/react-code-preview-layout that referenced this issue Apr 18, 2023
jaywcjlove added a commit to uiwjs/react-textarea-code-editor that referenced this issue Apr 20, 2023
github-actions bot pushed a commit to uiwjs/react-textarea-code-editor that referenced this issue Apr 20, 2023
jaywcjlove added a commit to uiwjs/react-only-when that referenced this issue May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant