Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit eca17d3

Browse files
committed
refact: move code into src/
1 parent c9bf8b2 commit eca17d3

File tree

5 files changed

+22
-69
lines changed

5 files changed

+22
-69
lines changed

package.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
"name": "tsx-create-html-element",
33
"version": "1.2.1",
44
"description": "Create html elements from tsx syntax",
5-
"main": "index.js",
6-
"types": "index.d.ts",
7-
"files": [
8-
"index.js",
9-
"global.d.ts",
10-
"index.d.ts"
11-
],
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
7+
"files": ["dist", "global.d.ts"],
128
"scripts": {
13-
"clean": "rm -f index.js index.d.ts test.js test.d.ts",
14-
"build": "tsc",
9+
"clean": "rm -rf dist",
10+
"build": "tsc -p tsconfig-build.json",
1511
"release": "standard-version",
1612
"prepublish": "npm run clean && npm test && npm run build",
1713
"test": "jest"
@@ -20,13 +16,7 @@
2016
"preset": "ts-jest",
2117
"testEnvironment": "node"
2218
},
23-
"keywords": [
24-
"tsx",
25-
"typescript",
26-
"jsx",
27-
"dom",
28-
"createElement"
29-
],
19+
"keywords": ["tsx", "typescript", "jsx", "dom", "createElement"],
3020
"author": "Daniel Perez Alvarez <[email protected]>",
3121
"license": "ISC",
3222
"devDependencies": {

index.ts renamed to src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="global.d.ts" />
1+
/// <reference path="../global.d.ts" />
22

33
export type Properties<P> = P & { children?: any; ref?: JSX.Reference };
44
export interface FunctionElement<P> {

test.tsx renamed to src/test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* @jsx createElement */
12
import { createElement } from "./index";
23

34
class Element {

tsconfig-build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./dist",
5+
"rootDir": "./src"
6+
},
7+
"exclude": ["src/test.tsx"]
8+
}

tsconfig.json

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,15 @@
11
{
22
"compilerOptions": {
33
"jsx": "react",
4-
"jsxFactory": "createElement",
5-
/* Basic Options */
6-
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
7-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
8-
"lib": ["es2015", "dom"], /* Specify library files to be included in the compilation. */
9-
// "allowJs": true, /* Allow javascript files to be compiled. */
10-
// "checkJs": true, /* Report errors in .js files. */
11-
"declaration": true, /* Generates corresponding '.d.ts' file. */
12-
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
13-
// "sourceMap": true, /* Generates corresponding '.map' file. */
14-
// "outFile": "./", /* Concatenate and emit output to single file. */
15-
// "outDir": "./", /* Redirect output structure to the directory. */
16-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
17-
// "composite": true, /* Enable project compilation */
18-
// "removeComments": true, /* Do not emit comments to output. */
19-
// "noEmit": true, /* Do not emit outputs. */
20-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
21-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
22-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
234

24-
/* Strict Type-Checking Options */
25-
"strict": true, /* Enable all strict type-checking options. */
26-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
27-
// "strictNullChecks": true, /* Enable strict null checks. */
28-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
29-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
30-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
31-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
32-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
5+
"target": "es5",
6+
"module": "commonjs",
7+
"lib": ["es2015", "dom"],
338

34-
/* Additional Checks */
35-
// "noUnusedLocals": true, /* Report errors on unused locals. */
36-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
37-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
38-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
9+
"declaration": true,
3910

40-
/* Module Resolution Options */
41-
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
42-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
43-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
44-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
45-
// "typeRoots": [], /* List of folders to include type definitions from. */
46-
// "types": [], /* Type declaration files to be included in compilation. */
47-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
48-
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
49-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
11+
"strict": true,
5012

51-
/* Source Map Options */
52-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
53-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
54-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
55-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
56-
57-
/* Experimental Options */
58-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
59-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
13+
"esModuleInterop": true
6014
}
6115
}

0 commit comments

Comments
 (0)