├── .editorconfig ├── .eleventy.js ├── .env.example ├── .github ├── FUNDING.yml └── workflows │ └── nodejs.yml ├── .gitignore ├── LICENSE ├── README.md ├── _data ├── articles.yaml ├── builtWith.yaml ├── commit.js ├── components.yaml ├── demos.yaml ├── podcasts.yaml ├── tools.yaml ├── tweets.yaml └── videos.yaml ├── _includes └── example.njk ├── _redirects ├── assets ├── editor.js ├── sharing.js └── tokenize.js ├── emails.json ├── package-lock.json ├── package.json ├── pages ├── benchmark-array-includes-vs-regex.html ├── details-open.html ├── fetch-data.html ├── index.njk ├── js-data-access.html ├── magic-properties-in-js.html ├── magic-property-on-this.html ├── newsletter.html ├── playground.html ├── pre-rendered-content.html ├── read-query-param.html ├── select-and-access.html ├── thank-you.html ├── write-query-param.html ├── x-data-access.html ├── x-for-n-times.html └── x-for-object.html ├── prettier.config.js └── scripts ├── config.js ├── load-newsletters.js └── new.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | # The JSON files contain newlines inconsistently 13 | [*.json] 14 | insert_final_newline = ignore 15 | 16 | [*.md] 17 | trim_trailing_whitespace = false 18 | 19 | -------------------------------------------------------------------------------- /.eleventy.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const yaml = require("js-yaml"); 3 | const esbuild = require("esbuild"); 4 | 5 | function bundle() { 6 | esbuild.buildSync({ 7 | entryPoints: ['./assets/editor.js'], 8 | bundle: true, 9 | outfile: './dist/editor.js', 10 | minify: process.env.NODE_ENV === 'production' 11 | }) 12 | } 13 | 14 | fs.mkdirSync('./dist', {recursive: true}); 15 | fs.copyFileSync('./node_modules/alpinejs/dist/alpine.js', './dist/alpine.js'); 16 | bundle() 17 | 18 | module.exports = function(eleventyConfig) { 19 | eleventyConfig.addDataExtension("yaml", contents => yaml.load(contents)); 20 | 21 | eleventyConfig.addWatchTarget("./assets"); 22 | eleventyConfig.addTransform('bundle', (content) => { 23 | bundle(); 24 | return content; 25 | }); 26 | 27 | return { 28 | templateFormats: [ 29 | "md", 30 | "njk", 31 | "html", 32 | // "liquid", 33 | "js" 34 | ], 35 | // markdownTemplateEngine: "liquid", 36 | htmlTemplateEngine: "njk", 37 | dataTemplateEngine: "njk", 38 | dir: { 39 | input: "./pages", 40 | includes: "../_includes", 41 | data: "../_data", 42 | output: "dist" 43 | } 44 | }; 45 | }; 46 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | export BUTTONDOWN_API_KEY= 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: HugoDF 2 | -------------------------------------------------------------------------------- /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | strategy: 11 | matrix: 12 | node-version: [lts/*] 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v4 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - name: npm install, format, and build 21 | run: | 22 | npm i 23 | npm run format 24 | npm run build 25 | env: 26 | CI: true 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Optional REPL history 57 | .node_repl_history 58 | 59 | # Output of 'npm pack' 60 | *.tgz 61 | 62 | # Yarn Integrity file 63 | .yarn-integrity 64 | 65 | # dotenv environment variables file 66 | .env 67 | .env.test 68 | 69 | # parcel-bundler cache (https://parceljs.org/) 70 | .cache 71 | 72 | # next.js build output 73 | .next 74 | 75 | # nuxt.js build output 76 | .nuxt 77 | 78 | # vuepress build output 79 | .vuepress/dist 80 | 81 | # Serverless directories 82 | .serverless/ 83 | 84 | # FuseBox cache 85 | .fusebox/ 86 | 87 | # DynamoDB Local files 88 | .dynamodb/ 89 | 90 | dist 91 | .tailwind-cache.css 92 | .inline-css-cache 93 | .remote-asset-cache 94 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2019-2020 Hugo Di Francesco 3 | 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, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Alpine.js Playground 2 | 3 | A set of ready to use Alpine.js examples with TailwindCSS. 4 | 5 | Find the examples in the [pages](./pages) directory. 6 | 7 | ## Requirements 8 | 9 | - Node 10 10 | - Yarn 1.x or npm 11 | 12 | ## Setup 13 | 14 | 1. Clone the repository 15 | 2. Run `yarn` or `npm install` installs all required dependencies. 16 | 17 | ## npm scripts 18 | 19 | > Equivalent `npm run 17 | {% endfor %} 18 | 23 | 24 | 25 |
26 |116 | 💥 Subscribe for Early Access 117 | to the 118 | Alpine.js Handbook 121 | 📖 💥 122 |
123 |