@cryptotaxi247 / kubo / commits / 87fb60b27

Update go generate command and edit readme accordingly

longfeiW committed Nov 18, 2021 at 16:04 UTC 87fb60b278fdf0f9fa40d8e065f95dbd630ba85c
11 files changed +5 -250
assets/README.md
+2 -35
@@ -3,7 +3,7 @@
3 This directory contains the go-ipfs assets:
4
5 * Getting started documentation (`init-doc`).
6 -* Directory listing HTML template (`dir-index-html` git submodule).
6 +* Directory listing HTML template (`dir-index-html`).
7
8 These assets are compiled into `bindata.go` with `go generate`.
9
@@ -16,37 +16,4 @@ assets directory:
16
17 ```
18 go generate .
19 -```
20 -
21 -## Updating dir-index-html
22 -
23 -Upstream: https://github.com/ipfs/dir-index-html
24 -
25 -dir-index-html is a git submodule. To update, run the following commands from
26 -this directory.
27 -
28 -```bash
29 -> git -C dir-index-html pull
30 -> git -C dir-index-html checkout vX.Y.Z # target version
31 -```
32 -
33 -Then, you'll need to commit the updated submodule _before_ regenerating
34 -`bindata.go`. Otherwise, `go generate` will checkout the checked-in version of
35 -dir-index-html.
36 -
37 -```bash
38 -> git add dir-index-html
39 -> git commit -m 'chore: update dir-index-html to vX.Y.Z'
40 -```
41 -
42 -Finally, re-generate the directory index HTML template, tidy, and amend the previous
43 -commit.
44 -
45 -```bash
46 -> go generate .
47 -> git add bindata.go
48 -> git add bindata_version_hash.go
49 -> go mod tidy
50 -> git commit --amend --no-edit
51 -
52 -```
19 +```
\ No newline at end of file
assets/assets.go
+1 -1
@@ -1,4 +1,4 @@
1 -//go:generate git submodule update --init ./dir-index-html
1 +//go:generate npm run build --prefix ./dir-index-html/
2 //go:generate go run github.com/go-bindata/go-bindata/v3/go-bindata -mode=0644 -modtime=1403768328 -pkg=assets init-doc dir-index-html/dir-index.html dir-index-html/knownIcons.txt
3 //go:generate gofmt -s -w bindata.go
4 //go:generate sh -c "sed -i \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go"
assets/dir-index-html/.github/ISSUE_TEMPLATE/config.yml deleted
-8
@@ -1,8 +0,0 @@
1 -blank_issues_enabled: false
2 -contact_links:
3 - - name: Getting Help on IPFS
4 - url: https://ipfs.io/help
5 - about: All information about how and where to get help on IPFS.
6 - - name: IPFS Official Forum
7 - url: https://discuss.ipfs.io
8 - about: Please post general questions, support requests, and discussions here.
assets/dir-index-html/.github/ISSUE_TEMPLATE/open_an_issue.md deleted
-19
@@ -1,19 +0,0 @@
1 ----
2 -name: Open an issue
3 -about: Only for actionable issues relevant to this repository.
4 -title: ''
5 -labels: need/triage
6 -assignees: ''
7 -
8 ----
9 -<!--
10 -Hello! To ensure this issue is correctly addressed as soon as possible by the IPFS team, please try to make sure:
11 -
12 -- This issue is relevant to this repository's topic or codebase.
13 -
14 -- A clear description is provided. It should includes as much relevant information as possible and clear scope for the issue to be actionable.
15 -
16 -FOR GENERAL DISCUSSION, HELP OR QUESTIONS, please see the options at https://ipfs.io/help or head directly to https://discuss.ipfs.io.
17 -
18 -(you can delete this section after reading)
19 --->
assets/dir-index-html/.github/config.yml deleted
-68
@@ -1,68 +0,0 @@
1 -# Configuration for welcome - https://github.com/behaviorbot/welcome
2 -
3 -# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
4 -# Comment to be posted to on first time issues
5 -newIssueWelcomeComment: >
6 - Thank you for submitting your first issue to this repository! A maintainer
7 - will be here shortly to triage and review.
8 -
9 - In the meantime, please double-check that you have provided all the
10 - necessary information to make this process easy! Any information that can
11 - help save additional round trips is useful! We currently aim to give
12 - initial feedback within **two business days**. If this does not happen, feel
13 - free to leave a comment.
14 -
15 - Please keep an eye on how this issue will be labeled, as labels give an
16 - overview of priorities, assignments and additional actions requested by the
17 - maintainers:
18 -
19 - - "Priority" labels will show how urgent this is for the team.
20 - - "Status" labels will show if this is ready to be worked on, blocked, or in progress.
21 - - "Need" labels will indicate if additional input or analysis is required.
22 -
23 - Finally, remember to use https://discuss.ipfs.io if you just need general
24 - support.
25 -
26 -# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
27 -# Comment to be posted to on PRs from first time contributors in your repository
28 -newPRWelcomeComment: >
29 - Thank you for submitting this PR!
30 -
31 - A maintainer will be here shortly to review it.
32 -
33 - We are super grateful, but we are also overloaded! Help us by making sure
34 - that:
35 -
36 - * The context for this PR is clear, with relevant discussion, decisions
37 - and stakeholders linked/mentioned.
38 -
39 - * Your contribution itself is clear (code comments, self-review for the
40 - rest) and in its best form. Follow the [code contribution
41 - guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#code-contribution-guidelines)
42 - if they apply.
43 -
44 - Getting other community members to do a review would be great help too on
45 - complex PRs (you can ask in the chats/forums). If you are unsure about
46 - something, just leave us a comment.
47 -
48 - Next steps:
49 -
50 - * A maintainer will triage and assign priority to this PR, commenting on
51 - any missing things and potentially assigning a reviewer for high
52 - priority items.
53 -
54 - * The PR gets reviews, discussed and approvals as needed.
55 -
56 - * The PR is merged by maintainers when it has been approved and comments addressed.
57 -
58 - We currently aim to provide initial feedback/triaging within **two business
59 - days**. Please keep an eye on any labelling actions, as these will indicate
60 - priorities and status of your contribution.
61 -
62 - We are very grateful for your contribution!
63 -
64 -
65 -# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
66 -# Comment to be posted to on pull requests merged by a first time user
67 -# Currently disabled
68 -#firstPRMergeComment: ""
assets/dir-index-html/.github/workflows/build.yml deleted
-21
@@ -1,21 +0,0 @@
1 -name: Build
2 -on: [push, pull_request]
3 -
4 -jobs:
5 - no-uncommitted-changes:
6 - runs-on: ubuntu-latest
7 - steps:
8 - - uses: actions/checkout@v2
9 - with:
10 - ref: ${{ github.head_ref }}
11 - - name: Run Build
12 - uses: actions/setup-node@v1
13 - with:
14 - node-version: '12.x'
15 - - run: npm run build
16 - - name: Check working tree
17 - id: changes
18 - uses: UnicornGlobal/has-changes-action@v1.0.11
19 - - name: Check for uncommited changes
20 - if: steps.changes.outputs.changed == 1
21 - run: git status && git --no-pager diff --patch-with-raw && echo "Output does not match src/, uncommitted changes exist, follow build instructions from README" && exit 1
assets/dir-index-html/.gx/lastpubver deleted
-1
@@ -1 +0,0 @@
1 -1.0.4: QmT1jwrqzSMjSjLG5oBd9w4P9vXPKQksWuf5ghsE3Q88ZV
assets/dir-index-html/CHANGELOG.md deleted
-54
@@ -1,54 +0,0 @@
1 -# Changelog
2 -All notable changes to this project will be documented in this file.
3 -
4 -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5 -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6 -
7 -## [v1.2.0] - 2020-08-03
8 -This release streamlines the process for making future updates to this repo:
9 -
10 -- Moves source-of-truth HTML and CSS files into new `src` directory ([details](https://github.com/ipfs/dir-index-html/pull/40#issue-456530181))
11 -- Adds build script in `package.json` to generate minified/inlined `dir-index.html` at top level from individual files in `src` directory ([details](https://github.com/ipfs/dir-index-html/pull/40#issue-456530181))
12 -- Adds GitHub Action to guard against committing state where `dir-index.html` does not match source materials in `src` ([details](https://github.com/ipfs/dir-index-html/pull/40#pullrequestreview-456126397))
13 -
14 -## [v1.1.0] - 2020-07-24
15 -This release brings general tidying, plus some substantial UI enhancements! Big thanks to @neatonk for all the work.
16 -
17 -- Adds a column for CIDs between the name and size columns; CIDs are clickable links that open the item as a new "root path", enabling users to copy direct links to images or subdirectories (see https://github.com/ipfs/dir-index-html/issues/37 and https://github.com/ipfs/dir-index-html/issues/15)
18 -- Adds the size of the current directory to the header of the table (see https://github.com/ipfs/dir-index-html/issues/37 and https://github.com/ipfs/dir-index-html/issues/25)
19 -- Makes path components in table headers into links, so clicking on segments between directory slashes will go to that level of the directory tree (see https://github.com/ipfs/dir-index-html/issues/37 and https://github.com/ipfs/dir-index-html/issues/2)
20 -- Updates tests to include testing the above (see https://github.com/ipfs/dir-index-html/pull/38)
21 -- Reconciles legacy discrepancies between `dir-index.html` and `dir-index-uncat.html` (see https://github.com/ipfs/dir-index-html/pull/39)
22 -
23 -
24 -## [v1.0.6] - 2020-06-25
25 -- Adds favicon: visual consistency/prettiness, but more importantly prevents 404 error on an implicit /favicon.ico (see [#35](https://github.com/ipfs/dir-index-html/issues/35))
26 -- Adds social sharing metadata (see [#34](https://github.com/ipfs/dir-index-html/issues/34))
27 -- Updates contributing link in readme (thanks @stensonb!)
28 -
29 -
30 -## [v1.0.5] - 2020-05-05
31 -
32 -- Removes extraneous references to Glyphicons (closes [#23](https://github.com/ipfs/dir-index-html/issues/23))
33 -- Makes page responsive overall (closes [#24](https://github.com/ipfs/dir-index-html/issues/24))
34 -- Adds file icons for .wmv, .mov, .mkv (closes [#19](https://github.com/ipfs/dir-index-html/issues/19))
35 -- Strips out unneeded CSS
36 -- Makes colors more accessible consistent with those in ipfs-css
37 -- Tidies up in general
38 -
39 -
40 -## [v1.0.4] - 2020-04-21
41 -- Update style to match IPFS branding
42 -- Add links to ipfs.io, install help, and the bug tracker
43 -
44 -
45 -## [v1.0.3] - 2016-08-31
46 -- No release notes added
47 -
48 -
49 -## [v1.0.2] - 2016-08-31
50 -- No release notes added
51 -
52 -
53 -## [v1.0.1] - 2016-08-31
54 -- No release notes added
assets/dir-index-html/LICENSE deleted
-21
@@ -1,21 +0,0 @@
1 -The MIT License (MIT)
2 -
3 -Copyright (c) 2016 IPFS
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.
assets/dir-index-html/README.md
+1 -21
@@ -17,14 +17,7 @@
17 When making updates to the directory listing page template, please note the following:
18
19 1. Make your changes to the (human-friendly) source documents in the `src` directory
20 -2. Before testing or releasing, make sure to run the build script to update the minified version in the top-level directory:
21 -
22 -```bash
23 -> npm run build
24 -```
25 -3. To get your updates into `go-ipfs`, you'll need to do the following:
26 - - Cut a new, appropriately versioned release of `dir-index-html` (don't forget to bump the version number in `package.json`)
27 - - Make a PR against `go-ipfs` following [these instructions](https://github.com/ipfs/go-ipfs/tree/master/assets#updating-dir-index-html) for updating the directory index
20 +2. Before testing or releasing, make sure to run the `go generate .` script to update the minified version in the top-level `./assets` directory
21
22 ## Testing
23
@@ -39,16 +32,3 @@ This will listen on [`localhost:3000`](http://localhost:3000/) and reload the te
32
33 If you get a "no such file or directory" error upon trying `go run .`, make sure you ran `npm run build` to generate the minified artifact that the test is looking for.
34
42 -## Contribute
43 -
44 -Feel free to join in. All are welcome! A good place to start is to check the [issues](https://github.com/ipfs/dir-index-html/issues) for anything you find interesting.
45 -
46 -This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
47 -
48 -### Want to hack on IPFS?
49 -
50 -[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
51 -
52 -## License
53 -
54 -MIT
assets/dir-index-html/test/go.mod
+1 -1
@@ -1,3 +1,3 @@
1 module github.com/ipfs/dir-index-html/test
2
3 -go 1.14
3 +go 1.16