├── .gitignore ├── LICENSE ├── README.md ├── package.json ├── scripts ├── rollup.config.js └── rollup.config.legacy.js ├── src ├── component-library-module.ts └── index.ts ├── tsconfig.json ├── tsconfig.legacy.json └── tslint.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ionic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stencil-ds-angular-template 2 | 3 | ⚠️ This project has been archived. ⚠️ 4 | 5 | This project is no longer actively maintained. 6 | 7 | Please see the [Stencil documentation for using the Angular Framework Wrapper](https://stenciljs.com/docs/angular) for instructions as to how to use [`@stencil/angular-output-target`](https://www.npmjs.com/package/@stencil/angular-output-target) 8 | 9 | --- 10 | 11 | This is an example repo of building plugins. 12 | 13 | ## Step 1. 14 | 15 | - Update the `package.json` to have the correct package name for this repo. 16 | - Replace `component-library` under `dependencies` with your core stencil package name. 17 | 18 | ## Step 2. 19 | 20 | - Build your core stencil package. 21 | 22 | ## Step 3. 23 | 24 | - Update `src/component-library-module.ts`. 25 | - You will need to import all of your components from `./directives/proxies`. Currently the file states `DemoComponent` as the only import. This will be replaced with the entire list. 26 | - Then update the `DECLARATIONS` const array to also list out all of the component names. It also currently contains `DemoComponent` as the only item, but this will need to be replaced with the entire list. 27 | 28 | ## Step 4. 29 | 30 | - Run build on this package. 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "component-library-angular", 3 | "version": "0.0.1", 4 | "description": "", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/ionic-team/ionic.git" 9 | }, 10 | "scripts": { 11 | "build": "npm run build.ng", 12 | "build.fesm": "rollup --config ./scripts/rollup.config.js", 13 | "build.ng": "npm run build.es2015 && npm run build.es5", 14 | "build.es2015": "ngc -p tsconfig.json && rollup --config ./scripts/rollup.config.js", 15 | "build.es5": "ngc -p tsconfig.legacy.json && rollup --config ./scripts/rollup.config.legacy.js", 16 | "lint": "npm run lint.ts", 17 | "lint.ts": "tslint --project .", 18 | "lint.fix": "tslint --project . --fix", 19 | "prerelease": "npm run validate && np prerelease --yolo --any-branch --tag next", 20 | "test": "echo 'angular no tests yet'", 21 | "tsc": "tsc -p .", 22 | "validate": "npm i && npm run lint && npm run test && npm run build" 23 | }, 24 | "module": "dist/fesm5.js", 25 | "main": "dist/fesm5.js", 26 | "types": "dist/core.d.ts", 27 | "files": [ 28 | "dist/" 29 | ], 30 | "dependencies": { 31 | "component-library": "0.0.1", 32 | "tslib": "^1.9.3" 33 | }, 34 | "peerDependencies": { 35 | "@angular-devkit/core": "^7.2.1", 36 | "@angular-devkit/schematics": "^7.2.1", 37 | "@angular/core": "^7.2.1", 38 | "@angular/common": "^7.2.1", 39 | "@angular/forms": "^7.2.1", 40 | "@angular/router": "^7.2.1", 41 | "@angular/compiler": "^7.2.1", 42 | "@angular/compiler-cli": "^7.2.1", 43 | "@angular/platform-browser": "^7.2.1", 44 | "@angular/platform-browser-dynamic": "^7.2.1", 45 | "rxjs": ">=6.2.0", 46 | "zone.js": "^0.8.26" 47 | }, 48 | "devDependencies": { 49 | "@angular-devkit/core": "^7.2.1", 50 | "@angular-devkit/schematics": "^7.2.1", 51 | "@angular/common": "^7.2.1", 52 | "@angular/compiler": "^7.2.1", 53 | "@angular/compiler-cli": "^7.2.1", 54 | "@angular/core": "^7.2.1", 55 | "@angular/forms": "^7.2.1", 56 | "@angular/platform-browser": "^7.2.1", 57 | "@angular/platform-browser-dynamic": "^7.2.1", 58 | "@angular/router": "^7.2.1", 59 | "@types/node": "~10.12.0", 60 | "fs-extra": "^7.0.0", 61 | "glob": "^7.1.3", 62 | "rollup": "^1.1.2", 63 | "rollup-plugin-node-resolve": "^4.0.0", 64 | "rxjs": "^6.2.0", 65 | "tsickle": "^0.34.0", 66 | "tslint": "^5.12.1", 67 | "tslint-ionic-rules": "0.0.21", 68 | "typescript": "3.2.4", 69 | "zone.js": "^0.8.28" 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /scripts/rollup.config.js: -------------------------------------------------------------------------------- 1 | import resolve from 'rollup-plugin-node-resolve'; 2 | 3 | export default { 4 | input: 'build/es2015/core.js', 5 | output: { 6 | file: 'dist/fesm2015.js', 7 | format: 'es' 8 | }, 9 | external: (id) => { 10 | // inline @ionic/core deps 11 | if (id === '@ionic/core') { 12 | return false; 13 | } 14 | // anything else is external 15 | // Windows: C:\xxxxxx\xxx 16 | const colonPosition = 1; 17 | return !(id.startsWith('.') || id.startsWith('/') || id.charAt(colonPosition) === ':'); 18 | }, 19 | plugins: [ 20 | resolve({ 21 | module: true, 22 | }) 23 | ] 24 | }; 25 | -------------------------------------------------------------------------------- /scripts/rollup.config.legacy.js: -------------------------------------------------------------------------------- 1 | import config from './rollup.config'; 2 | 3 | const newConfig = { 4 | ...config, 5 | input: 'build/es5/core.js', 6 | }; 7 | newConfig.output.file = 'dist/fesm5.js'; 8 | 9 | export { newConfig as default }; 10 | -------------------------------------------------------------------------------- /src/component-library-module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { defineCustomElements } from "component-library/loader"; 3 | 4 | import { DemoComponent } from "./directives/proxies"; 5 | 6 | defineCustomElements(window); 7 | 8 | const DECLARATIONS = [ 9 | // proxies 10 | DemoComponent 11 | ]; 12 | 13 | @NgModule({ 14 | declarations: DECLARATIONS, 15 | exports: DECLARATIONS, 16 | imports: [], 17 | providers: [] 18 | }) 19 | export class ComponentLibraryModule {} 20 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | // DIRECTIVES 2 | export * from './directives/proxies'; 3 | 4 | // PACKAGE MODULE 5 | export { ComponentLibraryModule } from './component-library-module'; 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "angularCompilerOptions": { 3 | "annotateForClosureCompiler": true, 4 | "strictMetadataEmit": true, 5 | "flatModuleOutFile": "core.js", 6 | "flatModuleId": "@ionic/angular", 7 | "skipTemplateCodegen": true, 8 | "fullTemplateTypeCheck": false 9 | }, 10 | "compilerOptions": { 11 | "alwaysStrict": true, 12 | "strict": true, 13 | "allowSyntheticDefaultImports": true, 14 | "allowUnreachableCode": false, 15 | "declaration": true, 16 | "declarationDir": "dist", 17 | "experimentalDecorators": true, 18 | "forceConsistentCasingInFileNames": true, 19 | "lib": ["dom", "es2017"], 20 | "module": "es2015", 21 | "moduleResolution": "node", 22 | "noImplicitAny": true, 23 | "noImplicitReturns": true, 24 | "noUnusedLocals": false, 25 | "noUnusedParameters": false, 26 | "outDir": "build/es2015", 27 | "pretty": true, 28 | "removeComments": false, 29 | "importHelpers": true, 30 | "rootDir": "src", 31 | "strictPropertyInitialization": false, 32 | "target": "es2015" 33 | }, 34 | "exclude": ["node_modules"], 35 | "files": ["src/index.ts"] 36 | } 37 | -------------------------------------------------------------------------------- /tsconfig.legacy.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "target": "es5", 5 | "declarationDir": "build/es5", 6 | "outDir": "build/es5" 7 | } 8 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["tslint-ionic-rules/strict"], 3 | "linterOptions": { 4 | "exclude": [ 5 | "**/*.spec.ts", 6 | "**/*.spec.tsx" 7 | ] 8 | }, 9 | "rules": { 10 | "no-conditional-assignment": false, 11 | "no-non-null-assertion": false, 12 | "no-unnecessary-type-assertion": false, 13 | "no-import-side-effect": false, 14 | "trailing-comma": false, 15 | "no-null-keyword": false, 16 | "no-console": false, 17 | "no-unbound-method": true, 18 | "no-floating-promises": false, 19 | "no-invalid-template-strings": true, 20 | "ban-export-const-enum": true, 21 | 22 | "prefer-for-of": false 23 | } 24 | } --------------------------------------------------------------------------------