├── CHANGELOG.md ├── .eslintrc ├── .gitignore ├── index.js ├── .stylelintrc ├── package.json ├── LICENSE.md ├── .github └── workflows │ └── main.yml └── README.md /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.0.0 -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ "apostrophe" ] 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore MacOS X metadata forks (fusefs) 2 | ._* 3 | package-lock.json 4 | *.DS_Store 5 | node_modules 6 | 7 | # Never commit a CSS map file, anywhere 8 | *.css.map 9 | 10 | # vim swp files 11 | .*.sw* 12 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | module.exports = { 5 | bundle: { 6 | directory: 'modules', 7 | modules: getBundleModuleNames() 8 | } 9 | }; 10 | 11 | function getBundleModuleNames() { 12 | const source = path.join(__dirname, './modules/@apostrophecms'); 13 | return fs 14 | .readdirSync(source, { withFileTypes: true }) 15 | .filter(dirent => dirent.isDirectory()) 16 | .map(dirent => `@apostrophecms/${dirent.name}`); 17 | } 18 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-apostrophe", 3 | "rules": { 4 | "scale-unlimited/declaration-strict-value": null, 5 | "scss/at-import-partial-extension": null, 6 | "scss/at-mixin-named-arguments": null, 7 | "scss/dollar-variable-first-in-block": null, 8 | "scss/dollar-variable-pattern": null, 9 | "scss/selector-nest-combinators": null, 10 | "scss/no-duplicate-mixins": null, 11 | "property-no-vendor-prefix": [ 12 | true, 13 | { 14 | "ignoreProperties": ["appearance"] 15 | } 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@apostrophecms/module-template", 3 | "version": "1.0.0", 4 | "description": "A template for creating an ApostropheCMS 3 module.", 5 | "main": "index.js", 6 | "scripts": { 7 | "lint": "npm run eslint", 8 | "eslint": "eslint .", 9 | "test": "npm run lint" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/apostrophecms/module-template.git" 14 | }, 15 | "homepage": "https://github.com/apostrophecms/module-template#readme", 16 | "author": "Apostrophe Technologies", 17 | "license": "MIT", 18 | "devDependencies": { 19 | "eslint": "^7.9.0", 20 | "eslint-config-apostrophe": "^3.4.0", 21 | "eslint-config-standard": "^14.1.1", 22 | "eslint-plugin-import": "^2.22.0", 23 | "eslint-plugin-node": "^11.1.0", 24 | "eslint-plugin-promise": "^4.2.1", 25 | "eslint-plugin-standard": "^4.0.1", 26 | "stylelint": "^13.7.1", 27 | "stylelint-config-apostrophe": "^1.0.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Apostrophe Technologies 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: tests 4 | 5 | # Controls when the action will run. 6 | on: 7 | push: 8 | branches: [ "main" ] 9 | pull_request: 10 | branches: [ '*' ] 11 | 12 | # Allows you to run this workflow manually from the Actions tab 13 | workflow_dispatch: 14 | 15 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 16 | jobs: 17 | # This workflow contains a single job called "build" 18 | build: 19 | # The type of runner that the job will run on 20 | runs-on: ubuntu-latest 21 | strategy: 22 | matrix: 23 | node-version: [12, 14, 16] 24 | mongodb-version: [4.2, 4.4, 5.0] 25 | 26 | # Steps represent a sequence of tasks that will be executed as part of the job 27 | steps: 28 | - name: Git checkout 29 | uses: actions/checkout@v2 30 | 31 | - name: Use Node.js ${{ matrix.node-version }} 32 | uses: actions/setup-node@v1 33 | with: 34 | node-version: ${{ matrix.node-version }} 35 | 36 | - name: Start MongoDB 37 | uses: supercharge/mongodb-github-action@1.3.0 38 | with: 39 | mongodb-version: ${{ matrix.mongodb-version }} 40 | 41 | - run: npm install 42 | 43 | - run: npm test 44 | env: 45 | CI: true 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **TODO:** Update the badge URLs for the new module's repo. 2 | 3 |
22 | 23 | This module template serves as a starting point for new official Apostrophe modules. This is where you would describe what the purpose of the module is. 24 | 25 | ## Installation 26 | 27 | To install the module, use the command line to run this command in an Apostrophe project's root directory: 28 | 29 | ``` 30 | npm install @apostrophecms/module-template 31 | ``` 32 | 33 | ## Usage 34 | 35 | Configure the _______ module in the `app.js` file: 36 | 37 | ```javascript 38 | require('apostrophe')({ 39 | shortName: 'my-project', 40 | modules: { 41 | '@apostrophecms/module-template': {} 42 | } 43 | }); 44 | ``` 45 | 46 | ### Additional usage sections 47 | 48 | ### Pre-release checks 49 | 50 | - [ ] If the module does not include CSS, remove the Stylelint config file and dependency. 51 | - [ ] If any template includes a script with inline code, include the `nonce` attribute set like this: `