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

build(src,test,lib): properly build project/ignore build products #128

Merged
merged 13 commits into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
node_modules/
# Ignore Node.js modules dir.
node_modules/

# Ignore metadata generated by Jekyll.
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# Ignore folders generated by Bundler.
.bundle/
/vendor/

# Ignore secrets.
.env

# Ignore macOS-specific files.
.DS_Store

# Ignore out dirs of build products.
types/
lib/
dist/

# Ignore TypeScript log files.
tsconfig.tsbuildinfo
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node
lts/gallium
65 changes: 0 additions & 65 deletions index.d.ts

This file was deleted.

104 changes: 0 additions & 104 deletions index.js

This file was deleted.

24 changes: 0 additions & 24 deletions index.test.js

This file was deleted.

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"engines": {
"node": "^14.17.0 || ^16.13.0 || ^18.12.0"
},
"main": "./index.js",
"types": "./index.d.ts",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"scripts": {
"prepare": "npm run compile-src && npm run compile-doc",
"compile-src": "tsc --project ./",
Expand All @@ -19,7 +19,7 @@
"bugs": "https://github.com/openinf/util-text/issues",
"homepage": "https://github.com/openinf/util-text#readme",
"devDependencies": {
"@types/node": "18.11.3",
"@types/node": "16.11.68",
DerekNonGeneric marked this conversation as resolved.
Show resolved Hide resolved
"tape": "5.6.1",
"typescript": "4.8.4"
},
Expand Down
1 change: 1 addition & 0 deletions typings/declaration404.d.ts → src/declaration404.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
declare module 'has-unicode';
declare module 'supports-ansi';
declare module 'colorette';
File renamed without changes.
33 changes: 33 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2018-2021 The OpenINF Authors. All rights reserved. MIT license.

const test = require("tape");
const { mdCodeSpans2html } = require("./index.js");
DerekNonGeneric marked this conversation as resolved.
Show resolved Hide resolved

// @see
// https://github.com/KyleGobel/MarkdownSharp-GithubCodeBlocks/blob/0ba86dc7ea58ab9ad6b0dc663c3def7558f8f17e/MarkdownSharp.cs#L1352
test(
"should translate multiple backtick delimiters of Markdown `code spans` " +
"into HTML code tags",
(t) => {
let textIn = "Just type ``foo `bar` baz`` at the prompt.";
let textOut = "Just type <code>foo `bar` baz</code> at the prompt.";
t.strictEquals(mdCodeSpans2html(textIn), textOut);
textIn = "... type `` `bar` `` ...";
textOut = "... type <code>`bar`</code> ...";
t.strictEquals(mdCodeSpans2html(textIn), textOut);
t.end();
}
);

test(
"should translate single backtick delimiters of Markdown `code spans` " +
"into HTML code tags",
(t) => {
let textIn =
"Top-level `await` enables modules to act as big async functions.";
let textOut =
"Top-level <code>await</code> enables modules to act as big async functions.";
DerekNonGeneric marked this conversation as resolved.
Show resolved Hide resolved
t.strictEquals(mdCodeSpans2html(textIn), textOut);
t.end();
}
);
32 changes: 32 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"composite": true,
"declaration": true,
"declarationDir": "./types",
"declarationMap": true,
"downlevelIteration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ESNext"],
"module": "node16",
"moduleResolution": "node16",
"noImplicitReturns": true,
"outDir": "lib",
"paths": {},
"pretty": true,
"resolveJsonModule": true,
"rootDir": "src",
"rootDirs": ["src", "lib"],
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"strictNullChecks": true,
"target": "ESNext",
"typeRoots": ["node_modules/@types"],
"types": ["node"]
},
"include": ["src/**/*.ts"]
}
Loading