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

refactor: リポジトリをNode 16+/npm 8+へ変更 #1464

Merged
merged 8 commits into from
Aug 21, 2022
Merged

Conversation

azu
Copy link
Collaborator

@azu azu commented Aug 21, 2022

  • Node 16/npm8
  • type:module へ変更
  • ESMの.example.jsのテスト方法を変更

fix #1463

@bot-user
Copy link

bot-user commented Aug 21, 2022

Deploy Preview for js-primer ready!

Name Link
🔨 Latest commit 94fa92c
🔍 Latest deploy log https://app.netlify.com/sites/js-primer/deploys/63021675bf394a0009e1cd25
😎 Deploy Preview https://deploy-preview-1464--js-primer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@@ -1,28 +0,0 @@
// LICENSE : MIT
"use strict";
const tester = require("text-testing-mocha");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このテストはメンテされてないのでいいかなと思ったので消した。依存的に古いから

package.json Outdated
@@ -47,26 +47,27 @@
"gitbook",
"textlint"
],
"workspaces": ["textlint/*"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

textlintルールはworkspaceで入れる。

@@ -2,5 +2,5 @@
publish = "_book"
command = "npm run build"
[build.environment]
NODE_VERSION = "14"
NODE_VERSION = "16"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Netlifyは16

@@ -76,7 +76,7 @@ ${message}`);
it("prototypeメソッドの説明をする前にObject#methodの表記を利用してはいけない", () => {
// 許可リスト(読み方の解説など)
const allowFilePathList = [];
const searchPatterns = ["/\\`[a-zA-Z]+#[a-zA-Z]*\\`/"];
const searchPatterns = ["/`[a-zA-Z]+#[a-zA-Z]*`/"];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unicodeオプションが作るのでescapeがエラーになった

@@ -12,7 +12,7 @@
"scripts": {
"test": "mocha \"./final/final/test/*.js\"",
"e2e": "start-server-and-test start http://localhost:3000/README.md cy:run",
"start": "npx @js-primer/local-server --port 3000",
"start": "npx -y @js-primer/local-server --port 3000",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npxはデフォルトだとインストールはしないので、

@@ -1,833 +0,0 @@
#!/bin/sh
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多分pdfとかをローカルで作ってた時のかも。今はいらない。

Comment on lines +8 to +30

/**
* ESMのeampleを評価するテスト
* Note: ESMには対応していない
**/
describe("example:es", function() {
const esmFiles = globby.sync([
`${sourceDir}/use-case/todoapp/**/*-example.js`, // *-example.js
`${sourceDir}/use-case/todoapp/**/*.example.js`, // *.example.js
]);
esmFiles.forEach(filePath => {
const normalizeFilePath = filePath.replace(sourceDir, "");
// TODO: doctestはしていないで、読み込んでOKかどうかだけ
it(`example:es ${normalizeFilePath}`, function() {
return import(filePath).catch(error => {
// Stack Trace like
console.error(`Dynamic Eval is failed
at doctest (${filePath}:1:1)`);
return Promise.reject(error);
});
});
})
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vm2はESMをサポートしてないので、dynamic importを使って評価する形にした。
.exampleとは別の名前にした方いいかもしれない。

@azu azu merged commit d8a1e14 into master Aug 21, 2022
@azu azu deleted the feature/1463 branch August 21, 2022 11:53
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

Successfully merging this pull request may close these issues.

リポジトリをnpm8/Node 16+に変更する
2 participants