From c8cfcd7672add077ae121d4edcf4a79a7f6252a5 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 19:56:33 +0900 Subject: [PATCH 01/11] Feature/set up core (#1) --- .eslintrc.json | 3 +- package.json | 3 + package/conev-core/.eslintignore | 4 + package/conev-core/.eslintrc.json | 5 + package/conev-core/.gitignore | 112 ++++++++++++++++++ package/conev-core/gulpfile.js | 19 +++ package/conev-core/package.json | 46 +++++++ package/conev-core/src/config-builder.spec.ts | 41 +++++++ package/conev-core/src/config-builder.ts | 33 ++++++ package/conev-core/src/config.spec.ts | 38 ++++++ package/conev-core/src/config.ts | 48 ++++++++ package/conev-core/src/index.ts | 8 ++ package/conev-core/src/source.mock.ts | 13 ++ package/conev-core/src/sources.spec.ts | 63 ++++++++++ package/conev-core/src/sources.ts | 47 ++++++++ package/conev-core/tsconfig.json | 92 ++++++++++++++ package/conev-core/tsconfig.production.json | 4 + src/index.ts | 1 + 18 files changed, 579 insertions(+), 1 deletion(-) create mode 100644 package/conev-core/.eslintignore create mode 100644 package/conev-core/.eslintrc.json create mode 100644 package/conev-core/.gitignore create mode 100644 package/conev-core/gulpfile.js create mode 100644 package/conev-core/package.json create mode 100644 package/conev-core/src/config-builder.spec.ts create mode 100644 package/conev-core/src/config-builder.ts create mode 100644 package/conev-core/src/config.spec.ts create mode 100644 package/conev-core/src/config.ts create mode 100644 package/conev-core/src/index.ts create mode 100644 package/conev-core/src/source.mock.ts create mode 100644 package/conev-core/src/sources.spec.ts create mode 100644 package/conev-core/src/sources.ts create mode 100644 package/conev-core/tsconfig.json create mode 100644 package/conev-core/tsconfig.production.json diff --git a/.eslintrc.json b/.eslintrc.json index c8ac167..234989a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,7 +16,8 @@ "ecmaVersion": 12, "sourceType": "module", "project": [ - "tsconfig.json" + "tsconfig.json", + "package/conev-core/tsconfig.json" ] }, "plugins": [ diff --git a/package.json b/package.json index 0e906f0..27dd643 100644 --- a/package.json +++ b/package.json @@ -80,5 +80,8 @@ "prettier": "^2.1.1", "ts-jest": "^26.3.0", "typescript": "^4.0.2" + }, + "dependencies": { + "conev-core": "file:package/conev-core" } } diff --git a/package/conev-core/.eslintignore b/package/conev-core/.eslintignore new file mode 100644 index 0000000..240a9e8 --- /dev/null +++ b/package/conev-core/.eslintignore @@ -0,0 +1,4 @@ +script +node_modules +dist +gulpfile.js diff --git a/package/conev-core/.eslintrc.json b/package/conev-core/.eslintrc.json new file mode 100644 index 0000000..128cd29 --- /dev/null +++ b/package/conev-core/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "../../.eslintrc.json" + ] +} diff --git a/package/conev-core/.gitignore b/package/conev-core/.gitignore new file mode 100644 index 0000000..f488977 --- /dev/null +++ b/package/conev-core/.gitignore @@ -0,0 +1,112 @@ +# Logs +old/logs +*.log +*.log.* +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc tests coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +package-lock.json +/storage/ +mongodb-binaries/ +/profiling/ +/.vscode/ +.idea diff --git a/package/conev-core/gulpfile.js b/package/conev-core/gulpfile.js new file mode 100644 index 0000000..6ef79c8 --- /dev/null +++ b/package/conev-core/gulpfile.js @@ -0,0 +1,19 @@ +const gulp = require('gulp'); +const ts = require('gulp-typescript'); + +function getTsconfig(env) { + if (env != null) { + return `tsconfig.${env.toLowerCase()}.json`; + } + + return 'tsconfig.json'; +} + +const tsProject = ts.createProject(getTsconfig(process.env.NODE_ENV)); + +const outDir = 'dist' + +gulp.task('default', () => tsProject.src() + .pipe(tsProject()) + .pipe(gulp.dest(outDir)) +); diff --git a/package/conev-core/package.json b/package/conev-core/package.json new file mode 100644 index 0000000..79dfb42 --- /dev/null +++ b/package/conev-core/package.json @@ -0,0 +1,46 @@ +{ + "name": "conev-core", + "version": "1.0.0", + "description": "", + "main": "dist/index.js", + "scripts": { + "test": "jest", + "run": "node dist/index.js", + "build": "gulp", + "build:production": "cross-env NODE_ENV=production npm run build", + "install": "npm run build:production" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "@types/jest": "^26.0.10", + "@types/node": "^14.6.2", + "cross-env": "^7.0.2", + "gulp": "^4.0.2", + "gulp-typescript": "^6.0.0-alpha.1", + "jest": "^26.4.2", + "ts-jest": "^26.3.0", + "typescript": "^4.0.2" + }, + "jest": { + "transform": { + "^.+\\.ts$": "ts-jest" + }, + "testRegex": "\\.spec\\.ts$", + "moduleFileExtensions": [ + "ts", + "js" + ], + "modulePathIgnorePatterns": [ + "dist" + ], + "globals": { + "ts-jest": { + "diagnostics": true + } + } + }, + "dependencies": { + "deepmerge": "^4.2.2" + } +} diff --git a/package/conev-core/src/config-builder.spec.ts b/package/conev-core/src/config-builder.spec.ts new file mode 100644 index 0000000..01f22ac --- /dev/null +++ b/package/conev-core/src/config-builder.spec.ts @@ -0,0 +1,41 @@ +import ConfigBuilder from './config-builder'; +import SourceMock from './source.mock'; + +describe('config-builder', () => { + const source1 = new SourceMock( + new Map>([ + ['default', { source: '1', port: 3000, db: { type: 'postgres' } }], + ['develop', { env: 'develop', port: 3001 }], + ]) + ); + + const source2 = new SourceMock( + new Map>([ + [ + 'default', + { + source: '2', + port: 3000, + db: { port: 7070, username: 'test', type: 'mysql' }, + }, + ], + ['production', { env: 'production', port: 3002 }], + ]) + ); + + test('build', () => { + const config = new ConfigBuilder() + .addSource(source1, source2) + .addEnv('default', 'develop') + .build(); + + expect(config.get()).toEqual({ + source: '2', + env: 'develop', + port: 3001, + db: { port: 7070, username: 'test', type: 'mysql' }, + }); + expect(config.get('source')).toEqual('2'); + expect(config.get('db.port')).toEqual(7070); + }); +}); diff --git a/package/conev-core/src/config-builder.ts b/package/conev-core/src/config-builder.ts new file mode 100644 index 0000000..75b6ecf --- /dev/null +++ b/package/conev-core/src/config-builder.ts @@ -0,0 +1,33 @@ +import { Options } from 'deepmerge'; +import { Source } from './sources'; +import Config from './config'; + +export default class ConfigBuilder { + private readonly sources: Source[] = []; + + private readonly envs: string[] = []; + + private options?: Options; + + addSource(...sources: Source[]): ConfigBuilder { + this.sources.push(...sources); + + return this; + } + + addEnv(...envs: string[]): ConfigBuilder { + this.envs.push(...envs); + + return this; + } + + setOptions(options?: Options): ConfigBuilder { + this.options = options; + + return this; + } + + build(): Config { + return new Config(this.sources, this.envs, this.options); + } +} diff --git a/package/conev-core/src/config.spec.ts b/package/conev-core/src/config.spec.ts new file mode 100644 index 0000000..c81a8e8 --- /dev/null +++ b/package/conev-core/src/config.spec.ts @@ -0,0 +1,38 @@ +import Config from './config'; +import SourceMock from './source.mock'; + +describe('config', () => { + const source1 = new SourceMock( + new Map>([ + ['default', { source: '1', port: 3000, db: { type: 'postgres' } }], + ['develop', { env: 'develop', port: 3001 }], + ]) + ); + + const source2 = new SourceMock( + new Map>([ + [ + 'default', + { + source: '2', + port: 3000, + db: { port: 7070, username: 'test', type: 'mysql' }, + }, + ], + ['production', { env: 'production', port: 3002 }], + ]) + ); + + test('get', () => { + const config = new Config([source1, source2], ['default', 'develop']); + + expect(config.get()).toEqual({ + source: '2', + env: 'develop', + port: 3001, + db: { port: 7070, username: 'test', type: 'mysql' }, + }); + expect(config.get('source')).toEqual('2'); + expect(config.get('db.port')).toEqual(7070); + }); +}); diff --git a/package/conev-core/src/config.ts b/package/conev-core/src/config.ts new file mode 100644 index 0000000..8c22f6b --- /dev/null +++ b/package/conev-core/src/config.ts @@ -0,0 +1,48 @@ +import merge, { Options } from 'deepmerge'; +import Sources, { Source } from './sources'; + +export default class Config { + private readonly sources: Sources; + + private readonly options?: Options; + + private readonly envs: string[]; + + private values: Record | null; + + constructor(sources: Source[], envs: string[], options?: Options) { + this.sources = new Sources(sources, options); + this.envs = envs; + this.options = options; + this.values = null; + + this.sync(); + } + + sync(): Config { + const source = this.sources.export(); + const configs = this.envs + .map((env) => source.get(env)) + .filter((value) => value != null) as Record[]; + + this.values = merge.all(configs, this.options) as Record; + + return this; + } + + get(key = ''): unknown | null { + const tokens: string[] = key.split('.').reverse(); + + let current: any = this.values; + for ( + let token = tokens.pop(); + token != null && token.length > 0; + token = tokens.pop() + ) { + if (current == null) return null; + current = current[token]; + } + + return current; + } +} diff --git a/package/conev-core/src/index.ts b/package/conev-core/src/index.ts new file mode 100644 index 0000000..7882995 --- /dev/null +++ b/package/conev-core/src/index.ts @@ -0,0 +1,8 @@ +import ConfigBuilder from './config-builder'; + +export { Options } from 'deepmerge'; +export { Source } from './sources'; +export { default as Config } from './config'; +export { default as ConfigBuilder } from './config-builder'; + +export default ConfigBuilder; diff --git a/package/conev-core/src/source.mock.ts b/package/conev-core/src/source.mock.ts new file mode 100644 index 0000000..469bc96 --- /dev/null +++ b/package/conev-core/src/source.mock.ts @@ -0,0 +1,13 @@ +import { Source } from './sources'; + +export default class SourceMock implements Source { + private readonly map: Map>; + + constructor(map: Map>) { + this.map = map; + } + + export(): Map> { + return this.map; + } +} diff --git a/package/conev-core/src/sources.spec.ts b/package/conev-core/src/sources.spec.ts new file mode 100644 index 0000000..5316707 --- /dev/null +++ b/package/conev-core/src/sources.spec.ts @@ -0,0 +1,63 @@ +import Sources from './sources'; +import SourceMock from './source.mock'; + +describe('sources', () => { + const source1 = new SourceMock( + new Map>([ + ['default', { source: '1', port: 3000 }], + ['develop', { env: 'develop', port: 3001 }], + ]) + ); + + const source2 = new SourceMock( + new Map>([ + ['default', { source: '2', port: 3000, db: 'postgres' }], + ['production', { env: 'production', port: 3002 }], + ]) + ); + + test('export', () => { + const sources = new Sources([source1, source2]); + const config = sources.export(); + + expect(config.get('default')).toEqual({ + source: '2', + port: 3000, + db: 'postgres', + }); + + expect(config.get('develop')).toEqual({ + env: 'develop', + port: 3001, + }); + + expect(config.get('production')).toEqual({ + env: 'production', + port: 3002, + }); + }); + + test('add', () => { + const sources = new Sources([]); + + sources.add(source1).add(source2); + + const config = sources.export(); + + expect(config.get('default')).toEqual({ + source: '2', + port: 3000, + db: 'postgres', + }); + + expect(config.get('develop')).toEqual({ + env: 'develop', + port: 3001, + }); + + expect(config.get('production')).toEqual({ + env: 'production', + port: 3002, + }); + }); +}); diff --git a/package/conev-core/src/sources.ts b/package/conev-core/src/sources.ts new file mode 100644 index 0000000..618a1f5 --- /dev/null +++ b/package/conev-core/src/sources.ts @@ -0,0 +1,47 @@ +import merge, { Options } from 'deepmerge'; + +export interface Source { + export(): Map>; +} + +export class Sources implements Source { + private readonly sources: Source[]; + + private readonly options?: Options; + + constructor(sources: Source[], options?: Options) { + this.sources = sources; + this.options = options; + } + + add(source: Source, priority = -1): Sources { + if (priority === -1) this.sources.push(source); + else this.sources.splice(priority, 0, source); + + return this; + } + + export(): Map> { + const configs = this.sources.map((source) => source.export()); + const mergedConfig = new Map[]>(); + + configs.forEach((config) => { + config.forEach((value, key) => { + if (!mergedConfig.get(key)) mergedConfig.set(key, []); + mergedConfig.get(key)?.push(value); + }); + }); + + const config = new Map>(); + mergedConfig.forEach((value, key) => { + config.set( + key, + merge.all(value, this.options) as Record + ); + }); + + return config; + } +} + +export default Sources; diff --git a/package/conev-core/tsconfig.json b/package/conev-core/tsconfig.json new file mode 100644 index 0000000..0bc9841 --- /dev/null +++ b/package/conev-core/tsconfig.json @@ -0,0 +1,92 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es6", + /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ + "module": "commonjs", + /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "lib": [ + "es2017", + "dom" + ], + /* Specify library files to be included in the compilation. */ + "allowJs": true, + /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": true, + /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "dist", + /* Redirect output structure to the directory. */ + "rootDir": "src", + /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true, + /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, + /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + "experimentalDecorators": true, + /* Enables experimental support for ES7 decorators. */ + "emitDecoratorMetadata": true, + /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + "skipLibCheck": true, + /* Skip type checking of declaration files. */ + "forceConsistentCasingInFileNames": true + /* Disallow inconsistently-cased references to the same file. */ + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/package/conev-core/tsconfig.production.json b/package/conev-core/tsconfig.production.json new file mode 100644 index 0000000..8b9de50 --- /dev/null +++ b/package/conev-core/tsconfig.production.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["*/**/*.test.ts", "*/**/*.spec.ts", "*/**/*.mock.ts"] +} diff --git a/src/index.ts b/src/index.ts index e69de29..91d3328 100644 --- a/src/index.ts +++ b/src/index.ts @@ -0,0 +1 @@ +export * from 'conev-core'; From f3b8f68332001af76d46a35f2b422008c1aea951 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 20:03:48 +0900 Subject: [PATCH 02/11] Feature/set_up_ci (#20) --- .github/workflows/test.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6143f7f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: Test CI + +on: + push: + branches: + - '**' + - '!master' + - '!develop' + - '!release' + - '!hotfix/*' + pull_request: + branches: + - '**' + - '!master' + - '!develop' + - '!release' + - '!hotfix/*' + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - name: Checkout source code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm run all:install + - name: Build + run: npm run all:build:production + - name: Test + run: npm run test From a575cf54898f14acdecdf8382056faa36d3479f5 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 20:12:53 +0900 Subject: [PATCH 03/11] feature/fix_ci (#21) --- .github/workflows/test.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6143f7f..da85ee9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,18 +3,14 @@ name: Test CI on: push: branches: - - '**' - - '!master' - - '!develop' - - '!release' - - '!hotfix/*' + - 'master' + - 'develop' + - 'release' pull_request: branches: - - '**' - - '!master' - - '!develop' - - '!release' - - '!hotfix/*' + - 'master' + - 'develop' + - 'release' jobs: build: From f3ca08711c8f8ec381fecbcb3dad37f34f920b4c Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 20:37:56 +0900 Subject: [PATCH 04/11] feature/add_lint_in_ci (#22) --- .github/workflows/test.yml | 2 ++ package.json | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da85ee9..5a15080 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,8 @@ jobs: node-version: ${{ matrix.node-version }} - name: Install dependencies run: npm run all:install + - name: Lint + run: npm run lint - name: Build run: npm run all:build:production - name: Test diff --git a/package.json b/package.json index 0e906f0..1902d5a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build:production": "cross-env NODE_ENV=production npm run build", "build": "gulp", "neon": "neon", - "lint": "eslint --fix . --resolve-plugins-relative-to .", + "lint": "eslint . --resolve-plugins-relative-to .", + "lint:fix": "eslint --fix . --resolve-plugins-relative-to .", "lint:staged": "lint-staged", "test": "jest", "package:init": "script/init-package.sh package", @@ -19,7 +20,7 @@ "all:install": "script/run-command-all-package.sh install", "all:build": "script/run-command-all-package.sh run build", "all:build:production": "script/run-command-all-package.sh run build:production", - "prepublish": "npm run all:build:production && npm run test" + "prepublish": "npm run all:build:production" }, "repository": { "type": "git", From e645849fdca0f35518ebab8dd7938aebb7458069 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 21:28:06 +0900 Subject: [PATCH 05/11] feature/fix_lgmt_warn (#24) --- script/copy-package-element.js | 2 +- script/extend-eslint.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/copy-package-element.js b/script/copy-package-element.js index a73a3bb..a82e932 100644 --- a/script/copy-package-element.js +++ b/script/copy-package-element.js @@ -33,7 +33,7 @@ while (tokens.length > 1) { process.exit(1); } if (target[token] == null) { - target[token] = {} + target[token] = {}; } source = source[token]; diff --git a/script/extend-eslint.js b/script/extend-eslint.js index 7e4a8b9..1914b67 100644 --- a/script/extend-eslint.js +++ b/script/extend-eslint.js @@ -19,6 +19,6 @@ const eslintrc = { extends: [ `${diff}/.eslintrc.json` ] -} +}; fs.writeFileSync(`${packagePath}/.eslintrc.json`, JSON.stringify(eslintrc, null, 2) + '\n'); From 7f0d3a757c216a52aaffd7f35395f251d2fad437 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 21:56:56 +0900 Subject: [PATCH 06/11] feature/fix lint error (#23) --- .eslintrc.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c8ac167..7eb3c60 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,11 +5,11 @@ "jest": true }, "extends": [ + "airbnb-typescript/base", "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended", - "prettier/@typescript-eslint", - "airbnb-base" + "prettier/@typescript-eslint" ], "parser": "@typescript-eslint/parser", "parserOptions": { diff --git a/package.json b/package.json index 1902d5a..902f7fb 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ } }, "lint-staged": { - "src/*.{js,ts}": [ + "*.{js,ts}": [ "eslint --fix" ] }, @@ -68,7 +68,7 @@ "@typescript-eslint/parser": "^3.10.1", "cross-env": "^7.0.2", "eslint": "^7.7.0", - "eslint-config-airbnb-base": "^14.2.0", + "eslint-config-airbnb-typescript": "^9.0.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-prettier": "^3.1.4", From c8e71bd29bfe8f68aca7f08303a9e289561435a1 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 22:16:40 +0900 Subject: [PATCH 07/11] feature/fix-lint-error (#3) --- .../conev-core/src/{ => config}/config-builder.spec.ts | 2 +- package/conev-core/src/{ => config}/config-builder.ts | 2 +- package/conev-core/src/{ => config}/config.spec.ts | 2 +- package/conev-core/src/{ => config}/config.ts | 3 ++- package/conev-core/src/index.ts | 9 +++++---- package/conev-core/src/{ => source}/source.mock.ts | 2 +- package/conev-core/src/source/source.ts | 5 +++++ package/conev-core/src/{ => source}/sources.spec.ts | 0 package/conev-core/src/{ => source}/sources.ts | 7 ++----- 9 files changed, 18 insertions(+), 14 deletions(-) rename package/conev-core/src/{ => config}/config-builder.spec.ts (95%) rename package/conev-core/src/{ => config}/config-builder.ts (94%) rename package/conev-core/src/{ => config}/config.spec.ts (95%) rename package/conev-core/src/{ => config}/config.ts (93%) rename package/conev-core/src/{ => source}/source.mock.ts (88%) create mode 100644 package/conev-core/src/source/source.ts rename package/conev-core/src/{ => source}/sources.spec.ts (100%) rename package/conev-core/src/{ => source}/sources.ts (89%) diff --git a/package/conev-core/src/config-builder.spec.ts b/package/conev-core/src/config/config-builder.spec.ts similarity index 95% rename from package/conev-core/src/config-builder.spec.ts rename to package/conev-core/src/config/config-builder.spec.ts index 01f22ac..3f7d603 100644 --- a/package/conev-core/src/config-builder.spec.ts +++ b/package/conev-core/src/config/config-builder.spec.ts @@ -1,5 +1,5 @@ import ConfigBuilder from './config-builder'; -import SourceMock from './source.mock'; +import SourceMock from '../source/source.mock'; describe('config-builder', () => { const source1 = new SourceMock( diff --git a/package/conev-core/src/config-builder.ts b/package/conev-core/src/config/config-builder.ts similarity index 94% rename from package/conev-core/src/config-builder.ts rename to package/conev-core/src/config/config-builder.ts index 75b6ecf..c7f651c 100644 --- a/package/conev-core/src/config-builder.ts +++ b/package/conev-core/src/config/config-builder.ts @@ -1,6 +1,6 @@ import { Options } from 'deepmerge'; -import { Source } from './sources'; import Config from './config'; +import Source from '../source/source'; export default class ConfigBuilder { private readonly sources: Source[] = []; diff --git a/package/conev-core/src/config.spec.ts b/package/conev-core/src/config/config.spec.ts similarity index 95% rename from package/conev-core/src/config.spec.ts rename to package/conev-core/src/config/config.spec.ts index c81a8e8..135246f 100644 --- a/package/conev-core/src/config.spec.ts +++ b/package/conev-core/src/config/config.spec.ts @@ -1,5 +1,5 @@ import Config from './config'; -import SourceMock from './source.mock'; +import SourceMock from '../source/source.mock'; describe('config', () => { const source1 = new SourceMock( diff --git a/package/conev-core/src/config.ts b/package/conev-core/src/config/config.ts similarity index 93% rename from package/conev-core/src/config.ts rename to package/conev-core/src/config/config.ts index 8c22f6b..d46d703 100644 --- a/package/conev-core/src/config.ts +++ b/package/conev-core/src/config/config.ts @@ -1,5 +1,6 @@ import merge, { Options } from 'deepmerge'; -import Sources, { Source } from './sources'; +import Sources from '../source/sources'; +import Source from '../source/source'; export default class Config { private readonly sources: Sources; diff --git a/package/conev-core/src/index.ts b/package/conev-core/src/index.ts index 7882995..19d3478 100644 --- a/package/conev-core/src/index.ts +++ b/package/conev-core/src/index.ts @@ -1,8 +1,9 @@ -import ConfigBuilder from './config-builder'; +import ConfigBuilder from './config/config-builder'; export { Options } from 'deepmerge'; -export { Source } from './sources'; -export { default as Config } from './config'; -export { default as ConfigBuilder } from './config-builder'; +export { default as Sources } from './source/sources'; +export { default as Source } from './source/source'; +export { default as Config } from './config/config'; +export { default as ConfigBuilder } from './config/config-builder'; export default ConfigBuilder; diff --git a/package/conev-core/src/source.mock.ts b/package/conev-core/src/source/source.mock.ts similarity index 88% rename from package/conev-core/src/source.mock.ts rename to package/conev-core/src/source/source.mock.ts index 469bc96..c15c9fe 100644 --- a/package/conev-core/src/source.mock.ts +++ b/package/conev-core/src/source/source.mock.ts @@ -1,4 +1,4 @@ -import { Source } from './sources'; +import Source from './source'; export default class SourceMock implements Source { private readonly map: Map>; diff --git a/package/conev-core/src/source/source.ts b/package/conev-core/src/source/source.ts new file mode 100644 index 0000000..c3dcba0 --- /dev/null +++ b/package/conev-core/src/source/source.ts @@ -0,0 +1,5 @@ +interface Source { + export(): Map>; +} + +export default Source; diff --git a/package/conev-core/src/sources.spec.ts b/package/conev-core/src/source/sources.spec.ts similarity index 100% rename from package/conev-core/src/sources.spec.ts rename to package/conev-core/src/source/sources.spec.ts diff --git a/package/conev-core/src/sources.ts b/package/conev-core/src/source/sources.ts similarity index 89% rename from package/conev-core/src/sources.ts rename to package/conev-core/src/source/sources.ts index 618a1f5..77733b4 100644 --- a/package/conev-core/src/sources.ts +++ b/package/conev-core/src/source/sources.ts @@ -1,10 +1,7 @@ import merge, { Options } from 'deepmerge'; +import Source from './source'; -export interface Source { - export(): Map>; -} - -export class Sources implements Source { +class Sources implements Source { private readonly sources: Source[]; private readonly options?: Options; From 1bdc7ce03065b5a88109f7dbb2d8337ac8c2fe70 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 22:22:23 +0900 Subject: [PATCH 08/11] feature/optimize_install (#25) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a15080..521b8c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Install dependencies - run: npm run all:install + run: npm install - name: Lint run: npm run lint - name: Build From 470c11ded66eae9532b98d8e86cca31c6f80730b Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 22:42:59 +0900 Subject: [PATCH 09/11] feature/fix_git_add_error (#26) --- script/init-neon-package.sh | 11 ++++++----- script/init-package.sh | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/script/init-neon-package.sh b/script/init-neon-package.sh index 81b2223..0f043f5 100755 --- a/script/init-neon-package.sh +++ b/script/init-neon-package.sh @@ -52,6 +52,12 @@ sh ${scriptPath}/sync-package.sh ${templatePath}/neon ${package} ${scriptPath} echo "πŸŽ‰ Finish to update package.json" +# npm ignore +cp ${rootPackage}/.npmignore ${package} + +echo "πŸŽ‰ Finish to copy npm ignore" + + # git add git add . @@ -59,11 +65,6 @@ cat ${rootPackage}/.gitignore >> ${package}/.gitignore echo "πŸŽ‰ Finish to add git file" -# npm ignore -cp ${rootPackage}/.npmignore ${package} - -echo "πŸŽ‰ Finish to copy npm ignore" - # package μ„€μΉ˜ cd ${rootPackage} npm install ${package} diff --git a/script/init-package.sh b/script/init-package.sh index dc47015..3400e8e 100755 --- a/script/init-package.sh +++ b/script/init-package.sh @@ -60,17 +60,17 @@ touch src/index.ts echo "πŸŽ‰ Finish to create default file" +# npm ignore +cp ${rootPackage}/.npmignore ${package} + +echo "πŸŽ‰ Finish to copy npm ignore" + # git add cp ${rootPackage}/.gitignore ${package} git add . echo "πŸŽ‰ Finish to add git file" -# npm ignore -cp ${rootPackage}/.npmignore ${package} - -echo "πŸŽ‰ Finish to copy npm ignore" - # package μ„€μΉ˜ cd ${rootPackage} npm install ${package} From 4768bb6d99f1eb7270e0b05658bd5fa12c3f54b0 Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 23:03:57 +0900 Subject: [PATCH 10/11] Feature/json source (#4) --- .eslintrc.json | 3 +- package.json | 7 +- package/conev-json-source/.eslintignore | 4 + package/conev-json-source/.eslintrc.json | 5 + package/conev-json-source/.gitignore | 112 ++++++++++++++++++ package/conev-json-source/.npmignore | 4 + package/conev-json-source/gulpfile.js | 19 +++ package/conev-json-source/package.json | 43 +++++++ package/conev-json-source/src/index.ts | 3 + .../conev-json-source/src/json-source.spec.ts | 16 +++ package/conev-json-source/src/json-source.ts | 17 +++ package/conev-json-source/tsconfig.json | 92 ++++++++++++++ .../tsconfig.production.json | 4 + src/index.ts | 1 + 14 files changed, 326 insertions(+), 4 deletions(-) create mode 100644 package/conev-json-source/.eslintignore create mode 100644 package/conev-json-source/.eslintrc.json create mode 100644 package/conev-json-source/.gitignore create mode 100644 package/conev-json-source/.npmignore create mode 100644 package/conev-json-source/gulpfile.js create mode 100644 package/conev-json-source/package.json create mode 100644 package/conev-json-source/src/index.ts create mode 100644 package/conev-json-source/src/json-source.spec.ts create mode 100644 package/conev-json-source/src/json-source.ts create mode 100644 package/conev-json-source/tsconfig.json create mode 100644 package/conev-json-source/tsconfig.production.json diff --git a/.eslintrc.json b/.eslintrc.json index ec938a2..94d09d3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -17,7 +17,8 @@ "sourceType": "module", "project": [ "tsconfig.json", - "package/conev-core/tsconfig.json" + "package/conev-core/tsconfig.json", + "package/conev-json-source/tsconfig.json" ] }, "plugins": [ diff --git a/package.json b/package.json index a1da589..005afd0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "design-system", + "name": "conev-sync", "version": "1.0.0", "description": "", "main": "dist/index.js", @@ -13,7 +13,7 @@ "lint:staged": "lint-staged", "test": "jest", "package:init": "script/init-package.sh package", - "package:sync": "script/sync-package.sh package", + "package:snpync": "script/sync-package.sh package", "package:neon:init": "script/init-neon-package.sh package", "tsc:init": "tsc --init", "eslint": "eslint", @@ -83,6 +83,7 @@ "typescript": "^4.0.2" }, "dependencies": { - "conev-core": "file:package/conev-core" + "conev-core": "file:package/conev-core", + "conev-json-source": "file:package/conev-json-source" } } diff --git a/package/conev-json-source/.eslintignore b/package/conev-json-source/.eslintignore new file mode 100644 index 0000000..240a9e8 --- /dev/null +++ b/package/conev-json-source/.eslintignore @@ -0,0 +1,4 @@ +script +node_modules +dist +gulpfile.js diff --git a/package/conev-json-source/.eslintrc.json b/package/conev-json-source/.eslintrc.json new file mode 100644 index 0000000..128cd29 --- /dev/null +++ b/package/conev-json-source/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "../../.eslintrc.json" + ] +} diff --git a/package/conev-json-source/.gitignore b/package/conev-json-source/.gitignore new file mode 100644 index 0000000..f488977 --- /dev/null +++ b/package/conev-json-source/.gitignore @@ -0,0 +1,112 @@ +# Logs +old/logs +*.log +*.log.* +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc tests coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +package-lock.json +/storage/ +mongodb-binaries/ +/profiling/ +/.vscode/ +.idea diff --git a/package/conev-json-source/.npmignore b/package/conev-json-source/.npmignore new file mode 100644 index 0000000..74949bc --- /dev/null +++ b/package/conev-json-source/.npmignore @@ -0,0 +1,4 @@ +src +script +template +.github diff --git a/package/conev-json-source/gulpfile.js b/package/conev-json-source/gulpfile.js new file mode 100644 index 0000000..6ef79c8 --- /dev/null +++ b/package/conev-json-source/gulpfile.js @@ -0,0 +1,19 @@ +const gulp = require('gulp'); +const ts = require('gulp-typescript'); + +function getTsconfig(env) { + if (env != null) { + return `tsconfig.${env.toLowerCase()}.json`; + } + + return 'tsconfig.json'; +} + +const tsProject = ts.createProject(getTsconfig(process.env.NODE_ENV)); + +const outDir = 'dist' + +gulp.task('default', () => tsProject.src() + .pipe(tsProject()) + .pipe(gulp.dest(outDir)) +); diff --git a/package/conev-json-source/package.json b/package/conev-json-source/package.json new file mode 100644 index 0000000..9fbbd34 --- /dev/null +++ b/package/conev-json-source/package.json @@ -0,0 +1,43 @@ +{ + "name": "conev-json-source", + "version": "1.0.0", + "description": "", + "main": "dist/index.js", + "scripts": { + "test": "jest", + "run": "node dist/index.js", + "build": "gulp", + "build:production": "cross-env NODE_ENV=production npm run build", + "install": "npm run build:production" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "@types/jest": "^26.0.10", + "@types/node": "^14.6.2", + "cross-env": "^7.0.2", + "gulp": "^4.0.2", + "gulp-typescript": "^6.0.0-alpha.1", + "jest": "^26.4.2", + "ts-jest": "^26.3.0", + "typescript": "^4.0.2" + }, + "jest": { + "transform": { + "^.+\\.ts$": "ts-jest" + }, + "testRegex": "\\.spec\\.ts$", + "moduleFileExtensions": [ + "ts", + "js" + ], + "modulePathIgnorePatterns": [ + "dist" + ], + "globals": { + "ts-jest": { + "diagnostics": true + } + } + } +} diff --git a/package/conev-json-source/src/index.ts b/package/conev-json-source/src/index.ts new file mode 100644 index 0000000..3c1d1cd --- /dev/null +++ b/package/conev-json-source/src/index.ts @@ -0,0 +1,3 @@ +import JsonSource from './json-source'; + +export default JsonSource; diff --git a/package/conev-json-source/src/json-source.spec.ts b/package/conev-json-source/src/json-source.spec.ts new file mode 100644 index 0000000..6a4fa00 --- /dev/null +++ b/package/conev-json-source/src/json-source.spec.ts @@ -0,0 +1,16 @@ +import JsonSource from './json-source'; + +describe('json-source', () => { + test('export', () => { + const defaultConfig = { source: '1', port: 3000 }; + const developConfig = { env: 'develop', port: 3001 }; + + const source = new JsonSource(); + source.set('default', defaultConfig); + source.set('develop', developConfig); + + const config = source.export(); + expect(config.get('default')).toEqual(defaultConfig); + expect(config.get('develop')).toEqual(developConfig); + }); +}); diff --git a/package/conev-json-source/src/json-source.ts b/package/conev-json-source/src/json-source.ts new file mode 100644 index 0000000..6d70ac3 --- /dev/null +++ b/package/conev-json-source/src/json-source.ts @@ -0,0 +1,17 @@ +export default class JsonSource { + private readonly jsons: Map>; + + constructor() { + this.jsons = new Map>(); + } + + set(env: string, json: Record): JsonSource { + this.jsons.set(env, json); + + return this; + } + + export(): Map> { + return this.jsons; + } +} diff --git a/package/conev-json-source/tsconfig.json b/package/conev-json-source/tsconfig.json new file mode 100644 index 0000000..0bc9841 --- /dev/null +++ b/package/conev-json-source/tsconfig.json @@ -0,0 +1,92 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es6", + /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ + "module": "commonjs", + /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "lib": [ + "es2017", + "dom" + ], + /* Specify library files to be included in the compilation. */ + "allowJs": true, + /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": true, + /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "dist", + /* Redirect output structure to the directory. */ + "rootDir": "src", + /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true, + /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, + /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + "experimentalDecorators": true, + /* Enables experimental support for ES7 decorators. */ + "emitDecoratorMetadata": true, + /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + "skipLibCheck": true, + /* Skip type checking of declaration files. */ + "forceConsistentCasingInFileNames": true + /* Disallow inconsistently-cased references to the same file. */ + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/package/conev-json-source/tsconfig.production.json b/package/conev-json-source/tsconfig.production.json new file mode 100644 index 0000000..8b9de50 --- /dev/null +++ b/package/conev-json-source/tsconfig.production.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["*/**/*.test.ts", "*/**/*.spec.ts", "*/**/*.mock.ts"] +} diff --git a/src/index.ts b/src/index.ts index 91d3328..d2e3974 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,2 @@ export * from 'conev-core'; +export { default as JsonSource } from 'conev-json-source'; From 7947215aecafcaea813ad9265dfe0e4e6baed8ff Mon Sep 17 00:00:00 2001 From: Ara Park Date: Sun, 30 Aug 2020 23:15:35 +0900 Subject: [PATCH 11/11] feature/change_project_name (#6) --- README.md | 2 +- package/conev-core/.npmignore | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 package/conev-core/.npmignore diff --git a/README.md b/README.md index 6a359a7..9921653 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# Design System \ No newline at end of file +# conev sync diff --git a/package/conev-core/.npmignore b/package/conev-core/.npmignore new file mode 100644 index 0000000..74949bc --- /dev/null +++ b/package/conev-core/.npmignore @@ -0,0 +1,4 @@ +src +script +template +.github