$ mkdir bun-demo
$ cd bun-demo
$ bun init
bun init helps you get started with a minimal project and tries to guess sensible defaults. Press ^C anytime to quit
package name (bun-demo):
entry point (index.ts): src/index.ts
Done! A package.json file was saved in the current directory.
+ index.ts
+ .gitignore
+ tsconfig.json (for editor auto-complete)
+ README.md
To get started, run:
bun run index.ts
import { expect, test } from "bun:test";
import { greet } from "../src/greet";
test("should return hello world", () => {
expect(greet("world")).toBe("Hello, world!");
});
テストはbun testコマンドで実行可能です。
$ bun test
bun test v1.1.7 (b0b7db5c)
test/greet.spec.ts:
✓ should return hello world [0.41ms]
1 pass
0 fail
1 expect() calls
Ran 1 tests across 1 files. [57.00ms]
$ ng new angular-tutorial
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
CREATE angular-tutorial/README.md (1069 bytes)
CREATE angular-tutorial/.editorconfig (274 bytes)
CREATE angular-tutorial/.gitignore (548 bytes)
CREATE angular-tutorial/angular.json (2750 bytes)
CREATE angular-tutorial/package.json (1047 bytes)
CREATE angular-tutorial/tsconfig.json (901 bytes)
CREATE angular-tutorial/tsconfig.app.json (263 bytes)
CREATE angular-tutorial/tsconfig.spec.json (273 bytes)
CREATE angular-tutorial/.vscode/extensions.json (130 bytes)
CREATE angular-tutorial/.vscode/launch.json (470 bytes)
CREATE angular-tutorial/.vscode/tasks.json (938 bytes)
CREATE angular-tutorial/src/main.ts (214 bytes)
CREATE angular-tutorial/src/favicon.ico (948 bytes)
CREATE angular-tutorial/src/index.html (301 bytes)
CREATE angular-tutorial/src/styles.css (80 bytes)
CREATE angular-tutorial/src/app/app.module.ts (314 bytes)
CREATE angular-tutorial/src/app/app.component.css (0 bytes)
CREATE angular-tutorial/src/app/app.component.html (23083 bytes)
CREATE angular-tutorial/src/app/app.component.spec.ts (922 bytes)
CREATE angular-tutorial/src/app/app.component.ts (220 bytes)
CREATE angular-tutorial/src/assets/.gitkeep (0 bytes)
✔ Packages installed successfully.
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Successfully initialized git.
$ npx jest --init
The following questions will help Jest to create a suitable configuration for your project
✔ Would you like to use Jest when running "test" script in "package.json"? … yes
✔ Would you like to use Typescript for the configuration file? … yes
✔ Choose the test environment that will be used for testing › node
✔ Do you want Jest to add coverage reports? … yes
✔ Which provider should be used to instrument code for coverage? › v8
✔ Automatically clear mock calls, instances, contexts and results before every test? … yes
✏️ Modified /Users/t0k0sh1/Workspace/honeycomb/packages/cli/package.json
📝 Configuration file created at /Users/t0k0sh1/Workspace/honeycomb/packages/cli/jest.config.ts
$ npm install sass@1.56.2
changed 1 package, and audited 39 packages in 669ms
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
執筆時点(2022/05/17)では、autoprefixerはバージョン指定なしでインストールするとv10系がインストールされます。 grunt-postcssv0.9系と組み合わせると、 Warning: [object Object] is not a PostCSS plugin Use --force to continue. という警告が発生して実行に失敗(Aborted)します。そのため、バージョン指定なしで上記エラーが発生する場合は、npm install -D autoprefixer@^9のようにv9系を指定してインストールしてください。
$ npm run build
> primecss@1.0.0 build
> grunt build
Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.
Using browsers option can cause errors. Browserslist config
can be used for Babel, Autoprefixer, postcss-normalize and other tools.
If you really need to use option, rename it to overrideBrowserslist.
Learn more at:
https://github.com/browserslist/browserslist#readme
Running "sass:dist" (sass) task
Running "postcss:dist" (postcss) task
>> 1 processed stylesheet created.
Done.
$ npm i -D eslint eslint-config-prettier prettier husky
added 85 packages, and audited 86 packages in 4s
15 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /Users/t0k0sh1/workspace/node_lint/.git/
$ git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .husky/pre-commit
modified: package.json
$ npm run lint
> node_eslint@1.0.0 lint
> eslint ./
/Users/t0k0sh1/workspace/node_eslint/dir3/file3.js
1:10 error 'file3' is defined but never used no-unused-vars
2:1 error 'console' is not defined no-undef
/Users/t0k0sh1/workspace/node_eslint/dir4/file4.js
1:10 error 'file4' is defined but never used no-unused-vars
2:1 error 'console' is not defined no-undef
/Users/t0k0sh1/workspace/node_eslint/file1.js
1:10 error 'file1' is defined but never used no-unused-vars
2:1 error 'console' is not defined no-undef
/Users/t0k0sh1/workspace/node_eslint/file2.js
1:10 error 'file2' is defined but never used no-unused-vars
2:1 error 'console' is not defined no-undef
✖ 8 problems (8 errors, 0 warnings)
$ npm run lint
> node_eslint@1.0.0 lint
> eslint ./
/Users/t0k0sh1/workspace/node_eslint/dir3/file3.js
1:10 error 'file3' is defined but never used no-unused-vars
2:1 error 'console' is not defined no-undef
/Users/t0k0sh1/workspace/node_eslint/file1.js
1:10 error 'file1' is defined but never used no-unused-vars
2:1 error 'console' is not defined no-undef
✖ 4 problems (4 errors, 0 warnings)