Closed25

npm公開まで

kichionkichion

local PCにnpmユーザ登録する

kichionkichion
$ npm set init.author.name "kichion"
$ npm set init.author.email "kkikuchi1539@gmail.com"
$ npm set init.author. url "https://github.com/kichion"
$ npm adduser
kichionkichion
npm notice Log in on https://registry.npmjs.org/
Username: kichion
Password: 
Email: (this IS public) kkikuchi1539@gmail.com
Logged in as kichion on https://registry.npmjs.org/.
kichionkichion

かんたんな処理系のものを書こう

kichionkichion

なんかrootに生えちゃった

$ ~/node_modules/.bin/tsc --init
kichionkichion

npm initする

$ npm init
{
  "name": "when-to-datetime",
  "version": "0.0.1",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/kichion/when-to-datetime.git"
  },
  "keywords": [
    "datetime"
  ],
  "author": "kichion <kkikuchi1539@gmail.com>",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/kichion/when-to-datetime/issues"
  },
  "homepage": "https://github.com/kichion/when-to-datetime#readme"
}
kichionkichion

TDDできるようにする

kichionkichion

こんなもんか

$ npm install --save-dev typescript jest ts-jest @types/jest
kichionkichion
module.exports = {
  roots: ["<rootDir>"],
  preset: "ts-jest",
  verbose: true,
  moduleFileExtensions: ["ts", "js", "json"],
  testPathIgnorePatterns: ["<rootDir>[/\\\\](node_modules)[/\\\\]"],
  transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(ts)$"],
  testMatch: ["<rootDir>/**/?(*.)(spec|test).(ts|js)"],
  moduleNameMapper: { "#/(.+)": "<rootDir>/src/$1" },
  moduleDirectories: ["node_modules", "src"],
  testEnvironmentOptions: { resources: "usable" },
};
kichionkichion

ライセンス残そう

Copyright 2021 Kakeru Kikuchi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
kichionkichion

公開する

kichionkichion

prepublishOnly付けたからbuild要らなかった
あと403になった

kichionkichion
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/when-to-datetime - Forbidden
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

設定がおかしいかも

このスクラップは2021/06/09にクローズされました